> ## 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.

# Environment logging and scanning

export const DefinitionDescription = ({children}) => <dd className="definition-description">{children}</dd>;

export const DefinitionTerm = ({children}) => <dt className="definition-term">{children}</dt>;

export const DefinitionList = ({children}) => <dl className="definition-list">{children}</dl>;

export const GCell = ({children, className}) => <div className={`grid-table-cell ${className || ""}`} role="cell">
    {children}
  </div>;

export const GTH = ({children, className}) => <div className={`grid-table-th ${className || ""}`} role="columnheader">
    {children}
  </div>;

export const GRow = ({children}) => <div className="grid-table-row" role="row">{children}</div>;

export const GBody = ({children}) => <div className="grid-table-body" role="rowgroup">{children}</div>;

export const GHead = ({children}) => <div className="grid-table-head" role="rowgroup">{children}</div>;

export const GTable = ({children, className, cols}) => <div className={`grid-table not-prose overflow-hidden rounded-2xl ${className || ""}`} style={{
  "--grid-table-cols": cols
}} role="table">
    {children}
  </div>;

export const Comments = ({children}) => {
  return <div class="my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10" data-callout-type="comments">
      <div class="w-4">
        <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" aria-label="Comments">
            <path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM280 400C266.7 400 256 410.7 256 424C256 437.3 266.7 448 280 448L360 448C373.3 448 384 437.3 384 424C384 410.7 373.3 400 360 400L352 400L352 312C352 298.7 341.3 288 328 288L280 288C266.7 288 256 298.7 256 312C256 325.3 266.7 336 280 336L304 336L304 400L280 400zM320 256C337.7 256 352 241.7 352 224C352 206.3 337.7 192 320 192C302.3 192 288 206.3 288 224C288 241.7 302.3 256 320 256z" />
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

Environment logging gives you visibility into the security posture of your local <Tooltip tip="A self-contained, isolated space for installing and running software packages.">conda environments</Tooltip>. With environment logging enabled, you can view the <Tooltip tip="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.">packages</Tooltip> installed in your environments, identify Common Vulnerabilities and Exposures (<Tooltip tip="A public identifier for a known security flaw in software, used to track and assess vulnerabilities.">CVEs</Tooltip>) associated with them, and proactively address security issues before administrator intervention.

## Enabling environments

If an administrator has enabled environments for your organization, running `anaconda login` prompts you to install the `anaconda-env-manager` metapackage and register your machine with your organization.

After setup, conda automatically logs any environment you create or update.

<Accordion title="Plugins provided by the anaconda-env-manager metapackage">
  <DefinitionList>
    <DefinitionTerm>
      `anaconda-env-log`
    </DefinitionTerm>

    <DefinitionDescription>
      Automatically logs the current state of an environment whenever you perform a `create`, `install`, `remove`, `rename`, or `update` action with conda. Manual logging of existing environments is also supported.
    </DefinitionDescription>

    <DefinitionTerm>
      `anaconda-activate-check`
    </DefinitionTerm>

    <DefinitionDescription>
      Validates environments against administrator-defined security controls before activation and notifies you of warnings or access restrictions with guidance for resolution.
    </DefinitionDescription>

    <DefinitionTerm>
      `anaconda-audit`
    </DefinitionTerm>

    <DefinitionDescription>
      Scans local environments to assess the security impact of actions like installing or updating packages, so you can proactively address potential issues without requiring administrator intervention.
    </DefinitionDescription>
  </DefinitionList>
</Accordion>

```text wrap theme={null}
(base) ➜  ~ anaconda login
Anaconda Environment Manager is required by your organization. It is recommended to install. Proceed? [y/n] (y): y
Installing anaconda-env-manager...
✔︎ anaconda-env-manager installed successfully.
Only one organization found, automatically selecting: my-organization
Linking this machine to organization my-organization...
✔ This machine is now registered with my-organization. Conda environments will be logged to this organization.
```

<Note>
  If you belong to multiple organizations, you are prompted to select one from the list before registration completes.
</Note>

## Logging environments

Environments that you created prior to setup can be manually logged with your organization:

```sh theme={null}
anaconda env-log log --name <ENV_NAME>
```

<Comments>
  Replace \<ENV\_NAME> with the name of the environment you want to log to your organization.
</Comments>

## Viewing your environments

To view environments you've logged to your organization, select <Icon icon="laptop-code" iconType="regular" /> **Environments** under Org Management.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/vJelqv0dbDL7Nqlg/images/ap_view_org_environments.png?fit=max&auto=format&n=vJelqv0dbDL7Nqlg&q=85&s=a03891bb00ac8f1f7e2f7b95e11885e9" alt="View logged environments" width="1922" height="1082" data-path="images/ap_view_org_environments.png" />
</Frame>

<Note>
  You can only view environments that you've logged to your organization.
</Note>

### Searching and filtering

Search for environments by name or path using the search box at the top of the table. You can also filter by platform.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/_ySrlu_mSpdr74u0/images/ap_env_search_filter.png?fit=max&auto=format&n=_ySrlu_mSpdr74u0&q=85&s=9b8951368db7667938be7020bd762f93" alt="Environment search and filters" width="1922" height="1082" data-path="images/ap_env_search_filter.png" />
</Frame>

## Scanning environments

Scanning checks the most recently saved environment log for CVEs associated with its packages.

<Note>
  Environments are automatically scanned when created but not when updated. Perform a scan before investigating an environment to ensure its data is current.
</Note>

<Tabs>
  <Tab title="Scanning locally">
    ```sh theme={null}
    anaconda audit scan [OPTIONS]
    ```

    <GTable cols="30% 70%">
      <GHead>
        <GRow>
          <GTH>Option</GTH>
          <GTH>Description</GTH>
        </GRow>
      </GHead>

      <GBody>
        <GRow>
          <GCell>`--name, -n`</GCell>
          <GCell>Scan an environment by name (uses default conda environment path prefix)</GCell>
        </GRow>

        <GRow>
          <GCell>`--prefix, -p`</GCell>
          <GCell>Scan an environment at a specific path</GCell>
        </GRow>

        <GRow>
          <GCell>`--affected-only`</GCell>
          <GCell>Only display packages that have CVE matches</GCell>
        </GRow>

        <GRow>
          <GCell>`--json`</GCell>
          <GCell>Output results in JSON format (disables summary table)</GCell>
        </GRow>

        <GRow>
          <GCell>`--no-include-cleared`</GCell>
          <GCell>Exclude cleared CVEs from results</GCell>
        </GRow>

        <GRow>
          <GCell>`--no-include-mitigated`</GCell>
          <GCell>Exclude mitigated CVEs from results</GCell>
        </GRow>
      </GBody>
    </GTable>

    **Reading scan results:**

    Scan output includes a package table and a summary matrix of CVE counts by severity level.

    * Color indicates [CVE severity](/anaconda-platform/cloud/admin/cve#common-vulnerability-scoring-system-cvss)
    * ✓ indicates the CVE has undergone [Anaconda curation](/anaconda-platform/cloud/admin/cve#cve-statuses)
    * ~~Strikethrough~~ indicates a cleared CVE that is safe to use

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/YGtija9HXl-k020Y/images/anaconda_audit_scan_summary.png?fit=max&auto=format&n=YGtija9HXl-k020Y&q=85&s=8ea8a8644d196185458c3289b522b2aa" alt="Scan results summary" width="1480" height="744" data-path="images/anaconda_audit_scan_summary.png" />
    </Frame>
  </Tab>

  <Tab title="Scanning from your organization">
    Scan an environment that has been logged with your organization to get an updated list of CVEs:

    1. Select <Icon icon="laptop-code" iconType="regular" /> **Environments** from the left-hand navigation.
    2. Select the environment you want to scan.
    3. Click <Icon icon="arrows-rotate" iconType="regular" /> **Update Scan**.

           <Frame>
             <img src="https://mintcdn.com/anaconda-29683c67/_ySrlu_mSpdr74u0/images/ap_env_scan_in_cloud.png?fit=max&auto=format&n=_ySrlu_mSpdr74u0&q=85&s=b1e200efb694726c7f02049b026fb532" alt="Update scan button" width="1922" height="953" data-path="images/ap_env_scan_in_cloud.png" />
           </Frame>
  </Tab>
</Tabs>

## Investigating environments

### Viewing packages

Click the package count under the **PACKAGES** column to see which packages are installed in an environment and what <Tooltip tip="A location (URL or file path) in a repository where conda looks for packages.">channels</Tooltip> they were sourced from.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/_ySrlu_mSpdr74u0/images/ap_env_pkgs.png?fit=max&auto=format&n=_ySrlu_mSpdr74u0&q=85&s=5f92def0368f244a910849884a11b39f" alt="Viewing a logged environment's packages" width="1922" height="1082" data-path="images/ap_env_pkgs.png" />
</Frame>

<Note>
  Use the navigation controls at the bottom to browse the environment's packages.
</Note>

### Viewing CVEs

<Tabs>
  <Tab title="Environment CVEs">
    Click the CVE count in the **CVES** column to view all CVEs associated with an environment. Each entry includes the CVE name, CVSS score, Anaconda curation date, a description, and its current status.

    Use the filters at the top of the page to locate critical CVEs. Select a CVE from the list to view its details.

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/_ySrlu_mSpdr74u0/images/ap_env_cves.png?fit=max&auto=format&n=_ySrlu_mSpdr74u0&q=85&s=ea56653b5944880a6d4ae2ba2dee52c6" alt="Viewing a logged environment's CVEs" width="1922" height="1082" data-path="images/ap_env_cves.png" />
    </Frame>
  </Tab>

  <Tab title="Package CVEs">
    To view CVEs associated with a specific package:

    1. Click the package count in the **PACKAGES** column.
    2. Locate the package.
    3. Click the CVE count beside the package.

       Each entry includes the CVE name, CVSS score, Anaconda curation date, a description, and its current status. Select a CVE from the panel to view its details.

           <Frame>
             <img src="https://mintcdn.com/anaconda-29683c67/_ySrlu_mSpdr74u0/images/ap_env_pkg_cves.png?fit=max&auto=format&n=_ySrlu_mSpdr74u0&q=85&s=8d6cddd6a831e4e568db085eee0c8f65" alt="CVEs associated with a specific package in a logged environment" width="1922" height="1082" data-path="images/ap_env_pkg_cves.png" />
           </Frame>
  </Tab>
</Tabs>

<Note>
  The **active** filter is applied to CVE results by default.
</Note>

### Checking environments for vulnerabilities

To check if any of your environments are affected by a specific vulnerability, search by CVE ID using the [unified search](/anaconda-platform/cloud/user/unified-search) bar at the top of the page. Results include environments you've logged that contain packages associated with the CVE you're searching for.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/vJelqv0dbDL7Nqlg/images/ap_unified_search.png?fit=max&auto=format&n=vJelqv0dbDL7Nqlg&q=85&s=b6d3537e46a78a69530324176a13893b" alt="The unified search bar at the top of anaconda.com/app" width="1922" height="522" data-path="images/ap_unified_search.png" />
</Frame>
