This is a step-by-step guide to creating a Git Repository Policy in Xray. To learn more about Policies, click here.
Info
For self-hosted, available from version 3.111 and above.
- Navigate to Xray → Watches & Policies.
- Click New Policy.
- Enter a Policy Name (e.g., "Production Security Policy").
- (Optional) Add a Description explaining the policy’s purpose.
- Choose the Policy Type:
- Security Policy – Detects vulnerabilities in Git repositories.
- Licences Policy
- Under the Policy Rules List tab, click on Create New Rule.
The Create New Policy Rule window opens. - Enter a Rule Name.
- From the Rule type dropdown, select:
- SAST
- CVEs
- Exposures (Secrets only)
- From the Select minimal severity dropdown, select the severity level to trigger the rule.
- Click Save Rule to create a new rule.
- To attach the Policy to a Watch (that is already assigned to a Git Repository), select the Apply on Scope tab.
Policies are enforced through Watches, which monitor Git repositories. - Select an existing Watch.
- Click Save & Apply.