> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Dynamic secrets

> Learn how to generate secrets dynamically on-demand.

export const dynamicSecretCategories = ['All', 'Databases', 'Cloud Providers', 'Message Queues', 'Caches', 'Directory Services', 'CI/CD', 'Container Orchestration', 'Authentication'];

export const dynamicSecrets = [{
  "name": "AWS IAM",
  "slug": "aws-iam",
  "path": "/documentation/platform/dynamic-secrets/aws-iam",
  "description": "Learn how to generate dynamic AWS IAM credentials on-demand.",
  "category": "Cloud Providers"
}, {
  "name": "AWS ElastiCache",
  "slug": "aws-elasticache",
  "path": "/documentation/platform/dynamic-secrets/aws-elasticache",
  "description": "Learn how to generate dynamic AWS ElastiCache credentials on-demand.",
  "category": "Caches"
}, {
  "name": "AWS MemoryDB",
  "slug": "aws-memorydb",
  "path": "/documentation/platform/dynamic-secrets/aws-memorydb",
  "description": "Learn how to generate dynamic AWS MemoryDB (Valkey/Redis) credentials on-demand.",
  "category": "Caches"
}, {
  "name": "Azure Entra ID",
  "slug": "azure-entra-id",
  "path": "/documentation/platform/dynamic-secrets/azure-entra-id",
  "description": "Learn how to generate dynamic Azure Entra ID credentials on-demand.",
  "category": "Cloud Providers"
}, {
  "name": "Azure SQL Database",
  "slug": "azure-sql-database",
  "path": "/documentation/platform/dynamic-secrets/azure-sql-database",
  "description": "Learn how to generate dynamic Azure SQL Database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "GCP IAM",
  "slug": "gcp-iam",
  "path": "/documentation/platform/dynamic-secrets/gcp-iam",
  "description": "Learn how to generate dynamic GCP IAM credentials on-demand.",
  "category": "Cloud Providers"
}, {
  "name": "Cassandra",
  "slug": "cassandra",
  "path": "/documentation/platform/dynamic-secrets/cassandra",
  "description": "Learn how to generate dynamic Cassandra database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "ClickHouse",
  "slug": "clickhouse",
  "path": "/documentation/platform/dynamic-secrets/clickhouse",
  "description": "Learn how to generate dynamic ClickHouse database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Couchbase",
  "slug": "couchbase",
  "path": "/documentation/platform/dynamic-secrets/couchbase",
  "description": "Learn how to generate dynamic Couchbase database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "MongoDB",
  "slug": "mongodb",
  "path": "/documentation/platform/dynamic-secrets/mongo-db",
  "description": "Learn how to generate dynamic MongoDB database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "MongoDB Atlas",
  "slug": "mongodb-atlas",
  "path": "/documentation/platform/dynamic-secrets/mongo-atlas",
  "description": "Learn how to generate dynamic MongoDB Atlas database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "MySQL",
  "slug": "mysql",
  "path": "/documentation/platform/dynamic-secrets/mysql",
  "description": "Learn how to generate dynamic MySQL database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "PostgreSQL",
  "slug": "postgresql",
  "path": "/documentation/platform/dynamic-secrets/postgresql",
  "description": "Learn how to generate dynamic PostgreSQL database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Microsoft SQL Server",
  "slug": "mssql",
  "path": "/documentation/platform/dynamic-secrets/mssql",
  "description": "Learn how to generate dynamic Microsoft SQL Server credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Oracle Database",
  "slug": "oracle",
  "path": "/documentation/platform/dynamic-secrets/oracle",
  "description": "Learn how to generate dynamic Oracle Database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "SAP ASE",
  "slug": "sap-ase",
  "path": "/documentation/platform/dynamic-secrets/sap-ase",
  "description": "Learn how to generate dynamic SAP ASE database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "SAP HANA",
  "slug": "sap-hana",
  "path": "/documentation/platform/dynamic-secrets/sap-hana",
  "description": "Learn how to generate dynamic SAP HANA database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Snowflake",
  "slug": "snowflake",
  "path": "/documentation/platform/dynamic-secrets/snowflake",
  "description": "Learn how to generate dynamic Snowflake database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Vertica",
  "slug": "vertica",
  "path": "/documentation/platform/dynamic-secrets/vertica",
  "description": "Learn how to generate dynamic Vertica database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Redis",
  "slug": "redis",
  "path": "/documentation/platform/dynamic-secrets/redis",
  "description": "Learn how to generate dynamic Redis credentials on-demand.",
  "category": "Caches"
}, {
  "name": "ElasticSearch",
  "slug": "elasticsearch",
  "path": "/documentation/platform/dynamic-secrets/elastic-search",
  "description": "Learn how to generate dynamic ElasticSearch credentials on-demand.",
  "category": "Databases"
}, {
  "name": "RabbitMQ",
  "slug": "rabbitmq",
  "path": "/documentation/platform/dynamic-secrets/rabbit-mq",
  "description": "Learn how to generate dynamic RabbitMQ credentials on-demand.",
  "category": "Message Queues"
}, {
  "name": "Kafka",
  "slug": "kafka",
  "path": "/documentation/platform/dynamic-secrets/kafka",
  "description": "Learn how to generate dynamic Kafka credentials on-demand.",
  "category": "Message Queues"
}, {
  "name": "LDAP",
  "slug": "ldap",
  "path": "/documentation/platform/dynamic-secrets/ldap",
  "description": "Learn how to generate dynamic LDAP credentials on-demand.",
  "category": "Directory Services"
}, {
  "name": "GitHub",
  "slug": "github",
  "path": "/documentation/platform/dynamic-secrets/github",
  "description": "Learn how to generate dynamic GitHub credentials on-demand.",
  "category": "CI/CD"
}, {
  "name": "IBM API Connect",
  "slug": "ibm-api-connect",
  "path": "/documentation/platform/dynamic-secrets/ibm-api-connect",
  "description": "Learn how to generate dynamic IBM API Connect application credentials on-demand.",
  "category": "Cloud Providers"
}, {
  "name": "Kubernetes",
  "slug": "kubernetes",
  "path": "/documentation/platform/dynamic-secrets/kubernetes",
  "description": "Learn how to generate dynamic Kubernetes credentials on-demand.",
  "category": "Container Orchestration"
}, {
  "name": "TOTP",
  "slug": "totp",
  "path": "/documentation/platform/dynamic-secrets/totp",
  "description": "Learn how to generate dynamic TOTP codes on-demand.",
  "category": "Authentication"
}, {
  "name": "Milvus",
  "slug": "milvus",
  "path": "/documentation/platform/dynamic-secrets/milvus",
  "description": "Learn how to generate dynamic Milvus database credentials on-demand.",
  "category": "Databases"
}, {
  "name": "Tailscale",
  "slug": "tailscale",
  "path": "/documentation/platform/dynamic-secrets/tailscale",
  "description": "Learn how to generate dynamic Tailscale credentials on-demand.",
  "category": "Authentication"
}, {
  "name": "SSH",
  "slug": "ssh",
  "path": "/documentation/platform/dynamic-secrets/ssh",
  "description": "Learn how to generate dynamic SSH credentials on-demand.",
  "category": "Authentication"
}, {
  "name": "OAuth 2.0",
  "slug": "oauth2",
  "path": "/documentation/platform/dynamic-secrets/oauth2",
  "description": "Learn how to issue short-lived OAuth 2.0 access tokens on-demand.",
  "category": "Authentication"
}];

