# aws-rds-unencrypted-databases

Rule `sonarjs/aws-rds-unencrypted-databases`. Amazon RDS resources should be encrypted at rest

- 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: #1178 by reach, #479 by growth

## Linters

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

## Code examples

### Correct: the rule accepts this

```js
import { aws_rds as rds } from 'aws-cdk-lib';

new rds.CfnDBCluster(this, 'example', {
  storageEncrypted: true,
});
```

```js
import { aws_rds as rds } from 'aws-cdk-lib';

new rds.CfnDBInstance(this, 'example', {
  storageEncrypted: true,
});
```

```js
import { aws_rds as rds } from 'aws-cdk-lib';

declare const vpc: ec2.Vpc;

const cluster = new rds.DatabaseCluster(this, 'example', {
  engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_08_1 }),
  instanceProps: {
    vpcSubnets: {
      subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
    },
    vpc,
  },
  storageEncrypted: false, // Sensitive
});
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/aws-rds-unencrypted-databases": "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-opensearchservice-domain](https://lintradar.dev/rules/sonarjs/aws-opensearchservice-domain.md): OpenSearch domains should have encryption at rest enabled
- [sonarjs/aws-restricted-ip-admin-access](https://lintradar.dev/rules/sonarjs/aws-restricted-ip-admin-access.md): Administration services access should be restricted to specific IP addresses
- [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-s3-bucket-granted-access](https://lintradar.dev/rules/sonarjs/aws-s3-bucket-granted-access.md): S3 buckets should not grant access to all users or authenticated users
- [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-s3-bucket-insecure-http](https://lintradar.dev/rules/sonarjs/aws-s3-bucket-insecure-http.md): S3 buckets should enforce HTTPS-only access

---

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