> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/aws/enable-s3-bucket-encryption-aes256.md).

# Enable S3 Bucket Encryption (AES256)

Turns on default server-side encryption with Amazon S3 managed keys (SSE-S3, `AES256`) for every S3 bucket that the workflow passes to it, with the S3 Bucket Key enabled. The job has no settings besides the AWS connection.

### Before you begin

* AWS credentials (access key ID and secret access key) that are allowed to call the AWS API actions listed below. Enter them in the node or save them once in [Action Center Settings](broken://pages/ea41765c908dc2733f18c3a1329cd7501b60f6da) (the **AWS** group has one tab per job, so each job needs its own defaults).
* Asset type: `service` only. Only service assets whose `ServiceType` is `object_storage` are used.
* Required columns: `Name` and `ServiceType`. `Name` is used as the S3 bucket name.
* AWS API actions the job calls: `PutBucketEncryption` (S3).

### Settings

The node form shows these fields. Field labels are generated from the field names, so they appear as listed here. The AWS access key ID and secret access key are plain text fields, not masked fields.

| Setting               | Type | Required | Default | Description                                                                               |
| --------------------- | ---- | -------- | ------- | ----------------------------------------------------------------------------------------- |
| Aws access key id     | Text | Yes      | None    | AWS access key ID the job signs its requests with. Not masked in the form or in Settings. |
| Aws secret access key | Text | Yes      | None    | Secret access key for the key ID above. Not masked in the form or in Settings.            |
| Aws region            | Text | Yes      | None    | AWS region the client connects to, for example `eu-west-1`. The value may be empty.       |

### How it works

The job takes the `Name` of every incoming service asset whose `ServiceType` is `object_storage` and treats each as a bucket. If there are none, the job fails with `No S3 buckets found in selected assets`.

For each bucket the job calls `PutBucketEncryption` with one rule: `ApplyServerSideEncryptionByDefault` with `SSEAlgorithm` set to `AES256` and `BucketKeyEnabled` set to true. The call replaces the bucket's default encryption configuration. Objects already in the bucket are not re-encrypted.

If an AWS call fails for a bucket, the job fails with `AWS S3 put bucket encryption failed for bucket <name>`. Buckets handled before it keep the new setting and later buckets are not processed.

The job does not change the asset data. It passes the incoming assets unchanged to the next node.

### Example

Put the job after a condition node (Service inventory) whose saved query returns the buckets that lack default encryption.

| Setting               | Value                        |
| --------------------- | ---------------------------- |
| Aws access key id     | `YOUR_AWS_ACCESS_KEY_ID`     |
| Aws secret access key | `YOUR_AWS_SECRET_ACCESS_KEY` |
| Aws region            | `eu-west-1`                  |

### Related jobs

Other S3 jobs: [Add Tags to S3 Bucket](broken://pages/652755eb6447754c9d289a442962c627a9266592) and [Delete Files from S3 Bucket](broken://pages/7d40ebcc44e7bef7ffcab055d2d2a98f2726b082).

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/94a9962c87c4d45ae1ec3bb263b516656f67490d">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save the AWS connection values as job defaults.</td><td><a href="broken://pages/ea41765c908dc2733f18c3a1329cd7501b60f6da">Broken link</a></td></tr><tr><td><strong>Add Tags to S3 Bucket</strong></td><td>A related AWS job.</td><td><a href="broken://pages/652755eb6447754c9d289a442962c627a9266592">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.5.0.
{% endhint %}