export const CatalogBrowser = ({id = "catalog", items = [], categories = [], filterKey = "category", noun = "item", nounPlural = `${noun}s`, badges = item => [{
  label: item[filterKey]
}], urlParam}) => {
  const [searchTerm, setSearchTerm] = useState("");
  const [selected, setSelected] = useState("All");
  const listRef = useRef(null);
  useEffect(() => {
    if (!urlParam) return;
    const requested = new URLSearchParams(window.location.search).get(urlParam);
    if (requested && categories.includes(requested)) setSelected(requested);
  }, []);
  const sorted = useMemo(() => [...items].sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())), [items]);
  const filtered = useMemo(() => {
    const term = searchTerm.trim().toLowerCase();
    return sorted.filter(item => {
      if (selected !== "All" && item[filterKey] !== selected) return false;
      if (!term) return true;
      return [item.name, item.description, item[filterKey], ...badges(item).map(b => b.label)].some(value => value && value.toLowerCase().includes(term));
    });
  }, [sorted, searchTerm, selected]);
  useEffect(() => {
    const path = window.location.pathname;
    const base = path === "/docs" || path.startsWith("/docs/") ? "/docs" : "";
    if (!base || !listRef.current) return;
    listRef.current.querySelectorAll("a[href^='/']").forEach(anchor => {
      const href = anchor.getAttribute("href");
      if (!href.startsWith(`${base}/`)) anchor.setAttribute("href", `${base}${href}`);
    });
  }, [filtered]);
  const count = filtered.length;
  return <div className="ifx-catalog">
      <div className="ifx-catalog__search">
        <svg aria-hidden="true" className="ifx-catalog__search-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
          <path d="m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" />
        </svg>
        <label className="sr-only" htmlFor={`${id}-search`}>
          Search {nounPlural}
        </label>
        <input id={`${id}-search`} type="search" className="ifx-catalog__input" placeholder={`Search ${nounPlural}...`} value={searchTerm} onChange={event => setSearchTerm(event.target.value)} />
      </div>

      <div className="ifx-catalog__filters" role="group" aria-label={`Filter ${nounPlural}`}>
        {categories.map(category => <button key={category} type="button" className="ifx-catalog__filter" aria-pressed={selected === category} onClick={() => setSelected(category)}>
            {category}
          </button>)}
      </div>

      <p className="ifx-catalog__count" aria-live="polite">
        {count} {count === 1 ? noun : nounPlural} found
        {selected !== "All" && ` in ${selected}`}
        {searchTerm.trim() && ` for "${searchTerm.trim()}"`}
      </p>

      {count > 0 ? <div ref={listRef} className="ifx-catalog__grid">
          {filtered.map(item => <a key={item.path} href={item.path} className="ifx-catalog__card">
              <h3 className="ifx-catalog__title">{item.name}</h3>
              <div className="ifx-catalog__badges">
                {badges(item).map(badge => <Badge key={badge.label} color={badge.color || "gray"} size="sm">
                    {badge.label}
                  </Badge>)}
              </div>
              <p className="ifx-catalog__desc">{item.description}</p>
            </a>)}
        </div> : <div className="ifx-catalog__empty">
          No {nounPlural} match your search and filters.
        </div>}
    </div>;
};

