Subjects
A subject is a thing that the policy resolves for: an endpoint or a project. A repository is a project. Each subject has labels, and the labels decide which policy overrides apply to it.The three layers
Resolution stacks three layers of policy settings, from low to high:- The SafeDep default policy. SafeDep defines it and gives it its own revision number. No tenant can change it. It holds policy settings only, never package rules. Today it sets
scan_gate.fail_ontohighandscan_gate.fail_on_attackstofail, the gate that the pull request check used before the cloud policy existed. - The policy base. It applies to every endpoint and every project of the tenant.
- Policy overrides. Each policy override has a name, a label selector, a unique priority, and the settings that it changes. It applies only to the subjects that its selector matches. A policy override can also have an expiry, after which it matches no subject.
Package rules
Package rules do not use the layers above. A package rule attaches to the policy base, or to one policy override. A subject gets the rules of the policy base plus the rules of each policy override that matches it.Example
The policy base sets a cooldown of 48 hours. Two policy overrides change it:The resolved policy
The resolved policy is the result for one subject. It holds the merged settings, the package rules that apply, the tenant policy revision, the default policy revision and the policy overrides that matched. It also names the layer that set each field, so a tool can explain a decision. SafeDep Cloud resolves the policy when a subject needs it:- An endpoint gets its resolved policy at each policy fetch. PMG keeps the last one in a local cache.
- A project gets its resolved policy at each pull request check.
safedep endpoint policy show or safedep project policy show.
Related
Labels
How a policy override selects endpoints and projects.
Package Rules
Block and trust entries.
Target a Group
Write a policy override for a group of endpoints or projects.
Cloud Policy Settings
Each setting and its value in the default policy.

