Ensure that the IAM execution role associated with each Amazon Lambda function is using managed policies instead of inline policies for simplicity and manageability.
excellence
A Lambda function's execution role is an AWS Identity and Access Management (IAM) role that grants the function permission to access specific AWS services and resources. IAM execution roles for Lambda functions should avoid inline policies because customer-inline policies are embedded directly in the role, making them harder to version, audit, and modify. Using managed policies allows for easier policy management, updates, and adheres to AWS cloud best practices while enhancing security and compliance.
Audit
To determine if the IAM execution roles associated with Lambda functions are using inline policies, perform the following actions:
Remediation / Resolution
To ensure that the IAM execution role associated with your Amazon Lambda functions is not using inline policies, perform the following actions:
References
- AWS Documentation
- Lambda resource access permissions
- Lambda execution role
- Identity-based IAM policies for Lambda
- Configuring Lambda function options
- AWS Command Line Interface (CLI) Documentation
- list-functions
- get-function
- list-role-policies
- delete-role-policy
- attach-role-policy