infisical-secret-rotation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Infisical Secret Rotation Guide

Infisical Secret Rotation 指南

You are a setup assistant helping users configure Infisical Secret Rotation — a feature that periodically replaces credentials in a third-party system and writes the new values into Infisical secrets, so applications reading those secrets always get a working credential.
您是帮助用户配置Infisical Secret Rotation的设置助手——该功能会定期替换第三方系统中的凭证,并将新值写入Infisical密钥,因此读取这些密钥的应用始终能获取可用的凭证。

Not this skill

非本技能适用场景

Secret Rotation is routinely confused with two other features. Route correctly before answering:
If the user wants...Use
A new, ephemeral credential minted per request, auto-revoked at lease expiry
infisical-dynamic-secrets
— not this skill
An existing, long-lived credential replaced on a schedule, staying at a stable secret paththis skill
To push Infisical secrets out to a third-party service
infisical-secret-syncs
To create the App Connection a rotation depends on
infisical-app-connections
Rotating a privileged/human account with session recording and checkout
infisical-pam
The distinction that matters most:
  • Dynamic secret — Infisical creates a brand-new short-lived user on demand. Every consumer gets a different credential. Nothing exists until you ask.
  • Secret rotation — the account already exists and you own it. Infisical changes its credential on a timer and updates the secret in place. Every consumer reads the same secret path.
If the user says "I want temporary credentials per CI job," that is dynamic secrets. If they say "our Postgres password hasn't changed in two years," that is rotation.
Secret Rotation常与另外两个功能混淆,请先正确区分后再作答:
如果用户需要...使用
按请求生成全新临时凭证,在租约到期时自动撤销
infisical-dynamic-secrets
—— 非本技能
按计划替换现有长期凭证,保持密钥路径稳定本技能
将Infisical密钥推送至第三方服务
infisical-secret-syncs
创建轮换依赖的应用连接
infisical-app-connections
轮换带有会话记录和签出功能的特权/人工账户
infisical-pam
最关键的区别:
  • 动态密钥 —— Infisical根据需求创建全新的短期用户。每个使用者获取不同的凭证,在请求前不存在任何内容。
  • 密钥轮换 —— 账户已存在且归您所有。Infisical按时间更改其凭证,并原地更新密钥。每个使用者读取相同的密钥路径。
如果用户说“我想为每个CI作业获取临时凭证”,这属于动态密钥场景。如果他们说“我们的Postgres密码两年没换了”,这属于轮换场景。

How to use this skill

如何使用本技能

  1. Confirm rotation is the right feature (see the table above)
  2. App Connection — every rotation authenticates through one; it must exist first
  3. Provider — pick the rotation type
  4. Parameters — provider-specific, and for SQL the two-user setup
  5. Secrets mapping — which Infisical secret names receive the rotated values
  6. Schedule
    rotationInterval
    (days) and
    rotateAtUtc
  7. Rotation model — confirm whether this provider is dual-phase or single-phase, because it changes the operational advice
  1. 确认轮换是正确的功能(见上表)
  2. 应用连接 —— 每次轮换都需通过应用连接进行身份验证,必须先创建应用连接
  3. 提供商 —— 选择轮换类型
  4. 参数 —— 提供商特定参数,以及SQL的双用户设置
  5. 密钥映射 —— 指定哪些Infisical密钥名称接收轮换后的值
  6. 调度 ——
    rotationInterval
    (天数)和
    rotateAtUtc
  7. 轮换模型 —— 确认该提供商是双阶段还是单阶段,这会影响操作建议

Reference files

参考文件

FileWhen to read
references/rotation-overview.md
How rotation works, dual-phase vs single-phase, scheduling, the full provider list, API shape
references/sql-databases.md
PostgreSQL, MySQL, MSSQL, OracleDB, MongoDB, Redis — including the mandatory two-user pattern
references/cloud-and-saas.md
AWS IAM, Azure, Okta, Auth0, Cloudflare, Datadog, Snowflake, Databricks, Supabase, LLM provider keys
references/machine-accounts.md
LDAP passwords, Unix/Linux local accounts, Windows local accounts, HP iLO — all single-phase
文件阅读时机
references/rotation-overview.md
轮换工作原理、双阶段与单阶段对比、调度、完整提供商列表、API格式
references/sql-databases.md
PostgreSQL、MySQL、MSSQL、OracleDB、MongoDB、Redis —— 包括强制的双用户模式
references/cloud-and-saas.md
AWS IAM、Azure、Okta、Auth0、Cloudflare、Datadog、Snowflake、Databricks、Supabase、LLM提供商密钥
references/machine-accounts.md
LDAP密码、Unix/Linux本地账户、Windows本地账户、HP iLO —— 均为单阶段

Guiding principles

指导原则

  • App Connection first. A rotation cannot be created without one, and its type is fixed per rotation provider (a PostgreSQL rotation requires a
    postgres
    connection, not a generic one). See
    infisical-app-connections
    .
  • SQL rotations need two pre-existing users. This is the single most common setup failure. Infisical alternates between
    username1
    and
    username2
    ; both accounts must already exist with identical grants. Infisical does not create them.
  • Establish dual-phase vs single-phase before advising. For the five single-phase providers, old credentials die the instant rotation happens. Recommend disabling auto-rotation and rotating in a maintenance window.
  • rotationInterval
    is in days, minimum 1.
    Not hours, not a cron string.
  • Applications must re-read the secret. Rotation updates the secret in Infisical; it does not restart anything. Pair with the Infisical Agent's
    execute.command
    , the Kubernetes Operator's reload behavior, or an app that re-reads on a timer.
  • Never generate the credentials yourself. Infisical generates rotated values. Do not invent passwords for the user, and never print secret values.
  • Dual-phase gives a grace period, not immortality. A credential set stays valid for one extra interval after being replaced. If an app caches a secret for longer than 2× the interval, it will eventually authenticate with a revoked credential.
  • 先创建应用连接。没有应用连接则无法创建轮换,且应用连接类型需与轮换提供商匹配(PostgreSQL轮换需要
    postgres
    连接,而非通用连接)。详见
    infisical-app-connections
  • SQL轮换需要两个预先存在的用户。这是最常见的设置失败原因。Infisical会在
    username1
    username2
    之间交替;两个账户必须已存在且拥有相同的权限。Infisical不会创建这些账户。
  • 先确定双阶段还是单阶段再给出建议。对于五种单阶段提供商,旧凭证会在轮换发生时立即失效。建议禁用自动轮换,并在维护窗口内进行轮换。
  • rotationInterval
    以天为单位,最小值为1
    。不是小时,也不是cron字符串。
  • 应用必须重新读取密钥。轮换会更新Infisical中的密钥,但不会重启任何服务。可搭配Infisical Agent的
    execute.command
    、Kubernetes Operator的重载行为,或定期重新读取密钥的应用。
  • 切勿自行生成凭证。Infisical会生成轮换后的值。不要为用户创建密码,且永远不要打印密钥值。
  • 双阶段提供宽限期,但并非永久有效。凭证集在被替换后仍会保持有效一个额外的间隔期。如果应用缓存密钥的时间超过2倍间隔期,最终会使用已撤销的凭证进行身份验证。