# aws-sagemaker-unencrypted-notebook

Rule `sonarjs/aws-sagemaker-unencrypted-notebook`. SageMaker notebook instances 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: #1184 by reach, #485 by growth

## Linters

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

## Code examples

### Correct: the rule accepts this

```js
import { CfnNotebookInstance } from 'aws-cdk-lib/aws-sagemaker';

const encryptionKey = new Key(this, 'example', {
    enableKeyRotation: true,
});
new CfnNotebookInstance(this, 'example', {
    instanceType: 'instanceType',
    roleArn: 'roleArn',
    kmsKeyId: encryptionKey.keyId
});
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/aws-sagemaker-unencrypted-notebook": "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-s3-bucket-versioning](https://lintradar.dev/rules/sonarjs/aws-s3-bucket-versioning.md): Amazon S3 buckets should have versioning enabled
- [sonarjs/aws-sns-unencrypted-topics](https://lintradar.dev/rules/sonarjs/aws-sns-unencrypted-topics.md): Amazon SNS topics should be encrypted at rest
- [sonarjs/aws-s3-bucket-public-access](https://lintradar.dev/rules/sonarjs/aws-s3-bucket-public-access.md): Amazon S3 bucket public access should be fully blocked
- [sonarjs/aws-sqs-unencrypted-queue](https://lintradar.dev/rules/sonarjs/aws-sqs-unencrypted-queue.md): SQS queues should be encrypted
- [sonarjs/aws-s3-bucket-insecure-http](https://lintradar.dev/rules/sonarjs/aws-s3-bucket-insecure-http.md): S3 buckets should enforce HTTPS-only access
- [sonarjs/bitwise-operators](https://lintradar.dev/rules/sonarjs/bitwise-operators.md): Bitwise operators should not be used in boolean contexts

---

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