Skip to main content

License policy

Your license policy tells FossID how to treat each license it finds:

ActionEffect
AllowNo finding.
WarnA warning that the license needs review: allowed, but check the conditions.
ErrorA prohibited license error: must not be used.

You can set an action for a single license (by its SPDX identifier, such as GPL-3.0-only) or for a whole category:

CategoryExamples
PermissiveMIT, Apache-2.0, BSD
Weak CopyleftLGPL, MPL
Strong CopyleftGPL, AGPL
Source AvailableBUSL, Elastic
Source Available (Non-Commercial)licenses that forbid commercial use
Commercialproprietary licenses
Non Licensetexts that aren't licenses
Uncategorizedlicenses FossID hasn't categorized

The license rules (prohibited license, license needs review and license policy in dependencies) only fire when a policy is in force. Without one, FossID still reports vulnerabilities and modified license texts.

Where your policy comes from​

There are two kinds of policy:

  • A company policy that your organization keeps in the FossID policy service. It applies to every repository and every developer in your organization.
  • A repository policy, in the file .fossid/policy.json, committed with your code.

You don't choose between them. If your organization has a company policy, it applies automatically. In the editor, your repository's .fossid/policy.json then no longer counts for license rules, detection rules or custom volumes. One exception: if the company policy sets no detection rules, FossID uses the detection rules in your repository's .fossid/policy.json. If it sets any, they all come from the company policy, and a rule that it leaves out takes its default. If your organization has no company policy, the repository policy applies.

The company policy is fetched with your organization sign-in (see Signing in). There is nothing to turn on. After you sign in, license findings follow it from your next scan. Detection rules and custom volumes switch to it at FossID's next policy check (see Staying up to date), or as soon as you open License Policies or Detection Rules.

When a company policy first replaces a repository policy you have been using, FossID tells you once per workspace: Your organization manages the FossID policy for this repository. Its own .fossid/policy.json no longer applies to license rules, detection rules or volumes. Select Compare to see the two side by side.

If the policy service can't be reached​

FossID keeps working:

  • License findings may be graded against your repository's policy instead. If the repository has no policy, no license findings are reported.
  • If the service couldn't be reached when the window opened, detection rules and custom volumes are your repository's own, as if there were no company policy. If it stops answering later, they stay as they were.
  • The License Policies and Detection Rules editors can't check which policy applies, so they may show no banner.

This happens quietly. There is no notification; the FossID output channel (View → Output → FossID) records it. When the service can be reached again, FossID goes back to the company policy.

Checking which policy applies​

Open License Policies or Detection Rules from the Policies view in the FossID side bar. A banner at the top tells you which policy you are looking at:

BannerMeaning
Managed by your organization — You can edit and publish changes for everyone.A company policy applies, and you may change it. Edits go out when you select Publish.
Managed by your organization — Your account may not change this policy. Ask whoever administers FossID for your organization.A company policy applies. The editor is read-only for you.
No company policy — This repository's policy applies. You can make it your organization's policy.Your organization has no company policy yet, and you may create one with Create company policy…. Shown only when a folder is open.
(no banner)Your organization has no company policy, and edits are saved to .fossid/policy.json. With no folder open, there is nothing to save to, and the editor doesn't take edits. There is also no banner while the policy service can't be reached; see If the policy service can't be reached.

Changing a company policy needs the policy-write permission, which your FossID administrator grants. You may need to sign in again after it has been granted.

The License Policies editor​

Open the FossID side bar and select License Policies in the Policies view.

Add a rule:

  1. Choose Type: License or Category.
  2. Pick the Identifier from the list. Type to filter. Only licenses FossID knows are accepted, so there are no typos. Items already in your policy aren't listed.
  3. Choose the Action: Allow, Warn or Error.
  4. Select Add.

Adding a license or category that is already in the policy updates its action.

Manage rules:

  • The table lists every rule with its Type, Identifier, Category and Action.
  • Use the Filter box to search by type, identifier, category or action. Matching ignores case, spaces and hyphens, so gpl 3 finds GPL-3.0-only.
  • Change a rule's Action with its drop-down.
  • Select Remove to delete a rule.
  • Select the eye icon on a license row to see the license's details: full name, whether it is OSI-approved, category, reference links and full text.

Where your changes go:

  • Repository policy: changes are saved automatically to .fossid/policy.json and take effect immediately. Findings are re-evaluated without rescanning.
  • Company policy, with policy-write: changes stay in this window until you select Publish. They take effect, for everyone, once published. See Publishing changes.
  • Company policy, without policy-write: the editor is read-only.
  • No folder open, and no company policy: the editor shows No folder is open, so there is no .fossid/policy.json to save rules to. Open a folder to edit its license policy. There are no rules to show, and you can't add any. Under a company policy, you can still edit and publish without a folder.

Note: The license list comes from the running FossID scanner. Until the scanner is ready, the editor shows Loading SPDX list… and the Add button is disabled.

