

# Security considerations for the Secrets Manager extension in AWS Systems Manager Cloud Extensions

Use the following practices to protect the secrets that the Secrets Manager extension serves.

1. **Use SigV4 as the main protection** – An attacker who can only make your application send requests to `localhost` can't produce a valid signature. The server-side request forgery (SSRF) token check is a second layer.

1. **Know the domain of trust** – Anything that can reach the port of the extension and pass its caller authentication can read cached secrets. In Lambda, the runtime listens on `localhost`. Restrict access to the port of the runtime with your network configuration.

1. **Cached secrets are in memory** – The cache doesn't encrypt secret values. Make sure that your compute environment is secure.

1. **Protect the SSRF token** – The extension stores the **SSRF token** setting in plaintext in the profile entry. Use IAM policies to limit who can read profile entries.

1. **Use IAM for access control** – Limit which secrets each compute resource can access.

1. **Turn on AWS CloudTrail** – Audit secret access. CloudTrail records the calls that the extension makes to Secrets Manager.

1. **Use customer managed AWS Key Management Service (AWS KMS) keys** – Keys that you manage give you more control over encryption.

1. **Rotate regularly** – Turn on automatic rotation for your secrets.

1. **Monitor access patterns** – Use CloudWatch to detect anomalies.

Applications that need to keep secrets in one process can use a caching library of Secrets Manager instead.