View a markdown version of this page

AWS Secrets Manager extension in AWS Systems Manager Cloud Extensions - AWS Systems Manager

AWS Secrets Manager extension in AWS Systems Manager Cloud Extensions

Retrieve secrets from AWS Secrets Manager through a local, in-memory cache in your Lambda functions and containers. The Secrets Manager extension is an extension for AWS Systems Manager Cloud Extensions. It retrieves secrets from AWS Secrets Manager and caches them in memory. Your application gets secrets from localhost instead of calling Secrets Manager each time. The extension runs inside the Cloud Extensions runtime, which you can use with the following:

  • AWS Lambda, as a Lambda extension

  • Containers, as a base image or a sidecar

In the Extension catalog of Cloud Extensions on the Systems Manager console, this extension appears as AWS Secrets Manager. The identifier of the extension is aws:secretsmanager.

Topics

Overview

The Secrets Manager extension provides the following features:

  • Caching – The extension holds secrets in a local cache and serves them until the cache time to live (TTL) expires.

  • Two read routes – You read a secret with a query request or a path request. Both routes use the same cache.

  • Request protection – By default, the runtime requires callers to sign requests with Signature Version 4 (SigV4). The extension can also require a server-side request forgery (SSRF) token on query and path requests. The extension refuses requests that carry an X-Forwarded-For header.

  • Forced refresh – You add refreshNow=true to a request to bypass the cache.

  • Role chaining – You add roleArn to a request to read a secret as another IAM role. For example, you can read a secret in another account.

  • Prefetch – The extension can load secrets into the cache when it starts. You choose the secrets by ID or by tag key.

  • Resilience – The extension can keep serving a cached secret when a refresh fails for a moment.

The extension reads secrets but can't modify them. It supports most of the local HTTP API of the AWS Secrets Manager Agent, including refreshNow, roleArn, prefetching, and the SSRF token header. In most cases, you change only the endpoint and the path that your application calls. For more information, see Differences between the Secrets Manager extension in AWS Systems Manager Cloud Extensions and the AWS Secrets Manager Agent.

The extension never holds AWS credentials. The runtime signs every call to Secrets Manager, with the execution role of the extension or the credentials of the runtime.

Use cases

The Secrets Manager extension suits the following cases:

  • Database credentials – Retrieve database passwords

  • API keys and tokens – Access third-party service credentials

  • Encryption keys – Retrieve application encryption keys

  • OAuth credentials – Retrieve client secrets and refresh tokens

Next steps