Creating a policy
To create a policy, use--create along with configuration options. These options let you define filtering criteria such as platforms, licenses, CVEs, and package names:
Basic configuration options
--name: Set the name of the policy--description: (Optional) Provide a description for the policy
Platform filtering options
--platform: Include platforms, separated by commas--platform-not: Exclude platforms, separated by commas
linux-32, linux-64, linux-aarch64, linux-armv6l, linux-armv7l, linux-ppc64, linux-ppc64le, linux-s390x, osx-64, osx-arm64, win-32, win-64, zos-znoarch
License filtering options
--license: Include licenses, separated by commas--license-not: Exclude licenses, separated by commas
AGPL, GPL, GPL2, GPL3, LGPL, BSD, MIT, APACHE, PSF, Public-Domain, Proprietary, MOZILLA, OTHER, None, CC
Package filtering options
--package-name: Include package names, separated by commas--exclude-package-name: Exclude package names, separated by commas--exclude-package-name-exception: Remove exclusions for specified packages, separated by commas--include-dependencies: Include dependencies--exclude-dependencies: Exclude dependencies--only-signed-packages: Restrict to signed packages only--keep-legacy-packages: Include both.condaand.tar.bz2files for packages that contain them
Date-based filtering options
Date format:YYYY-MM-DD
--package-created-from: Filter packages created on or after the specified date--package-created-to: Filter packages created on or before the specified date
CVE filtering options
--cve-score: Set a CVE score threshold for filtering--cve-score-comparator: Comparator for CVE score (==,<=,>=,<,>; default:<=). Quote the value on the command line, for example"<=".--cve-status: Include CVE statuses, separated by commas--exclude-cve-status: Exclude CVE statuses, separated by commas
active, reported, mitigated, cleared, disputed
--cve-link-status-and-score: Define the relationship between CVE status and score (andoror; default:and)--cve-allowlist: Add specific CVE IDs to an allowlist, separated by commas (format:CVE-YYYY-#####)--exclude-uncurated-cve-packages: Exclude uncurated CVE packages
Viewing policies
To view all policies:Assigning a policy
To assign a policy to a channel:Policies can also be applied directly to mirrors. For more information, see Creating a mirror with a policy.
Unassigning a policy
Editing a policy
To edit an existing policy, use--edit with the same configuration options available for creating a policy, plus the policy ID:
Editing a filtering option clears the previous filter value. For example, if you create a policy with the
win-32 platform filter, running conda repo policy --edit <POLICY_ID> --platform "win-64" replaces the win-32 filter with win-64—it does not add both.Deleting a policy
Related
- Policies: Managing policies through the GUI
policycommand reference: Full options and flags