# aws-iam-all-privileges

Rule `sonarjs/aws-iam-all-privileges`. Policies should not grant all privileges

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1174 by reach, #475 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/aws-iam-all-privileges` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-6302/) |

## Code examples

### Correct: the rule accepts this

```js
import { aws_iam as iam } from 'aws-cdk-lib'

new iam.PolicyStatement({
    effect: iam.Effect.ALLOW,
    actions: ["iam:GetAccountSummary"],
    resources: ["arn:aws:iam:::user/*"],
})
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/aws-iam-all-privileges": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/aws-efs-unencrypted](https://lintradar.dev/rules/sonarjs/aws-efs-unencrypted.md): Amazon EFS file systems should be encrypted
- [sonarjs/aws-iam-privilege-escalation](https://lintradar.dev/rules/sonarjs/aws-iam-privilege-escalation.md): AWS IAM policies should limit the scope of permissions given
- [sonarjs/aws-ec2-unencrypted-ebs-volume](https://lintradar.dev/rules/sonarjs/aws-ec2-unencrypted-ebs-volume.md): EBS volumes should be encrypted
- [sonarjs/aws-iam-public-access](https://lintradar.dev/rules/sonarjs/aws-iam-public-access.md): AWS resource-based policies should not grant public access
- [sonarjs/aws-ec2-rds-dms-public](https://lintradar.dev/rules/sonarjs/aws-ec2-rds-dms-public.md): Public network access to cloud resources should be disabled
- [sonarjs/aws-opensearchservice-domain](https://lintradar.dev/rules/sonarjs/aws-opensearchservice-domain.md): OpenSearch domains should have encryption at rest enabled

---

Web page: https://lintradar.dev/rules/sonarjs/aws-iam-all-privileges. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
