Skip to main content
The pull request check of the SafeDep GitHub App and the Bitbucket app reads the cloud policy of your tenant. Both apps use the same check, so one policy applies to repositories on both forges. There is no separate setting in each app.
This guide needs the SafeDep Cloud Team or Enterprise plan and the Owner or Admin role. See pricing. The app must scan the repositories for your tenant.

What the check reads

For the SafeDep default of each setting and the scopes that the check applies, see Cloud Policy Settings. Verified malware always fails the check. No setting and no trust entry changes that. The check does not apply a dependency cooldown. The check still applies the Malicious Package Exclusions of your tenant. When an exclusion selects a package version, the check does not report an unverified malware verdict for that version. Verified malware still fails the check. PMG with cloud.policy on ignores exclusions. info is a partial value: the vulnerability data has no info grade, so the check ranks a vulnerability with no severity as info.

Fail on medium for a group of projects

  1. Label the projects of the group. A repository is a project:
    If a repository has no project yet, see Label projects.
  2. Open the policy settings document and add a policy override:
  3. Preview the change. The preview counts the projects that the policy override reaches, and how many of them can enforce medium:
  4. Publish it:
    Use the change number that safedep policy edit printed. The next check of each project uses the new revision.
To set the gate for every project of the tenant, set scan_gate.fail_on in the policy base instead. To target one forge, select on scm/forge, as in matchLabels: {scm/forge: bitbucket}.

Deny a license

The check applies the deny list first, then the allow list, to the license of each package that the pull request adds or updates. For the match rules, see License gate.
  1. Open the policy settings document:
  2. Set the deny list in the policy base. Your list replaces the default list, so copy the nine default ids and add the new one:
  3. Preview and publish the change with safedep policy change show and safedep policy change publish, as in Fail on medium for a group of projects.
If your list leaves out an id of the list below it (here, the default list), the change loosens the policy. The publish then asks for a confirmation, and every Owner and Admin of the tenant gets an email about it. To deny no license for a group of projects, set deny: {licenses: []} in a policy override.

Allow only some licenses

Set an allow list for a group of projects. A package with a known license that is not on the list fails the check:
  • The deny list still applies. A license on both lists fails the check.
  • A package with an unknown license still passes under unknown: allow. To allow only the listed licenses, also set unknown: fail. See Fail on an unknown license.
  • To turn off the allow list of the policy base for a group, set allow: {licenses: []} in a policy override.
For which change loosens the policy and which tightens it, see the setting notes.

Fail on an unknown license

Set unknown to report to show these packages in the check without a failure, or to fail to fail on them:
With unknown: fail, the check fails on each pull request that adds a package whose license SafeDep does not know. Start with report, and read the reported packages before you set fail.

Waive a finding for one package

To pass a check that fails on a license or a vulnerability that your team accepts, create a trust entry. See Waive license findings and Waive named vulnerabilities.

What the check shows

A failing check shows a policy block above the package report:
  • On GitHub, in the comment of the SafeDep app and in the output of the check run.
  • On Bitbucket, in the comment of the SafeDep app. The build status of the commit links to the pull request.
The block names the policy revision, each setting that the check read and the layer that set it, and each failing, waived and reported finding with the rule that decided it. This example comes from the SafeDep test data:
For the text of each license finding, see License findings.
  • A passing check shows no policy block.
  • On a public repository, the block shows the rule id of a package rule, not its reason.
  • When the tenant has no policy revision, the block names only the SafeDep default policy.

When the check does not use your policy

  • The repository has no project. The check resolves the policy with the scm/ labels of the repository. The policy base, the package rules of the policy base and the policy overrides that select scm/ labels apply. A custom/ label needs a project. See Label projects.
  • The installation is not linked to a tenant, or the plan of the tenant has no cloud policy. The SafeDep default policy applies alone.
  • SafeDep Cloud cannot read the policy. The check retries, and then fails with an error. It never falls back to the default policy, because the default policy can be looser than yours.
A failed check stops a merge only when the forge requires the check.

Next steps

Explain a Decision

List the checks that a rule or a setting failed.

Target a Group

Label projects and select them in a policy override.

GitHub App

Install the SafeDep GitHub App.

Bitbucket App

Install and link the Bitbucket app.