CloudFormation scan role lacks permissions for the Lambda layer and Amplify secret checks
Issue search
- I have searched the existing issues and this bug has not been reported yet
Which component is affected?
Other
Cloud Provider (if applicable)
AWS
Steps to Reproduce
- Deploy
permissions/templates/cloudformation/prowler-scan-role.ymlwithDeployLocalRole=true. - Deploy the StackSet's
TemplateBodyfrom the same file as a standalone stack, withRoleNamechanged so it can live in the same account. This is the role every StackSet member account gets. - In the same account and region, create a Lambda function with one layer, and an Amplify app with one branch.
- Run
prowler aws --checks awslambda_layer_no_secrets_in_content amplify_app_no_secrets_in_environment -f us-west-2 --role <role arn> --external-id <id>once per role, and once without--roleas an admin baseline.
Expected behavior
Both roles get the same result as the admin run, since prowler-additions-policy.json grants amplify:ListApps, amplify:ListBranches and lambda:GetLayerVersion.
Actual Result with Screenshots or Logs
Results for the test layer and app:
| role | awslambda_layer_no_secrets_in_content |
amplify_app_no_secrets_in_environment |
|---|---|---|
| admin (baseline) | PASS | PASS |
ProwlerScan (local role) |
MANUAL | PASS |
| StackSet copy | MANUAL | no finding, the app is not listed |
The error log (--log-level ERROR) for both roles:
ClientError[260]: An error occurred (AccessDeniedException) when calling the GetLayerVersionByArn operation: User: arn:aws:sts::<acct>:assumed-role/ProwlerScan/ProwlerAssessmentSession is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-west-2:<acct>:layer:...And for the StackSet copy only:
ClientError[44]: An error occurred (AccessDeniedException) when calling the ListApps operation: User: arn:aws:sts::<acct>:assumed-role/<stackset role>/ProwlerAssessmentSession is not authorized to perform: amplify:ListApps on resource: arn:aws:amplify:us-west-2:<acct>:apps/*lambda:GetLayerVersion (added to the JSON by #12233) is in neither copy of the inline policy, and amplify:ListApps and amplify:ListBranches (added by #11825) are in the local role but not in the StackSet copy. SecurityAudit and ViewOnlyAccess grant none of the three. The Terraform template is not affected because it reads prowler-additions-policy.json directly.
With the three actions added to the template and both stacks updated, both roles match the admin run (PASS, PASS) and the log has no AccessDenied errors.
How did you install Prowler?
Cloning the repository from github.com (git clone)
Environment Resource
Prowler CLI from a clone of master, run against a test account in us-west-2 with the roles deployed from the template
OS used
Amazon Linux 2023
Prowler version
5.45.0 (master at f0da33f)
Python version
3.12.13
Pip version
N/A (uv)
Context
The fix is four lines in the template plus a changelog fragment. Could you assign this to me so I can open the PR?
Source: prowler-cloud/prowler