Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Salesforce Policy Deviation Checker

Released as open source by NCC Group Plc -

Developed by Jerome Smith (@exploresecurity) With thanks to Stephen Tomkinson (@neonbunny9)

Released under AGPL - refer to LICENSE for more information.


Within Salesforce, password policies and session settings set at the top Organization level can be overriden by those at the Profile level. Although this is by design, any changes in these areas within a Profile, even if later reverted to match the Organization settings, cause the Profile to become out of sync with the Organization. In other words, subsequent changes in the password policies and session settings at the Organization level will no longer propagate to these Profiles. Over time, as Profiles are added and copied, this could lead to an accidental misconfiguration for certain sets of users. SFPolDevChk reveals which Profiles have become desynchronised in this way, and reviews each one's password policies and session settings to highlight any deviations from those set at the Organization level.



  • Python 3
  • The Python requests module (covered by requirements.txt)
  • A user account with the following minimum permissions:
    • API Enabled
    • View Setup and Configuration
    • Modify Metadata Through Metadata API Functions (see note below)
  • The password for this account
  • The security token for this account (if coming from an IP address outside any defined Network Access ranges). Refer to for more information.

Create a JSON config file (so that credentials are not left within the console history):

	"hostname": "",
    "username": "",
	"password": "",
	"token": "<optional token>"
	"debug": <optional debug level (0, 1 or 2)>

Then run:

git clone
pip install -r requirements.txt
python3 <config_file>


Snippet of sample output

In the above example, the row for the Profile 'Read Only' is otherwise empty. This is because the password policy for this Profile was, at that time, the same as the policy set for the Organization. However, should the Organization settings change, users assigned to this Profile would not automatically pick up the revised password policy (running the tool again would then highlight the differences).


  • Only settings that can be controlled through the user-interface are checked.
  • No judgment is made on whether deviations from the Organization settings are more or less secure - all differences are reported.

Account permissions

This tool performs read-only operations. It might therefore be surprising to see 'Modify Metadata Through Metadata API Functions' as a requirement for the account used to run the tool. However, at the time of writing, it does not appear possible to configure an account with read-only permissions to the Metadata API. From

Identify a user that has the API Enabled permission and the Modify Metadata Through Metadata API Functions permission or Modify All Data permission. These permissions are required to access Metadata API calls. If a user requires access to metadata but not to data, enable the Modify Metadata Through Metadata API Functions permission. Otherwise, enable the Modify All Data permission.

It therefore appeared preferable to use 'Modify Metadata Through Metadata API Functions' as a minimum requirement over 'Modify All Data'. (Out of interest, a test case was run using 'View All Data' - it failed.)


Salesforce Policy Deviation Checker







No packages published