Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs(pam): Windows rotation, dependency detection, and dependency rotation
bernie-gb20f6dba3805
diff --git a/docs/docs.json b/docs/docs.jsonindex 7f55d8e5d9..44fbc3292f 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -1112,7 +1112,8 @@"documentation/platform/pam/product-reference/credential-rotation/overview","documentation/platform/pam/product-reference/credential-rotation/postgresql","documentation/platform/pam/product-reference/credential-rotation/mysql",- "documentation/platform/pam/product-reference/credential-rotation/mssql"+ "documentation/platform/pam/product-reference/credential-rotation/mssql",+ "documentation/platform/pam/product-reference/credential-rotation/windows"]},{@@ -1123,6 +1124,12 @@"documentation/platform/pam/discovery/unix"]},+ {+ "group": "Dependencies",+ "pages": [+ "documentation/platform/pam/dependencies/overview"+ ]+ },{"group": "Sessions","pages": [diff --git a/docs/documentation/platform/pam/dependencies/overview.mdx b/docs/documentation/platform/pam/dependencies/overview.mdxnew file mode 100644index 0000000000..5291ebcc51--- /dev/null+++ b/docs/documentation/platform/pam/dependencies/overview.mdx@@ -0,0 +1,75 @@+---+title: "Account Dependencies"+sidebarTitle: "Overview"+description: "Detect the Windows services, tasks, and app pools that run as an account, and keep them working across rotations."+---++A **dependency** is a Windows service, scheduled task, or IIS application pool that runs *as* one of your accounts and therefore stores a copy of that account's password. When the account's password rotates, every dependency still holding the old password would fail to start until it is updated.++Infisical **detects** these dependencies during discovery and **syncs** them automatically during rotation, so rotating a Windows account does not break the services that depend on it.++<Note>+ Dependencies apply to Windows accounts only: [Windows AD](/documentation/platform/pam/accounts/windows-ad) (domain) and [Windows](/documentation/platform/pam/accounts/windows) (local).+</Note>++## Detected dependency types++| Type | What it is |+|------|------------|+| **Windows service** | A service whose *Log On As* identity is the account |+| **Scheduled task** | A task configured to run under the account with a stored password |+| **IIS application pool** | An app pool whose process model runs as the account |++## Detection++Dependencies are detected during [Active Directory discovery](/documentation/platform/pam/discovery/active-directory) when the **Discover account dependencies** option is enabled on the source. This option is **off by default**. When enabled, discovery locates the domain-joined Windows servers, connects to each over WinRM through the [Gateway](/documentation/platform/gateways/overview), and enumerates the services, scheduled tasks, and IIS application pools that run under a discovered account.++Each detected dependency is anchored to the stable identity of the account it runs as, so it is linked to the correct managed account once that account is imported. Re-running a scan updates the dependency list in place rather than creating duplicates, and a dependency that is no longer found on a re-scanned machine is removed.++<Note>+ **Discover account dependencies** is independent of **Discover local accounts**, so you can enable either or both. Both reach your servers over WinRM, so the source's WinRM settings (port, HTTPS, and CA certificate) apply to dependency detection as well. Dependencies are detected from the servers within the source's scan scope.+</Note>++You can review an account's detected dependencies on the account's **Rotation** tab, grouped by machine, along with the last sync status of each.++## Rotation (sync)++When a Windows account's password [rotates](/documentation/platform/pam/product-reference/credential-rotation/windows), Infisical pushes the new password to each of the account's dependencies so they continue to authenticate:++<Steps>+ <Step title="Connect to each dependency's machine">+ Using the account's rotation account, Infisical connects over WinRM to the machine each dependency runs on. For domain accounts, machine hostnames are re-resolved through the domain controller's DNS at sync time so a stale address cannot target the wrong host.+ </Step>+ <Step title="Update the stored credential">+ The new password is written to the dependency:++ | Type | What happens |+ |------|--------------|+ | **Windows service** | The service's stored password is updated, and the service is restarted if it was running |+ | **Scheduled task** | The task is reconfigured with the new password |+ | **IIS application pool** | The app pool's process-model password is updated, and the pool is recycled if it was started |+ </Step>+</Steps>++Dependency sync runs as part of rotation and is **best effort**: a failure on one dependency is recorded on that dependency's row and never fails the account rotation. Each dependency shows one of:++| Status | Meaning |+|--------|---------|+| **Rotated** | The new password was applied successfully on the last rotation |+| **Failed** | The last sync did not complete; the recorded error explains why |+| **Never** | The dependency has not been through a rotation yet |++<Note>+ Because sync keeps dependent services working, dependencies detected on the scanned servers are included automatically. Make sure the servers within a discovery source's scan scope are ones you trust to run as your managed accounts.+</Note>++## Next Steps++<CardGroup cols={2}>+ <Card title="Active Directory Discovery" icon="windows" href="/documentation/platform/pam/discovery/active-directory">+ Enable server scanning to detect dependencies.+ </Card>+ <Card title="Windows Credential Rotation" icon="rotate" href="/documentation/platform/pam/product-reference/credential-rotation/windows">+ How Windows and AD account passwords are rotated.+ </Card>+</CardGroup>diff --git a/docs/documentation/platform/pam/discovery/active-directory.mdx b/docs/documentation/platform/pam/discovery/active-directory.mdxindex fc696245e4..ea6d379ce1 100644--- a/docs/documentation/platform/pam/discovery/active-directory.mdx+++ b/docs/documentation/platform/pam/discovery/active-directory.mdx@@ -18,9 +18,9 @@ All scan traffic (LDAP, DNS, and WinRM) is tunneled through an Infisical [GatewaBehind the scenes, an Active Directory scan connects entirely through the Gateway:1. **Domain accounts** are enumerated by querying the domain controller over LDAP (or LDAPS) using the credential account's connection settings.-2. **Windows servers** are located in the same LDAP query when local account discovery is enabled.+2. **Windows servers** are located in the same LDAP query when local account discovery or dependency discovery is enabled.3. Each server's hostname is resolved to an IP through the **domain controller's DNS**, so the Gateway can reach it.-4. Each reachable server is queried over **WinRM** to list its local users.+4. Each reachable server is queried over **WinRM** to list its local users (local account discovery) and the services, scheduled tasks, and IIS application pools running as a discovered account (dependency discovery).## Prerequisites@@ -31,7 +31,7 @@ Before creating an Active Directory discovery source, make sure you have:- The **Product Admin** role. See [Access Control](/documentation/platform/pam/concepts/access-control).<Note>-To discover local Windows accounts, the credential account must include a **password**, WinRM must be enabled on your servers, and your domain controller's DNS must resolve each server's hostname so the Gateway can reach it.+To discover local Windows accounts or account dependencies, the credential account must include a **password**, WinRM must be enabled on your servers, and your domain controller's DNS must resolve each server's hostname so the Gateway can reach it.</Note>## Creating a Source@@ -48,19 +48,26 @@ To discover local Windows accounts, the credential account must include a **pass| **Gateway** | The [Gateway](/documentation/platform/gateways/overview) or Gateway pool that scan traffic tunnels through || **Scan Schedule** | How often to scan automatically: **Manual**, **Daily**, or **Weekly** |</Step>- <Step title="Configure local account discovery">- Leave **Discover local accounts** on to enumerate local users on your Windows servers over WinRM, or turn it off to discover domain accounts only. See [Local Account Discovery](#local-account-discovery) for the WinRM options.+ <Step title="Choose what to discover on your servers">+ Two options control what discovery does beyond enumerating domain accounts, and each can be turned on independently:++ | Option | Default | What it does |+ |--------|---------|--------------|+ | **Discover local accounts** | On | Enumerates local users on your Windows servers over WinRM |+ | **Discover account dependencies** | Off | Detects the services, scheduled tasks, and IIS application pools that run as a discovered account (see [Dependencies](/documentation/platform/pam/dependencies/overview)) |++ When either is on, discovery locates your Windows servers and connects to them over WinRM. See [Server WinRM Options](#server-winrm-options) for the connection settings.</Step><Step title="Save">Click **Create**. The source appears in the Discovery table.</Step></Steps>-## Local Account Discovery+## Server WinRM Options-When **Discover local accounts** is enabled, discovery locates domain-joined Windows servers, resolves each one through the domain controller's DNS, and queries it over WinRM to enumerate local users. These become **Windows** (local) staged accounts.+When **Discover local accounts** or **Discover account dependencies** is enabled, discovery locates domain-joined Windows servers, resolves each one through the domain controller's DNS, and connects to it over WinRM. Local account discovery enumerates the server's local users (staged as **Windows** accounts); dependency discovery enumerates the [dependencies](/documentation/platform/pam/dependencies/overview) that run as a discovered account.-The following WinRM options are available:+Both use the same WinRM connection options:| Field | Description ||-------|-------------|@@ -94,6 +101,10 @@ Once imported, the accounts become regular PAM accounts in the chosen folder andImported accounts arrive without a credential because discovery finds accounts with a username but no password. Open each imported account and add a credential before connecting.</Warning>+<Note>+ Enabling **Discover account dependencies** also connects to each Windows server over WinRM and records the services, scheduled tasks, and IIS application pools that run as a discovered account. These are stored as [dependencies](/documentation/platform/pam/dependencies/overview) so they stay in sync when the account's password rotates. It is off by default and independent of **Discover local accounts**.+</Note>+## Next Steps<CardGroup cols={2}>@@ -103,4 +114,7 @@ Imported accounts arrive without a credential because discovery finds accounts w<Card title="Windows AD Accounts" icon="windows" href="/documentation/platform/pam/accounts/windows-ad">Learn about the account type used to authenticate scans.</Card>+ <Card title="Account Dependencies" icon="diagram-project" href="/documentation/platform/pam/dependencies/overview">+ Keep dependent services working across rotations.+ </Card></CardGroup>diff --git a/docs/documentation/platform/pam/product-reference/credential-rotation/overview.mdx b/docs/documentation/platform/pam/product-reference/credential-rotation/overview.mdxindex 6b609578df..144060d1f8 100644--- a/docs/documentation/platform/pam/product-reference/credential-rotation/overview.mdx+++ b/docs/documentation/platform/pam/product-reference/credential-rotation/overview.mdx@@ -24,7 +24,7 @@ The rotation account is the account whose credentials are used to connect to the- **None**: no rotation account is set. The account will not rotate until one is chosen, even if its template has rotation enabled.<Note>- A delegated rotation account must connect to the **same host and port** as the account being rotated, because the password change runs over the rotation account's own connection. In practice, both accounts point at the same database server, though they can be different users on it (for example, a privileged administrator rotating a less privileged account).+ A delegated rotation account must connect to the **same resource** as the account being rotated, because the password change runs over the rotation account's own connection. For databases this means the same host and port; for Windows AD it means the same domain. The two accounts can still be different users (for example, a privileged administrator rotating a less privileged account).</Note>## How it Works@@ -73,7 +73,7 @@ To rotate immediately without waiting for the next scheduled run, click **RotateEach resource type applies the password change differently and has its own requirements for the rotation account. See the resource-specific page for the exact statement, the privileges the rotation account needs, and any special cases.-<CardGroup cols={3}>+<CardGroup cols={2}><Card title="PostgreSQL" icon="database" href="/documentation/platform/pam/product-reference/credential-rotation/postgresql">Rotates a role's password with `ALTER USER`.</Card>@@ -83,4 +83,7 @@ Each resource type applies the password change differently and has its own requi<Card title="Microsoft SQL Server" icon="database" href="/documentation/platform/pam/product-reference/credential-rotation/mssql">Rotates a SQL Server login's password with `ALTER LOGIN`.</Card>+ <Card title="Windows" icon="windows" href="/documentation/platform/pam/product-reference/credential-rotation/windows">+ Rotates local Windows and Active Directory account passwords over WinRM.+ </Card></CardGroup>diff --git a/docs/documentation/platform/pam/product-reference/credential-rotation/windows.mdx b/docs/documentation/platform/pam/product-reference/credential-rotation/windows.mdxnew file mode 100644index 0000000000..a4ea994d16--- /dev/null+++ b/docs/documentation/platform/pam/product-reference/credential-rotation/windows.mdx@@ -0,0 +1,61 @@+---+title: "Windows Credential Rotation"+sidebarTitle: "Windows"+description: "Rotate local Windows and Active Directory account passwords with Infisical PAM."+---++This page covers what is specific to rotating a [Windows account](/documentation/platform/pam/accounts/windows) (local) or a [Windows AD account](/documentation/platform/pam/accounts/windows-ad) (domain). For how rotation is configured and scheduled, see the [overview](/documentation/platform/pam/product-reference/credential-rotation/overview).++Windows rotation runs over **WinRM**, tunneled through an Infisical [Gateway](/documentation/platform/gateways/overview). The account's WinRM settings (port, HTTPS, and CA certificate) come from its connection details.++## How the password is changed++<Tabs>+ <Tab title="Windows (local)">+ The rotation account connects to the account's **host** over WinRM and resets the local user's password:++ ```powershell+ Set-LocalUser -Name '<target_user>' -Password (ConvertTo-SecureString '<generated_password>' -AsPlainText -Force)+ ```+ </Tab>+ <Tab title="Windows AD (domain)">+ The rotation account connects to the **domain controller** (the account's DC address) over WinRM and resets the domain account's password:++ ```powershell+ Import-Module ActiveDirectory+ Set-ADAccountPassword -Identity '<target_user>' -Reset -NewPassword (ConvertTo-SecureString '<generated_password>' -AsPlainText -Force)+ ```+ </Tab>+</Tabs>++## Rotation account requirements++<Tabs>+ <Tab title="Windows (local)">+ - **Self-rotation**: the account changes its own password. This requires the account to be able to sign in over WinRM and to hold the rights to change its own credential. Many local accounts cannot, so delegated rotation is the common choice.+ - **Delegated rotation**: a **local administrator on the same host** performs the change. This is the recommended setup for local accounts, because the administrator can both reset the password and verify it on the box.++ A delegated rotation account must connect to the **same host** as the account it rotates.+ </Tab>+ <Tab title="Windows AD (domain)">+ Domain accounts use **delegated rotation**: a separate domain account with permission to reset the target account's password (for example, an account with delegated control over the target's OU, or a suitable administrative account).++ The rotation account must be a **different directory identity** than the account it rotates. An account cannot reset its own domain password this way, and Infisical rejects a rotation account that resolves to the same directory object as the target.++ A delegated rotation account must belong to the **same domain** as the account it rotates, since the reset runs against that domain's controller.+ </Tab>+</Tabs>++## Prerequisites++- A [Gateway](/documentation/platform/gateways/overview) (or Gateway pool) with network access to the target host (local accounts) or the domain controller (domain accounts).+- **WinRM enabled** and reachable on the host or domain controller the rotation connects to.+- A rotation account configured on the account, as described above.++<Note>+ For an untrusted Gateway-to-host network segment, enable **WinRM over HTTPS** on the account so the connection is protected by TLS. Over plain HTTP, WinRM relies on NTLM message sealing.+</Note>++## Dependencies++Rotating a Windows account also updates the services, scheduled tasks, and IIS application pools that run as that account, so they keep working with the new password. See [Account Dependencies](/documentation/platform/pam/dependencies/overview) for how dependencies are detected and synced.