> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/content-collections/runtime-security/secrets/secrets-manager.md).

# Secrets Manager

Containers often require sensitive information, such as passwords, SSH keys, encryption keys, and so on. You can integrate Prisma Cloud with many common secrets management platforms to securely distribute secrets from those stores to the containers that need them.

Enterprise secret stores reduce the risk of data breaches that could occur when sensitive information is littered across an organization, often in places where they should not be, such as email inboxes, source code repositories, developer workstations, and Dropbox. Secret stores provide a central and secure location for managing and distributing secrets to the apps that need them. They give you a way to account for all the secrets in your organization with audit trails that show how they are being used.

Orchestrators such as kubernetes and openshift, offer their own built-in secret stores with support for creating secrets, listing them, deleting them, and injecting them into containers. However, if you already have an enterprise secrets store, then you probably want to extend it to handle to your container environment. Utilizing the orchestrator’s built-in secrets management capabilities when you already have an enterprise secrets store is unappealing because it represents another silo of sensitive information that needs to be carefully secured. It undermines the principal benefit of a secrets store, which is managing all sensitive data in a single location.

## Theory of operation

When a user or orchestrator starts a container, Defender injects the secrets you specify into the container. In order for secret injection to work, all Docker commands must be routed through Defender. Refer to [Inject Secrets into Containers](/content-collections/runtime-security/secrets/inject-secrets.md).

There are several moving parts in the solution:

<figure><img src="/files/U4LlML1nGG46M4WYzSGH" alt="secrets manager 791688"><figcaption></figcaption></figure>

**A**. Secret values are fetched, encrypted, and stored in Console’s database when a rule is created or modified. Secret values in Console’s database are periodically synced with the secrets store to provide resiliency in the case of connectivity outages and to optimize performance. All secrets cached on disk, both in Defender and in Console, are protected with 256 bit AES encryption. If you change a secret’s value in the secrets store and you need it synced immediately, you can click the refresh button in the Console UI to refetch all secrets from their configured stores.

**1**. Operator (or orchestrator) starts a container with docker run.

**2**. Defender assesses the command against the policy installed in Console.

**3**.The secret is returned to Defender. Defender starts the container using the Docker API, which is exposed through the Docker daemon’s local UNIX socket, and injects the secret into the container.

## Capabilities

The Prisma Cloud secrets manager has the following capabilities:

* Supports integration with common secrets management platforms.
* Manages the distribution of secrets from the secret store to your containers through policies. In Console, you create the rules that control which secrets get injected into which containers.
* Injects secrets into containers as either environment variables or files.
* Secrets injected as environment variables are presented in-the-clear from within the container. They are redacted from the outside to prevent exposure by the docker inspect command.
* Secrets injected as files are provided from an in-memory filesystem (on /run/secrets/\<SECRET\_NAME>) that is mounted into the container when it is created. When the container is stopped, the secrets directory is unmounted and deleted.

## Best practices

There are a number of ways that secrets can be compromised.

**Defender is bypassed.** If Defender is bypassed, an attacker can execute Docker commands directly against the Docker daemon’s local UNIX socket, and he will be able to expose your secrets. Be sure that your hosts are secured with least privilege access so that users can only run docker commands through Defender.

<figure><img src="/files/bBrgqQYqPd30m7NplLa9" alt="secrets manager 790254"><figcaption></figcaption></figure>

**Limit lower privileged users to monitoring commands, such as docker ps and docker inspect.** Prisma Cloud automatically encrypts secrets injected as environment variables when accessed from docker inspect. Restrict commands such as docker exec and docker run to just the operators that need them because these commands can reveal secrets injected into a container by giving the user shell access inside the container, where variables are in the clear. For example, docker exec printenv on a running container, or docker run \<IMAGE\_ID> printenv on an image, can reveal environment variables that are otherwise encrypted with docker inspect. The following diagram shows one way to grant access to Docker functions based on a user’s role. This is the way that Docker Datacenter Universal Control Plane (UCP) grants permissions, and you can implement the same scheme with Prisma Cloud’s access control rules.

<figure><img src="/files/lvDOV2zOiUjOUMnrwWHy" alt="secrets manager 790256"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/content-collections/runtime-security/secrets/secrets-manager.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
