Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors on line 18 #2

Closed
kenzoawa opened this issue Jun 19, 2019 · 2 comments
Closed

errors on line 18 #2

kenzoawa opened this issue Jun 19, 2019 · 2 comments

Comments

@kenzoawa
Copy link

kenzoawa commented Jun 19, 2019

Hi There @brianwarehime
Must say that this is a great tool!

I have come across a problem on line 18 in logs where it says :

'accessKeyDetails': KeyError
Traceback (most recent call last):
File "/var/task/main.py", line 18, in lambda_handler
event_principal = (event['detail']['resource']['accessKeyDetails']['principalId'])
KeyError: 'accessKeyDetails'

And the GuardDuty event isn't posted on slack channel and the monitoring on the lambda trows an error.

The notification i have got in GuardDuty is :
UnauthorizedAccess:EC2

If you can shed some light, that would be great.
Thanks.

@kenzoawa
Copy link
Author

When you comment out those lines - Lambda will execute okay.

My guess is that in the json output that GD produces there is no field with event_principal.

@brianwarehime
Copy link
Owner

Hey, I totally forgot to update that before zipping it up. Just pushed a fix for this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants