sonarjs/aws-iam-privilege-escalation
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/aws-iam-privilege-escalation": "error",
},
},
];AWS IAM policies should limit the scope of permissions given
import {aws_iam as iam} from 'aws-cdk-lib'
new iam.PolicyDocument({
statements: [new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ["lambda:UpdateFunctionCode"],
resources: ["*"], // Noncompliant
})],
})import {aws_iam as iam} from 'aws-cdk-lib'
new iam.PolicyDocument({
statements: [new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ["lambda:UpdateFunctionCode"],
resources: ["arn:aws:lambda:us-east-2:123456789012:function:my-function:1"], // Noncompliant
})],
})Examples from the ESLint documentation.
sonarjs/aws-iam-privilege-escalation
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/aws-iam-privilege-escalation": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
AWS resource-based policies should not grant public access
OpenSearch domains should have encryption at rest enabled
Amazon RDS resources should be encrypted at rest