> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/accounts/password-policy.md).

# Password generation policy

The rules that decide how a generated secret is composed — length, character classes, and excluded characters — and how they differ from the password rules that apply to console users.

## What this is and when to use it

Whenever the solution produces a secret for you — on a template set to generate randomly, on a push task that creates accounts, on a rotation task that changes them — it composes that secret from a **password generation policy**: a length and a set of character classes.

Two different things in this product are called a password policy, and mixing them up wastes an afternoon:

|                  | Password generation policy                                               | Password rules                                |
| ---------------- | ------------------------------------------------------------------------ | --------------------------------------------- |
| Applies to       | Secrets the solution **generates** for accounts on your assets           | Passwords **console users** type to sign in   |
| Where it is set  | On the account template or the automation task that generates the secret | **System settings › Security › Passwords**    |
| Who is affected  | The target host's local or domain account                                | Local users of the solution itself            |
| What it controls | How the generated string is composed                                     | Minimum length, complexity, expiry, and reuse |

This page covers both, generation first. If you are here because a rotation failed, you want the generation policy.

## Before you start

* The strictest password policy among the **target** hosts. The generated secret has to satisfy the target, not the solution — a policy that is comfortable for the solution and too weak for a Windows domain fails at the moment of the change.
* Whether the credential is stored on a template or on the task. The generation policy is set in both places and they are independent.

## Where the generation policy is set

| Screen                                     | Field                                     | What it decides                                                                |
| ------------------------------------------ | ----------------------------------------- | ------------------------------------------------------------------------------ |
| **Accounts › Templates**                   | **Secret strategy**                       | How the template's secret is produced when the credential is created or pushed |
| **Accounts › Automations › Push accounts** | **Password generation policy** (required) | How the secret of each account created on the targets is produced              |
| **Accounts › Automations › Change secret** | **Password policy**                       | How the new secret is produced on each rotation                                |

In all three, the choice is the same pair:

* **Random generate** — the solution composes the secret from the rules below.
* **Specific secret** — you type the value, and the rules do not apply.

## Steps

1. Open the template or the automation task that produces the secret.
2. Set the strategy to **Random generate**.
3. Set the **length**. It is configurable from **4 to 100** characters.
4. Tick the character classes the target requires — uppercase, lowercase, digits, special characters.
5. To choose exactly which special characters the secret may use, type them in **Allowed symbols**, for example `!#%+-_=`. Leave it empty to use the default set. Quotes, backslash, backtick and braces are not accepted.
6. List any characters to **exclude**. Use this for targets and clients that choke on particular symbols rather than lowering the complexity for everything.
7. Save, and run the task once by hand before trusting a schedule.

{% hint style="warning" %}
Set the policy to match the **strictest** target in the task's scope, not the average one. A single Windows domain controller in a task otherwise full of Linux hosts sets the floor for the whole task.
{% endhint %}

