> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Policies

> [!WARNING]
>
> Policy filters only work for conda repositories.
>
> ***
>
> Packages (Software files and information about the software, such as its name, version, and description, bundled into a file that can be installed and managed by a package manager.) in a channel (A location (URL or file path) in a repository where conda looks for packages.) are only filtered by a policy when the mirror (Mirroring is the process of copying data from a source and storing it in a new location, often on a scheduled basis.) runs. If you update a policy, any channels the policy is applied to are not updated until the next time the channel's mirror runs.

A policy is a security control you can apply to a channel or mirror to restrict the packages users can source from them. Enforcing policies ensures that only approved software is available, helping maintain consistency across team environments (A self-contained, isolated space for installing and running software packages.) and reducing security risks. Policies allow you to filter packages based on criteria such as package name, platform architecture, license, and [Common Vulnerabilities and Exposures (CVE)](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/cve.md) score and status to meet your organization’s compliance and security requirements.

## Creating a policy

> [!NOTE]
>
> Creating and applying policies is restricted to users whose [role](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/user_config/permissions.md#permission-levels) provides `Manage` permissions for the **Policy Engine** category.

1. Log in to Package Security Manager.
2. Select  **Policies** from the left-hand navigation.
3. Click **Create policy**.
4. Complete the [Create policy form](#create-policy-form).
5. Click **Create Policy**.

### Create policy form

The **Create policy** form provides a step-by-step approach to building policies for your channels and mirrors. Let’s take a look at the different sections of the **Create policy** form and what configurations they control:

> [!TIP]
>
> * Each section of the form provides a tip to help you understand and complete the process.
> * As you build the policy, a real-time summary appears on the right, explaining in plain language what the policy enforces.
> * Click **Previous** or **Next** to navigate the different sections of the **Create policy** form.

**1. Set Details**

![](https://mintcdn.com/anaconda-29683c67/4YgHE0z28xHZ8yr8/images/psm-on-prem/set_policy_details.png?fit=max\&auto=format\&n=4YgHE0z28xHZ8yr8\&q=85\&s=9514eec3d941fed5c99aab6722c3a08a)

1. **Policy Name**\
   Provide a unique name for your policy. Anaconda recommends using a descriptive name that helps users understand its purpose.
2. **Description**\
   Enter a brief description of what effect the policy will have on a channel or mirror.

**2. Set Package Rules**

![](https://mintcdn.com/anaconda-29683c67/4YgHE0z28xHZ8yr8/images/psm-on-prem/set_policy_package_rules.png?fit=max\&auto=format\&n=4YgHE0z28xHZ8yr8\&q=85\&s=d571ee8b67b1c800e58153d3ad30709e)

1. **Platform**\
   Restrict packages based on their platform architecture.
   > [!NOTE]
   >
   > Package Security Manager automatically includes any noarch (A platform architecture that is not specific to a particular CPU architecture or operating system.) package dependencies in your channel when you apply a policy that restricts packages by platform architecture.
2. **License**\
   Restrict packages based on their license type. Multiple license types can be specified for the policy. For more information on licenses, see [Package license information](https://anaconda.com/docs/psm-on-prem/6.8.0/user/package.md#package-license-information).
3. **Package Name(s)**\
   If you know the specific packages you want your channel or mirror to contain, enter their names here.

   > [!WARNING]
   >
   > Specifying packages by name does not automatically populate the channel with their dependencies.
4. **Include Dependencies**\
   Select this checkbox to include dependencies for the packages specified in the **Package Name(s)** field.
5. **Other Package Criteria**
   * **Only Signed Packages**\
     Select this checkbox to only mirror packages that have Anaconda signatures from the source mirror.
   * **Legacy Packages**\
     Select this checkbox to include `.tar.bz2` package files along with `.conda` files for packages. *This effectively doubles your required storage space*.

     > [!NOTE]
     >
     > When left unselected, if `.tar.bz2` files are the only ones available in the source, they are included.
6. **Date Range**\
   Instruct the policy to only include packages that were created within the range selected.

**3. Set CVE Rules**

![](https://mintcdn.com/anaconda-29683c67/4YgHE0z28xHZ8yr8/images/psm-on-prem/set_policy_cve_rules.png?fit=max\&auto=format\&n=4YgHE0z28xHZ8yr8\&q=85\&s=58f0bc580c34b467b84b1c5930be01e3)

1. **CVE Score**\
   Restrict packages based on their associated [CVE Scores](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/cve.md#cve-scores).
2. **and/or**
   * The *and* operator includes package files that meet *all* the specified criteria.
   * The *or* operator includes package files that meet *at least one* of the specified criteria.
3. **CVE Status**\
   Restrict packages based on their associated [CVE Status](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/cve.md#cve-statuses).
4. **CVE Allowlist IDs**\
   CVEs (A public identifier for a known security flaw in software, used to track and assess vulnerabilities.) listed here are not considered for package file filtering criteria.

**4. Set Exclusions**

![](https://mintcdn.com/anaconda-29683c67/4YgHE0z28xHZ8yr8/images/psm-on-prem/set_policy_exclusions_exceptions.png?fit=max\&auto=format\&n=4YgHE0z28xHZ8yr8\&q=85\&s=fbf6dddbf32d76c904ce31253da46b13)

1. **Exclude Packages**\
   Enter the name of any packages you want to exclude. To list multiple packages, press the Tab key after entering each package name.
2. **Exclusion Exceptions**\
   Include specific packages that would otherwise be removed by the exclude packages filter by listing them here.
3. **CVE Status**\
   Choose to restrict packages by [CVE Status](https://anaconda.com/docs/psm-on-prem/6.8.0/admin/cve.md#cve-statuses).

   > [!NOTE]
   >
   > Packages can be excluded and included against non-exact values by including wildcard `*` and `>/<` ranges (where supported).\
   > For example, if you choose to exclude the package `p*`, Package Security Manager excludes all packages that start with the letter “p”. For more information about using non-exact value search queries, see [Package Match Specifications](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications) in the official conda documentation.

**5. Review**

Review the rules that your policy will enforce.

![](https://mintcdn.com/anaconda-29683c67/4YgHE0z28xHZ8yr8/images/psm-on-prem/policy_review.png?fit=max\&auto=format\&n=4YgHE0z28xHZ8yr8\&q=85\&s=140decd894ad2ac8c2be768a18cfe823)

## Applying a policy

Policies can be applied to channels at the time of creation or by editing the channel and selecting a policy from the **Assign Policy** dropdown at a later time. For more information, see the [Create channel form](https://anaconda.com/docs/psm-on-prem/6.8.0/user/channel.md#create-channel-form).

## Managing policies

Select  **Policies** from the left-hand navigation to view all policies and which channels and mirrors they are associated with.

![](https://mintcdn.com/anaconda-29683c67/9t4S9uQ-n8Qk5XW_/images/psm-on-prem/as_view_policies.png?fit=max\&auto=format\&n=9t4S9uQ-n8Qk5XW_\&q=85\&s=1031069eac5160a3c15e9bda414d6e6f)

> [!TIP]
>
> Use the search box to locate a policy by name.

### Policy actions

Use the icons in the **Actions** column to manage your policies. You can view, edit, or delete your organization’s policies, as well as search for specific policies and see their assigned channels and descriptions.

![](https://mintcdn.com/anaconda-29683c67/4YgHE0z28xHZ8yr8/images/psm-on-prem/policy_actions.png?fit=max\&auto=format\&n=4YgHE0z28xHZ8yr8\&q=85\&s=4ca5281abcbc8e23fa4f080a55133908)
