This guide needs the SafeDep Cloud Team or Enterprise plan and the Admin role. See pricing.
Choose the labels
Each subject already has some labels:- An endpoint with PMG has
reported/osandreported/arch, such asreported/os=darwin. - A project that is bound to a repository has
scm/forge,scm/ownerandscm/repo.
custom/ label. For a policy override that loosens the policy, select on custom/, scm/ or safedep.io/ labels only. An endpoint sends its own reported/ labels, so SafeDep Cloud cannot check them.
Label projects
-
Find the projects. A repository is a project:
If a repository is not in the list, create its project with
safedep project sync OWNER/REPOSITORY. -
Set the label on each project, by its exact name:
Label endpoints
-
Find the endpoints:
-
Set the label. An endpoint is its id, a unique prefix of the id, or a hostname that
safedep endpoint listshowed:
Write the policy override
-
Open the policy settings document:
-
Add a policy override under
overrides:nameuses lowercase letters, digits and hyphens. Each name is unique.priorityis a number from 1 to 1,000,000. Each priority is unique. When two policy overrides match a subject and set one field, the higher priority wins.specholds only the fields that the policy override changes.- Leave out
idfor a new policy override. The server sets it. Keep theidof an existing policy override when you edit or rename it.
matchExpressions, with the operatorsIn,NotIn,ExistsandDoesNotExist: - Save the file and close the editor.
-
Preview and publish the change that the command created:
Use the change number that
safedep policy editprinted. A new policy override counts as a change that loosens, because it can move subjects to a looser result. So the publish asks you to confirm it.
Check the result
Before you publish, list the subjects that the selector matches:--selector takes the selector as text. Separate the terms with commas, as in custom/team=release,reported/os=darwin. Every term must hold. A term can be key=value, key!=value, key in (a,b), key notin (a,b), key or !key.
After you publish, show the policy of one subject and the layer that set each value:
If the publish stops
When another Admin published a change to the policy settings after you created your change, the publish stops, because your change is stale. Sync the change, read the preview again, and publish:Select one endpoint for a short time
A selector can name one endpoint bysafedep.io/endpoint-id. Such a policy override needs an expiry:
safedep endpoint list --output json shows. After its expiry, the policy override matches no subject.
Next steps
Fail Pull Request Checks
Use a policy override on the scan gate of a group of projects.
Set a Cooldown
Set the cooldown for a group of endpoints.
Labels
Prefixes, sources and selectors.

