Skyscanner / LambdaGuard

AWS Serverless Security

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting error using cli object has no attribute 'arn'

hendrixroa opened this issue · comments

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?

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?

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

@adeptex I'll test it again

I installed the last version of pip package, see screenshot

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

  • Possible solution?
    The IAM policy of LambdaGuard should have access to lambda?
    In another words which permission should have the lambdaGuard profile

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