Publishing changes to the company policy​

When a company policy applies and you have policy-write, the License Policies and Detection Rules editors show a Publish button. It is enabled once you have made a change.

  1. Make your changes in the editor.
  2. Select Publish. There is no extra confirmation. Your changes go out to everyone in your organization.

Each editor publishes only its own part: License Policies publishes the license rules, Detection Rules publishes the detection rules and custom volumes. The rest of the company policy is kept as it is.

MessageWhat it means
FossID: policy published for your organization.Done. Findings follow the new policy.
FossID: someone else published a change to this policy, so yours was not published. Theirs is shown now; apply your change to it again.Someone changed the company policy after you started editing. The editor now shows their version. Make your change again and publish.
FossID: the policy changed while publishing, so yours was not published. The new version is shown now; apply your change to it again.Same, but the change landed while you were publishing.
FossID: your account may not publish this policy.You don't have policy-write. Ask your FossID administrator.
FossID: sign in again to publish.Your sign-in has expired. Sign in and publish again; your edits are kept.
FossID: could not read the current policy, so publishing was stopped …FossID couldn't read the current company policy, for example because the service can't be reached or your sign-in has expired. Publishing without it could overwrite the rest of the policy. Your edits are kept. Check your connection and sign-in, then try again.
FossID: could not reach the policy service — …Check your network and try again. Your edits are kept.
FossID: the policy service failed — …The policy service had a problem. Try again later. Your edits are kept.

Creating a company policy​

If your organization has no company policy yet and you have policy-write, you can turn your repository's policy into your organization's policy. The repository's folder must be open; without one, Create company policy… isn't offered.

To create it:

  1. Open License Policies or Detection Rules and select Create company policy… in the No company policy banner.
  2. FossID opens a read-only preview of the exact document it will create. It contains your repository's license rules and the detection rules currently in force. It contains no volumes, because a repository's volume list isn't trusted.
  3. Review the confirmation, Create the company policy for <organization>? It explains that the policy will apply to every repository and developer in your organization. It also lists what to check first, for example:
    • no license rules, so nothing would be flagged for its license;
    • detection rules that would be switched off for everyone.
  4. Select Create company policy.

FossID confirms: FossID: the company policy is created. It now applies to every repository in your organization. It also keeps a local copy of what was published; the FossID output channel shows where.

The new company policy has no volumes. To add your organization's volumes, open Detection Rules, add each volume, and select Publish. See Custom scan volumes.

Important: A company policy can be changed later, but it can't be removed from the editor.

If someone in your organization created a company policy while you were reviewing yours, nothing is published and FossID says so.

Staying up to date​

FossID checks for changes to the company policy every 15 minutes, and when you return to the editor window (at most once a minute). When one of these checks finds a change, findings are re-graded right away, open editors refresh, and FossID tells you what happened:

  • Your organization updated its FossID policy. Findings now follow the new version. Select Show Changes to see what changed.
  • Your organization removed its FossID policy. Your repository's policy applies again.

Unpublished edits in the License Policies or Detection Rules editor are never thrown away by an update. You'll see Your unpublished edits are kept. If you then publish them over the newer version, FossID refuses and shows you the organization's copy to apply your change to.

The repository policy file​

The repository policy lives in .fossid/policy.json at the root of your first workspace folder. It applies only when your organization has no company policy. The same file also holds your repository's detection rule settings and custom volumes.

{
"version": 1,
"policy": [
{ "id": "GPL-3.0-only", "type": "license", "action": "error", "blocked": true, "reason": "Not allowed in shipped products" },
{ "id": "StrongCopyleft", "type": "category", "action": "error", "blocked": true, "reason": "" },
{ "id": "WeakCopyleft", "type": "category", "action": "warn", "blocked": true, "reason": "Check linking" },
{ "id": "MIT", "type": "license", "action": "allow", "blocked": false, "reason": "" }
]
}
FieldMeaning
idAn SPDX license identifier, or a category name (Permissive, WeakCopyleft, StrongCopyleft, SourceAvailable, SourceAvailableNc, Commercial, NonLicense, Uncategorized).
typelicense or category.
actionallow, warn or error.
blockedKept for older FossID versions. The editor writes false for allow and true otherwise. action decides.
reasonOptional explanation, shown in the finding's message. The editor writes an empty one when there is none.

You can edit the file by hand, switch branches, or pull changes. FossID notices and re-evaluates findings immediately.

  • Older formats. FossID also reads a policy from .fossidpolicy or fossidpolicy at the workspace root, if there is no .fossid/policy.json. The editor always saves to .fossid/policy.json, which then takes precedence.
  • Invalid JSON. If the file isn't valid JSON, FossID can't read it: the editors show no rules from it, and license findings aren't graded against it. Fix the file, or save from the editor, which replaces its contents.

We recommend committing .fossid/policy.json so the whole team works to the same policy. Use Governance to require compliance review for changes to it.