{% hint style="info" %}
Several accounts in one rotation task all receive the **same** generated secret in a given run. If you need distinct secrets per account, split them into separate tasks. See [Rotate credentials](https://wiki.datadike.com/pam/administration/accounts/rotation.md).
{% endhint %}

## What you should see

The template or task lists its strategy — random or specified — in the **Secret strategy** column. Nothing on that screen tells you whether the generated value was accepted by the targets.

## How to verify it worked

1. Run the task once manually.
2. Open the affected account under **Accounts › Accounts** and check its **password history**. A new version, dated at the run, is proof that a new secret was generated and stored.
3. Read the execution log **host by host**. A task can report success overall while individual hosts rejected the secret, and those hosts keep the old one.
4. Open a session to one of those hosts using the account. A successful login is the only proof that the stored value and the target agree.

## Common errors

| Symptom                                                       | Cause                                                                                                   | Fix                                                                                         |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `The password does not meet the password policy requirements` | The generated secret does not satisfy the target's own policy — length, complexity, or password history | Raise the length and tick the missing character classes to match the strictest target       |
| Some hosts took the new secret, others kept the old one       | Those hosts rejected the value, or were unreachable                                                     | Read the execution log per host, then retry those hosts                                     |
| Two accounts in one task ended up with the same password      | Expected — one generated secret per run                                                                 | Split them into separate tasks                                                              |
| The rules are set but the secret never changes                | The strategy is **Specific secret**, so the rules are ignored                                           | Switch to **Random generate**                                                               |
| A rotated domain credential works everywhere except one host  | Rotation does not update the template, and that host still holds the template's original secret         | See [Rotate credentials](https://wiki.datadike.com/pam/administration/accounts/rotation.md) |
| A generated secret breaks an application login                | A special character the application cannot handle                                                       | Add it to the excluded characters rather than dropping the class                            |
| The target accepts only a few specific special characters     | The default set includes symbols the target rejects                                                     | List the accepted ones in **Allowed symbols**                                               |
| Save is refused: `Not allowed:` followed by characters        | **Allowed symbols** contains a quote, backslash, backtick or brace                                      | Remove those characters. The message lists the accepted ones                                |
| Save is refused: all allowed symbols are also excluded        | Every character in **Allowed symbols** is also in the excluded characters                               | Remove the overlap, or clear one of the two fields                                          |

## Field reference — generation

| Field               | What it does                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Secret strategy     | **Random generate** or **Specific secret**                                                                                     |
| Secret type         | Password, SSH Key, Token, Access Key, or API Key. Only passwords are composed from these rules                                 |
| Length              | 4 to 100 characters                                                                                                            |
| Uppercase           | Include uppercase letters                                                                                                      |
| Lowercase           | Include lowercase letters                                                                                                      |
| Digits              | Include digits                                                                                                                 |
| Special characters  | Include symbols                                                                                                                |
| Allowed symbols     | The special characters the secret may use. Empty uses the default set. Quotes, backslash, backtick and braces are not accepted |
| Excluded characters | Characters the solution must never use in a generated secret                                                                   |
| Password            | The value you type. Available only with **Specific secret**                                                                    |

Because the policy lives on each template and each task, different groups of assets can be given different complexity — a criticality tier or a platform family can have its own rules without changing anything global.

## Password rules for console users

These are the rules applied to the **local users of the solution**, under **System settings › Security › Passwords**. They have no effect on the secrets generated for managed accounts.

### Basic

| Field                          | Default | What it does                                                                                                               |
| ------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| User password expiration (day) | `9999`  | Days before a user's console password expires and must be replaced at the next sign-in. The default is effectively "never" |
| Recent password count          | `5`     | How many previous passwords are remembered and refused when the user tries to reuse one                                    |

An expiry reminder is emailed to the user automatically, daily, for the five days before the password expires.

### Password rules

| Field                  | Default | What it does                               |
| ---------------------- | ------- | ------------------------------------------ |
| Minimum length (User)  | `6`     | Minimum password length for ordinary users |
| Minimum length (Admin) | `6`     | Minimum password length for administrators |
| Uppercase              | —       | Requires at least one uppercase letter     |
| Lowercase              | —       | Requires at least one lowercase letter     |
| Digits                 | —       | Requires at least one digit                |
| Special characters     | —       | Requires at least one symbol               |

{% hint style="warning" %}
The shipped defaults are permissive on purpose — a six-character password that never expires. For ISO 27001, SOC 2, PCI-DSS, or LGPD, DataDike's recommendation is a minimum of 12 characters for users and 16 for administrators, expiry at 90 days, and 5 to 10 remembered passwords.
{% endhint %}

To verify a change here, try to set a non-compliant password on a test user. It must be refused at the moment you save, not at the next sign-in.

## Related pages

* [Rotate credentials](https://wiki.datadike.com/pam/administration/accounts/rotation.md) — where the generation policy is used most
* [Account templates](https://wiki.datadike.com/pam/administration/accounts/account-templates.md) — the template's **Secret strategy**
* [Managed accounts](https://wiki.datadike.com/pam/administration/accounts/managed-accounts.md) — password history, and revealing a secret
* [The credential vault](https://wiki.datadike.com/pam/administration/accounts/vault.md)
