Skyscanner / LambdaGuard

AWS Serverless Security
Apache License 2.0
400 stars 69 forks source link

Getting error using cli object has no attribute 'arn' #3

Closed hendrixroa closed 5 years ago

hendrixroa commented 5 years ago

When I run lambdaguard --function 'myarfunction' --profile myprofile --region region --verbose i getting those errors: /lambdaguard/core/Lambda.py", line 184, in report 'role': self.role.arn.full, AttributeError: 'NoneType' object has no attribute 'arn'

Should I install some dependency?

adeptex commented 5 years ago

Hi @hendrixroa, there should probably be more error handling around that...

the --function argument should be like arn:aws:... is that the format you're using for myarfunction?

adeptex commented 5 years ago

@hendrixroa i can't reproduce your issue. can you please post your lambdaguard.log?

hendrixroa commented 5 years ago

@adeptex I'll test it again

hendrixroa commented 5 years ago

I installed the last version of pip package, see screenshot

Screen Shot 2019-09-25 at 8 43 49 PM

adeptex commented 5 years ago

Hi @hendrixroa you can use make aws to setup AWS access. Basically it just needs arn:aws:iam::aws:policy/ReadOnlyAccess to make everything work without having to specify explicit permissions for each service.

Although in your case it seems that your Lambda function doesn't have an IAM role defined. I will implement an exception handler for that

adeptex commented 5 years ago

Fixed in https://github.com/Skyscanner/LambdaGuard/commit/f6b7916d1f5c5379f0f9f3c973c805067784aa65