Sub topic 7
Setting password policies
This chapter assumes you can navigate Setup, know how profiles and permission sets differ, and understand the basics of how Salesforce authenticates users. Password policies are the baseline layer. MFA reduces the damage when a password is stolen, but good policies make stolen or guessed passwords less likely in the first place.
Where password policies live
Salesforce has two places for password rules:
- Org-wide policies: Setup > Security > Password Policies. These apply to every user by default.
- Profile-level policies: Setup > Profiles > select a profile > Password Policies. These override the org-wide values for users on that profile for a few settings, such as password expiration and the number of failed login attempts.
Use profile-level settings sparingly. A single org-wide standard is easier to audit and explain.
The main settings
| Setting | What it controls |
|---|---|
| User passwords expire in | How many days before a user must change the password. |
| Enforce password history | How many previous passwords a user cannot reuse. |
| Minimum password length | The shortest allowed password. |
| Password complexity requirement | Which character types are required, such as letters, numbers, and symbols. |
| Password question requirement | Whether the hint answer may contain the password. |
| Maximum invalid login attempts | How many failed attempts are allowed before the user is locked out. |
| Lockout effective period | How long a lockout lasts. |
| Obscure secret answer for password resets | Hides the answer as the user types it. |
| Require a minimum 1 day password lifetime | Stops users from cycling through changes to reuse an old password. |
Choosing values
Current guidance from standards bodies such as NIST favors length over complexity rules and discourages forced frequent changes. Long passphrases are harder to guess than short passwords with symbols, and frequent forced changes push users toward predictable patterns like Summer2026! followed by Fall2026!.
A reasonable starting point:
- Set minimum length to 12 or more characters.
- Choose a complexity level that requires letters and numbers at least.
- Keep password history at 3 to 5 so users cannot rotate between a few favorites.
- Set the lockout threshold to 5 to 10 failed attempts.
- Set a lockout period of 15 to 30 minutes, so attackers are slowed down but a user with a typo is not stuck for long.
- Set expiration according to your own security policy. If you use MFA, a longer expiry or no expiry is defensible.
What the policy does not cover
Password policies apply only to users who log in with a Salesforce password. Users who sign in through single sign-on follow the identity provider's rules instead. Integration users with API access also use passwords, often with a security token, so check that their profiles have sensible settings. Password policies do not stop phishing, since a user can type a strong password into a fake page. That gap is why MFA comes next.
Checking the effect
You can confirm how failures appear in the login history. This query lists recent logins that did not succeed:
SELECT UserId, LoginTime, LoginType, SourceIp, Status
FROM LoginHistory
WHERE LoginTime = LAST_N_DAYS:7
AND Status != 'Success'
ORDER BY LoginTime DESC
LIMIT 200A burst of "Invalid Password" statuses from one SourceIp suggests guessing. Statuses such as "Password Lockout" confirm that your lockout threshold is working.
Common errors
- Changing policy and expecting immediate effect on existing passwords. Complexity and length rules apply the next time a password is set. Existing passwords stay valid until they expire or are reset.
- Setting profile policies that conflict with the org-wide policy and then not knowing which one applies. Check the profile first.
- Forgetting the lockout period. A strict threshold with a long lockout creates help desk load.
Exercise
Your org has a minimum password length of 8 and you raise it to 12. A user with an existing 8-character password signs in the next day. What happens, and why?
Show answer
The user signs in normally. Length and complexity rules are checked only when a password is set or changed, so the existing 8-character password stays valid until it expires or an administrator resets it. To apply the new rule sooner, expire the passwords or force a reset.