

# Security in AWS Systems Manager Cloud Extensions

AWS Systems Manager Cloud Extensions runs AWS-authored logic in your compute environment, so security is a primary concern. Cloud Extensions addresses this concern through capabilities that you approve and an IAM execution role for each extension or profile. It also provides client authentication, integrity checks of extensions, and logging.

**Topics**
+ [Shared responsibility model](#cloud-extensions-security-shared-responsibility-model)
+ [Capability-based security](#cloud-extensions-security-capability-based-security)
+ [IAM execution role](#cloud-extensions-security-iam-execution-role)
+ [Authentication](#cloud-extensions-security-authentication)
+ [IAM permissions for the Cloud Extensions API](#cloud-extensions-security-iam-permissions-for-the-cloud-extensions-api)
+ [Integrity checks of extensions](#cloud-extensions-security-integrity-checks-of-extensions)
+ [Data privacy](#cloud-extensions-security-data-privacy)
+ [Logging](#cloud-extensions-security-logging)
+ [Network security](#cloud-extensions-security-network-security)
+ [Encryption](#cloud-extensions-security-encryption)
+ [Compliance validation](#cloud-extensions-security-compliance-validation)
+ [Vulnerability management](#cloud-extensions-security-vulnerability-management)
+ [Best practices](#cloud-extensions-security-best-practices)
+ [Next steps](#cloud-extensions-security-next-steps)

## Shared responsibility model
<a name="cloud-extensions-security-shared-responsibility-model"></a>

AWS is responsible for:
+ Building and maintaining the Cloud Extensions runtime
+ Securing the Cloud Extensions control plane
+ Publishing the SHA-256 hash of each extension release in the profile state
+ Building and maintaining AWS-authored extensions

You are responsible for:
+ Reviewing and approving the capabilities that extensions request
+ Configuring IAM roles with appropriate permissions
+ Configuring authentication for the local endpoint of the runtime
+ Choosing which version of each extension to run
+ Monitoring extension behavior and logs
+ Securing the environment where extensions run

## Capability-based security
<a name="cloud-extensions-security-capability-based-security"></a>

An extension declares the capabilities that it requests. Each capability is an action that the extension performs in the host environment. An extension can use a capability only after you approve the capability. The runtime enforces the approvals that you make.

### Capability types
<a name="cloud-extensions-security-capability-types"></a>

Each capability has an ID and a definition. A capability also has a purpose that explains why the extension requests it, and a flag that shows whether the extension requires it. The definition belongs to one of three types.

**AWS service calls**

A request to call specific operations of specific AWS services. The definition maps each service name to a list of operation names. For example, the required capability of the Parameter Store extension, Call Parameter Store, names the `ssm` service and the `GetParameter` and `GetParameters` operations.

**File system access**

A request to read or write files on the host. The definition includes the following fields:
+ **directory** – A base directory. The capability applies to the directory and its contents.
+ **paths** – Up to 10 specific file paths, for access to individual files instead of a whole directory.
+ **accessMode** – `READ_ONLY` allows the extension to read files but not change them. `READ_WRITE` allows the extension to read and write files.
+ **createMode** – Required when the access mode is `READ_WRITE`. `PRIVATE` makes files that the extension creates visible only to the user that is in effect when the extension creates the file. `PUBLIC` makes created files visible to any user on the host.

**Command execution**

A request to run a command on the host. The definition includes the following fields:
+ **command** – The command to run.
+ **args** – Up to 50 arguments that the runtime passes to the command.
+ **timeoutInSeconds** – The maximum run time of the command, from 1 to 5 seconds. The default is 1 second. The runtime stops the command when the time limit passes.

An extension can declare capabilities at the top level of its configuration and inside setting groups. Each list can contain up to 10 capabilities.

### Reviewing capabilities before approving them
<a name="cloud-extensions-security-reviewing-capabilities-before-approving-them"></a>

To review the capabilities of an extension, run the following command:

```bash
aws cloudextensions get-extension \
  --identifier aws:parameterstore \
  --query 'configuration.capabilities'
```

**To review the capabilities of an extension on the console**

1. Open the Systems Manager console at [https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/).

1. In the navigation pane, choose **Cloud Extensions**.

1. On the **Extension catalog** tab, choose the name of the extension.

1. Choose the **Capabilities** tab.

The tab lists what the extension can do in your resources. Each capability shows its name, its scope, the settings that relate to it, and whether the extension requires it. For example, the Parameter Store Extension has the required capability Call Parameter Store, with the scope `ssm:GetParameter` and `ssm:GetParameters`. The usage guide on the extension page recommends that you review the capabilities that you approve for the extension.

When you edit an extension in a profile, the **Capabilities summary** at the end of the page lists the capabilities that the extension requires. The list also includes the capabilities that your settings add. When you save, the console approves all of these capabilities. You don't approve each capability. The console shows the purpose and the scope of each capability, not its path. Some settings add a capability. For example, when you set **SSRF token source** to **File** for the Secrets Manager extension, the page shows **Adds capability: Read the SSRF token file**.

Check that:
+ The purpose of each capability matches the documented purpose of the extension.
+ The AWS service calls match the operations that you expect the extension to make.
+ File system capabilities cover only the directories and files that the extension needs.
+ Command capabilities run only the commands that you expect.

### Approving capabilities
<a name="cloud-extensions-security-approving-capabilities"></a>

To approve capabilities, pass their paths in the `--approve` option when you create or update a profile entry:

```bash
aws cloudextensions update-profile-entry \
  --profile-identifier my-application \
  --identifier {{profile-entry-id}} \
  --approve {{capability-path}} {{capability-path}}
```

Capabilities that you approved earlier stay approved. To see the capabilities that you approved, run the `get-profile-entry` command and read the `approved` field of the output.

### Least privilege
<a name="cloud-extensions-security-least-privilege"></a>

Approve only the capabilities that your use case needs. For file system capabilities, choose `READ_ONLY` when the extension doesn't need to write, and choose `PRIVATE` when the extension needs to create files. If an extension declares an optional capability that you don't need, don't approve the capability.

## IAM execution role
<a name="cloud-extensions-security-iam-execution-role"></a>

You create an IAM role for the extension to use. When the extension calls an AWS service, it assumes this role. Set the role as an extension default for a profile, or set it for one profile entry with the `--execution-role` option. The role at the profile entry overrides the role in the profile defaults.

You must attach permissions policies to the role that allow the AWS actions that the extension needs to do its work. The capabilities that you approve and the policies of the role work together. A capability allows the extension to use an AWS operation, and a policy of the role must also allow the operation. For example, the following policy allows the Parameter Store extension to read parameters under `/myapp/`:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ssm:GetParameter",
        "ssm:GetParameters"
      ],
      "Resource": "arn:aws:ssm:us-east-1:111122223333:parameter/myapp/*"
    }
  ]
}
```

If you don't set an execution role for the profile entry or the profile, the extension calls AWS with the credentials of the runtime. In Lambda, those credentials belong to the function role. In a container, the credentials depend on how you run the container.

In the trust policy of the role, allow the role that the runtime runs as to assume the role. That role is the Lambda function role, or the role whose credentials the container uses. Name it as an AWS principal, not as a service principal. The runtime assumes the role with `sts:AssumeRole`, and it doesn't use an external ID or session tags. The following trust policy allows a Lambda function role to assume the role:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::111122223333:role/my-function-role"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

### Choosing the execution role on the console
<a name="cloud-extensions-security-choosing-the-execution-role-on-the-console"></a>

On the console, you set the execution role for every extension in a profile on the **Runtime settings** tab of the profile. The console sets the execution role for the whole profile. To set the role:

1. Open the Systems Manager console at [https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/).

1. In the navigation pane, choose **Cloud Extensions**.

1. Choose the **Profiles** tab, and then choose the name of the profile.

1. Choose the **Runtime settings** tab, and then choose **Edit**.

1. For **Execution role**, choose a role from the list. The list has the following items, in this order:
   + **Compute resource's role** – The default. Extensions use the role of the compute resource that they run in. For example, an extension in a Lambda function uses the execution role of the function.
   + The current role of the profile, if the role isn't in your account.
   + Every IAM role in your account. The console lists a role whose path Cloud Extensions can't use, but it disables the role and shows the reason.

1. Choose **Save changes**.

To limit the effect of a compromised extension, use a separate execution role for each extension. Grant each role only the permissions that its extension needs.

## Authentication
<a name="cloud-extensions-security-authentication"></a>

Authentication controls how clients identify themselves when they call an extension on the local endpoint of the runtime. The authentication setting has the following options:
+ **runtimeCredentials** – The default. Clients sign each request with AWS Signature Version 4 (SigV4), using the same AWS credentials that the runtime has. In Lambda, those credentials belong to the function. In a container, those credentials are the ones that the container has.
+ **extensionKey** – Clients sign each request with SigV4, using the access key ID and the secret key of the profile.
+ **none** – The extension accepts requests without authentication.

You set authentication as an extension default of the profile, in `extensionDefaults.interfaceDefaults.http.authentication`.

A client signs a request for the AWS Region that it runs in, with the signing name of the extension. The signing name is `appconfig` for the AWS AppConfig extension, `ssm` for the Parameter Store extension, and `secretsmanager` for the Secrets Manager extension. The runtime reads the Region and the service name from the credential scope of the request. When the signature doesn't match, the error names the expected service name.

### Default authentication
<a name="cloud-extensions-security-default-authentication"></a>

When you create a profile without specifying authentication, the profile uses `runtimeCredentials`. Cloud Extensions doesn't generate a key. A Lambda function or a container signs requests with the credentials that it already has, so you don't create, store, or hand out a key. Use runtime credentials unless the callers can't use the credentials of the runtime. To set runtime credentials, send `{"runtimeCredentials": {}}`. To turn authentication off, send `{"none": true}`. To reset the profile to runtime credentials, send an empty `authentication` object.

### Using an extension key
<a name="cloud-extensions-security-using-an-extension-key"></a>

To use an extension key, set `extensionKey` as the authentication. An extension key has an access key ID and a secret key.

The access key ID starts with `CXEK`, followed by 16 uppercase letters and numbers. Cloud Extensions generates the access key ID and ignores any value that you send for it. The access key ID stays the same when you update the profile.

If you set `extensionKey` without a secret key, Cloud Extensions generates the secret key. Cloud Extensions returns the secret key once, in the response of the `CreateProfile` or `UpdateProfile` call that sets the key. After that, `GetProfile` returns the access key ID, and it returns `************` in place of the secret key. If the secret key is a reference to a Secrets Manager secret, `GetProfile` returns the ARN of the secret.

You can also provide the secret key. The secret key is either of the following:
+ **reference** – The ARN of a secret in AWS Secrets Manager.
+ **literal** – A string of 16 to 36 letters, numbers, and hyphens.

### Rotating the secret key
<a name="cloud-extensions-security-rotating-the-secret-key"></a>

To rotate the secret key, send `extensionKey` with no secret key. Cloud Extensions generates a new secret key, returns the key once, and keeps the access key ID:

```bash
aws cloudextensions update-profile \
  --identifier my-application \
  --extension-defaults '{
    "interfaceDefaults": {
      "http": {
        "authentication": { "extensionKey": {} }
      }
    }
  }'
```

Don't send an empty `authentication` object to rotate the key. An empty `authentication` object resets the profile to runtime credentials.

### Changing the authentication settings on the console
<a name="cloud-extensions-security-changing-the-authentication-settings-on-the-console"></a>

On the **Runtime settings** tab of a profile, the console shows the authentication and the execution role. The authentication applies to every extension in the profile. You set authentication only for the profile. When you add or edit an extension, the console has no authentication field.

The **Authentication** list has the following options:
+ **IAM credentials** – The default. Callers sign requests with the credentials of the compute resource. This option sets runtime credentials.
+ **Cloud Extensions access key** – Callers sign requests with an access key ID and a secret key for the profile. This option sets an extension key. Cloud Extensions generates the access key ID, and the access key ID stays the same when the secret changes.
+ **None** – The extensions accept requests without authentication.

**To change the authentication**

1. Open the Systems Manager console at [https://console.aws.amazon.com/systems-manager/](https://console.aws.amazon.com/systems-manager/).

1. In the navigation pane, choose **Cloud Extensions**.

1. Choose the **Profiles** tab, and then choose the name of the profile.

1. Choose the **Runtime settings** tab, and then choose **Edit**.

1. For **Authentication**, choose **IAM credentials**, **Cloud Extensions access key**, or **None**.

1. If you choose **Cloud Extensions access key**, choose a **Secret key** option:
   + **Generate secret** – The default for a new access key. Cloud Extensions generates a secret and shows it once, after you save.
   + **Use Secrets Manager secret** – Extensions read the secret from Secrets Manager. In the **Secret** list, choose a secret in your account and Region. The extensions need permission to read the secret. This is the recommended option.
   + **Enter secret** – Enter your own secret in **Secret value**. The value has 16 to 36 characters. Valid characters are a-z, A-Z, 0-9, and hyphens.
   + **Keep the current secret** – The current secret stays in use. This option appears when you edit a profile that already has an access key.
   + **Rotate the secret** – Cloud Extensions generates a new secret and keeps the access key ID. This option appears when you edit a profile that already has an access key.

1. Choose **Save changes**.

When Cloud Extensions generates or rotates a secret, the console shows the **Save your secret key** dialog after you save. The dialog shows the access key ID and the secret key. The console shows the secret key only once. Copy the keys, or choose **Download CSV file**, and then choose **Done**.

### Using a Secrets Manager secret
<a name="cloud-extensions-security-using-a-secrets-manager-secret"></a>

Store the secret key in AWS Secrets Manager and reference the secret in the authentication setting. Secrets Manager provides access control through IAM, auditing through AWS CloudTrail, and rotation. A `literal` secret key doesn't provide these protections, so use a literal key only for testing.

The secret holds the key as a plain string. The runtime uses the `SecretString` exactly as stored. The runtime doesn't read inside JSON, and it can't use a binary secret.

```bash
aws cloudextensions update-profile \
  --identifier my-application \
  --extension-defaults '{
    "interfaceDefaults": {
      "http": {
        "authentication": {
          "extensionKey": {
            "secretKey": {
              "reference": "arn:aws:secretsmanager:us-east-1:111122223333:secret:cloud-extensions/auth-AbCdEf"
            }
          }
        }
      }
    }
  }'
```

The role that reads the secret needs `secretsmanager:GetSecretValue` on the secret. The role also needs `kms:Decrypt` if the secret uses a customer managed key. The role depends on where you set the key:
+ For a key on the profile, the role is the execution role of the profile.
+ If no execution role is set, the runtime reads the secret with its own credentials.

The runtime keeps the current and previous versions of the secret. These versions have the staging labels `AWSCURRENT` and `AWSPREVIOUS`. Callers that still use the previous key keep working during a rotation. When a request uses a key that the runtime doesn't have, the runtime reads the secret again, at most once a minute. A rotation takes effect within about a minute.

### Turning authentication off
<a name="cloud-extensions-security-turning-authentication-off"></a>

If you trust every process that can reach localhost on your compute, you can turn authentication off:

```bash
aws cloudextensions update-profile \
  --identifier my-application \
  --extension-defaults '{
    "interfaceDefaults": {
      "http": {
        "authentication": { "none": true }
      }
    }
  }'
```

Without authentication, any process that can reach the local endpoint can call your extensions.

## IAM permissions for the Cloud Extensions API
<a name="cloud-extensions-security-iam-permissions-for-the-cloud-extensions-api"></a>

The IAM service prefix for the Cloud Extensions API is `cloudextensions`. The names of the IAM actions for the control plane match the names of the API operations. The runtime also uses the data plane action `cloudextensions:SyncState`. For this action, see [Permissions for the runtime](#cloud-extensions-security-permissions-for-the-runtime). The following policy allows an administrator to manage profiles and profile entries:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudextensions:CreateProfile",
        "cloudextensions:GetProfile",
        "cloudextensions:UpdateProfile",
        "cloudextensions:DeleteProfile",
        "cloudextensions:ListProfiles",
        "cloudextensions:CreateProfileEntry",
        "cloudextensions:GetProfileEntry",
        "cloudextensions:UpdateProfileEntry",
        "cloudextensions:DeleteProfileEntry",
        "cloudextensions:ListProfileEntries"
      ],
      "Resource": [
        "arn:aws:cloudextensions:*:111122223333:profiles/*",
        "arn:aws:cloudextensions:*:111122223333:profiles/*/entries/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cloudextensions:GetExtension",
        "cloudextensions:ListExtensionVersions"
      ],
      "Resource": "arn:aws:cloudextensions::aws:extensions/*"
    },
    {
      "Effect": "Allow",
      "Action": "cloudextensions:ListExtensions",
      "Resource": "*"
    }
  ]
}
```

An extension ARN has no Region, and it has `aws` where an account ID is. For example, the ARN of the Secrets Manager extension is `arn:aws:cloudextensions::aws:extensions/aws:secretsmanager`. An extension version has no ARN of its own, so `ListExtensionVersions` uses the ARN of the extension. `ListExtensions` doesn't apply to one extension, so it uses `*`.

The `TagResource`, `UntagResource`, and `ListTagsForResource` operations manage tags on profiles and profile entries.

### Permissions for the runtime
<a name="cloud-extensions-security-permissions-for-the-runtime"></a>

The runtime retrieves the state of its profile from Cloud Extensions. The runtime makes this call with the credentials that it uses for AWS calls. In Lambda, those credentials belong to the function role. In a container, the credentials depend on how you run the container. Grant the credentials that the runtime uses the `cloudextensions:SyncState` action on all resources. The following policy allows the action:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "cloudextensions:SyncState",
      "Resource": "*"
    }
  ]
}
```

This role isn't the IAM execution role of an extension. The execution role gives an extension access to the AWS services that it calls.

If an extension has no execution role, the extension calls AWS with the credentials of the runtime. In that case, the role of the runtime also needs the permissions that the extension uses. For example, the Secrets Manager extension without an execution role needs `secretsmanager:GetSecretValue` on the role of the function.

### Condition keys
<a name="cloud-extensions-security-condition-keys"></a>

Cloud Extensions supports the following condition keys:
+ `aws:ResourceTag/${TagKey}` - Controls access based on the tags of a profile or a profile entry. This key applies to every action on an existing profile or profile entry.
+ `aws:RequestTag/${TagKey}` - Controls access based on the tags that you pass in a request. This key applies to `CreateProfile`, `CreateProfileEntry`, and `TagResource`. IAM also evaluates `TagResource` for tags that you pass in a create request.
+ `aws:TagKeys` - Controls access based on the tag keys that you pass in a request. This key applies to `CreateProfile`, `CreateProfileEntry`, `TagResource`, and `UntagResource`. The `UntagResource` operation sends only keys.

For the actions, resources, and condition keys of AWS services, see [Actions, resources, and condition keys for AWS services](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html) in the *Service Authorization Reference*.

### Limiting who can change profiles
<a name="cloud-extensions-security-limiting-who-can-change-profiles"></a>

A profile entry controls which code runs in your environment and which capabilities that code can use. Use IAM policies to limit who can create, update, and delete profile entries.

If a resource doesn't exist or you don't have permission to access the resource, the API returns the same `ResourceNotFoundException` error.

## Integrity checks of extensions
<a name="cloud-extensions-security-integrity-checks-of-extensions"></a>

The runtime checks the integrity of each extension before it loads and runs the extension. The runtime gets the state of its profile from Cloud Extensions. The state includes the SHA-256 hash of each extension artifact. The runtime signs the request for the state with SigV4. The runtime compares the SHA-256 hash of each extension artifact that it downloads with the hash in the profile state. If the hashes don't match, the runtime logs a warning, downloads the extension again, and loads the extension that matches. If the hash still doesn't match after the runtime downloads the extension again, the runtime doesn't load that version. If an earlier version of the extension is already running, that version keeps running. If not, the extension stays unloaded, and calls to the extension fail. The runtime tries again at its later profile checks. For more information, see [The runtime logs a hash mismatch](cloud-extensions-updates.md#cloud-extensions-updates-the-runtime-logs-a-hash-mismatch).

### Extension releases are immutable
<a name="cloud-extensions-security-extension-releases-are-immutable"></a>

AWS publishes each extension release as an immutable package with a semantic version. After AWS publishes a release, the release doesn't change. When you pin a profile entry to an exact version, the runtime runs the same package every time. For more information, see [Managing AWS Systems Manager Cloud Extensions updates](cloud-extensions-updates.md).

## Data privacy
<a name="cloud-extensions-security-data-privacy"></a>

### What data stays local
<a name="cloud-extensions-security-what-data-stays-local"></a>

The following data remains in your environment:
+ Configuration data that extensions cache, such as parameters, secrets, and AppConfig data
+ Application request payloads
+ Cached responses from AWS services
+ Files that extensions read or write

### What data the runtime sends to AWS
<a name="cloud-extensions-security-what-data-the-runtime-sends-to-aws"></a>

The runtime sends operational telemetry to AWS. The telemetry includes data about each extension, such as the number of invocations, errors, and faults, the memory use, and the duration of calls. For the complete list, see [Telemetry that the runtime sends](cloud-extensions-monitoring.md#cloud-extensions-monitoring-telemetry-that-the-runtime-sends). You can't turn telemetry off. The runtime buffers telemetry for retry when the network is unavailable.

## Logging
<a name="cloud-extensions-security-logging"></a>

The runtime writes logs that show the profile it loaded, the extensions it started, and errors. In Lambda, set the `AWS_CLOUDEXTENSIONS_LOG_LEVEL` environment variable to set the verbosity of the logs. The valid values are `debug`, `info`, `warn`, `error`, and `none`. The default is `info`.

In Lambda, the runtime logs go to the log group of the function as JSON, one event per line. In a container, the logs go wherever the output of the container goes, as plain text.

AWS CloudTrail records the Cloud Extensions API calls as management events. The calls that the runtime makes to the service are data events. CloudTrail records them only for trails that you set up to log data events for profiles.

## Network security
<a name="cloud-extensions-security-network-security"></a>

### Local endpoint
<a name="cloud-extensions-security-local-endpoint"></a>

The runtime serves extensions on an HTTP endpoint. In Lambda, the runtime listens on `localhost`, and the default port is 5333. Keep authentication on unless you trust every process that can reach the endpoint. Authentication is on by default.

### Connections to AWS
<a name="cloud-extensions-security-connections-to-aws"></a>

The runtime communicates with the Cloud Extensions control plane and with the AWS services that your extensions call. All communication uses TLS. For the endpoints of the Cloud Extensions API, see [Regions and endpoints for AWS Systems Manager Cloud Extensions](cloud-extensions-regions-endpoints.md).

To reach the Cloud Extensions API privately, use an interface VPC endpoint. The service names are `com.amazonaws.{{region}}.cloudextensions` and, in Regions that have a Federal Information Processing Standard (FIPS) endpoint, `com.amazonaws.{{region}}.cloudextensions-fips`.

To use FIPS or dual-stack endpoints for the AWS services that an extension calls, use the standard AWS SDK settings. Set the `AWS_USE_FIPS_ENDPOINT` and `AWS_USE_DUALSTACK_ENDPOINT` environment variables, or set `use_fips_endpoint` and `use_dualstack_endpoint` in the AWS config file.

## Encryption
<a name="cloud-extensions-security-encryption"></a>

### Encryption in transit
<a name="cloud-extensions-security-encryption-in-transit"></a>

All communication between the runtime and AWS services uses TLS. Extensions that call AWS services use the AWS SDK, which enforces TLS.

### Encryption at rest
<a name="cloud-extensions-security-encryption-at-rest"></a>

The runtime stores profiles, extensions, and runtime settings in its data directory. For containers, store the data directory on an encrypted file system.

## Compliance validation
<a name="cloud-extensions-security-compliance-validation"></a>

To learn whether Cloud Extensions is in scope of specific compliance programs, see [AWS services in scope by compliance program](https://aws.amazon.com/compliance/services-in-scope/).

## Vulnerability management
<a name="cloud-extensions-security-vulnerability-management"></a>

### Reporting vulnerabilities
<a name="cloud-extensions-security-reporting-vulnerabilities"></a>

If you discover a security vulnerability in Cloud Extensions, report it to AWS Security at [aws-security@amazon.com](mailto:aws-security@amazon.com). Don't disclose the vulnerability publicly until AWS Security confirms that you can.

## Best practices
<a name="cloud-extensions-security-best-practices"></a>

Use the following practices to maintain a secure Cloud Extensions deployment:

1. **Review capabilities carefully** – Examine what an extension requests before you approve the capabilities.

1. **Use least privilege** – Approve only the capabilities that an extension needs, and grant its execution role only the IAM permissions that the extension needs.

1. **Use a separate execution role for each extension** – A separate role limits the effect of a compromised extension.

1. **Use runtime credentials** – The default authentication needs no key. If you use an extension key, store the secret key in Secrets Manager before you use the profile in production.

1. **Restrict who can change profiles** – Use IAM policies to limit who can create, update, and delete profile entries.

1. **Choose version policies deliberately** – Use the manual update strategy with an exact version for workloads that require change control.

1. **Isolate environments** – Use separate profiles for development, staging, and production.

1. **Encrypt at rest** – For containers, use encrypted storage for the runtime data directory.

1. **Secure the endpoint** – Keep authentication on, and restrict network access to the port of the runtime.

1. **Test before production** – Validate new extension versions and profile changes in a non-production environment first.

## Next steps
<a name="cloud-extensions-security-next-steps"></a>
+ [Approving capabilities](cloud-extensions-profiles.md#cloud-extensions-profiles-approving-capabilities)
+ [Managing AWS Systems Manager Cloud Extensions updates](cloud-extensions-updates.md)
+ [Monitoring AWS Systems Manager Cloud Extensions](cloud-extensions-monitoring.md)