State machine policies should avoid use of wildcards and instead apply the principle of least privilege
You should use the principle of least privilege when defining your IAM policies. This means you should specify each exact permission required without using wildcards, as this could cause the granting of access to certain undesired actions, resources and principals.
Overly permissive policies may grant access to sensitive resources
Follow the appropriate remediation steps below to resolve the issue.
Specify the exact permissions required, and to which resources they should apply instead of using wildcards.
---AWSTemplateFormatVersion:"2010-09-09"Description:A sample templateAWSTemplateFormatVersion:2010-09-09Description:Good Example of SAM FunctionResources:GoodFunction:Type:AWS::Serverless::StateMachineProperties:Definition:StartAt:MyLambdaStateStates:MyLambdaState:Type:TaskResource:arn:aws:lambda:us-east-1:123456123456:function:my-sample-lambda-appEnd:trueRole:arn:aws:iam::123456123456:role/service-role/my-sample-roleTracing:Enabled:truePolicies:- AWSLambdaExecute- Version:'2012-10-17'Statement:- Effect:AllowAction:- s3:GetObject- s3:GetObjectACLResource:'arn:aws:s3:::my-bucket/*'
Aqua Security is the largest pure-play cloud native security company, providing customers the freedom to innovate and run their businesses with minimal friction. The Aqua Cloud Native Security Platform provides prevention, detection, and response automation across the entire application lifecycle to secure the build, secure cloud infrastructure and secure running workloads wherever they are deployed.