<Info>
  Dynamic secrets are available under Infisical's [Advanced](https://infisical.com/pricing) plan.

  If you're self-hosting Infisical, contact [sales@infisical.com](mailto:sales@infisical.com) to purchase an Advanced license.
</Info>

## Introduction

Contrary to static key-value secrets, which require manual input of data into the secure Infisical storage, **dynamic secrets are generated on-demand upon access**.

**Dynamic secrets are unique to every identity using them**. Such secrets are generated only at the moment they're retrieved, eliminating the possibility of theft or reuse by another identity. Thanks to Infisical's integrated revocation capabilities, dynamic secrets can be promptly invalidated post-use, significantly reducing their lifespan.

## Supported services

<CatalogBrowser id="dynamic-secrets" items={dynamicSecrets} categories={dynamicSecretCategories} noun="dynamic secret" />

## Benefits of dynamic secrets

This approach offers several advantages in terms of security and management:

* **Enhanced Security**: By frequently changing secrets, dynamic secrets minimize the risk associated with secret compromise. Even if an attacker manages to obtain a secret, it would likely be invalid by the time they attempt to use it.

* **Reduced Secret Lifetime**: The limited validity period of dynamic secrets means that they're less valuable targets for attackers. This inherently reduces the time window during which a secret can be exploited.

* **Automated Management**: Dynamic secrets enable automated systems to handle the generation, distribution, revocation, and rotation of secrets without human intervention, thus reducing the risk of human error.

* **Auditing and Traceability**: The generation of dynamic secrets can be tightly controlled and monitored. This allows for detailed auditing of who accessed what secret and when, improving overall security posture and compliance with regulatory standards.

* **Scalability**: Dynamic secret management systems can scale more effectively to handle a large number of services and applications, as they automate much of the overhead associated with manual secret management.

Dynamic secrets are particularly useful in environments with stringent security requirements, such as cloud environments, distributed systems, and microservices architectures, where they help to manage database credentials, API keys, tokens, and other types of secrets.

**FAQ**

<AccordionGroup>
  <Accordion title="Why is my SQL dynamic secret failing when I generate a lease?">
    This usually happens when the SQL statements defined for creating or revoking the secret aren't compatible with your database provider.

    Different SQL engines have different expectations for quoting identifiers and values. For example, some use backticks (`` `username` ``), others use single quotes (`'username'`), and some expect double quotes (`"username"`). A statement that works on one provider might fail on another.

    **Recommendation:**\
    Make sure to adjust your SQL statements to follow the syntax required by your specific database provider. Always test them directly on your target database to ensure they execute without errors.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.