> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/admin-guide/32/how-to-guides/twistcli-sandbox-third-party-scan.md).

# Run third-party assessment tools

In the [Lagrange release (v22.12+)](https://docs.paloaltonetworks.com/prisma/prisma-cloud/22-12/prisma-cloud-compute-edition-release-notes/release-information) the [twistcli image analysis sandbox](/admin-guide/32/runtime-defense/image-analysis-sandbox.md) capability allows for the execution of third-party assessment tools. You can supply a third-party binary/script that is executed after the twistcli sandbox image analysis is completed. The output of the third-party tool can be captured within a volume mount for further analysis. Twistcli sandbox analysis occurs within a temporary container of the image under examination. No modifications are made to the image under analysis.

In this example we will use the [OpenSCAP](https://www.open-scap.org/) utility to perform a [Compliance as Code’s v0.1.65 RHEL-8 STIG profile](https://github.com/ComplianceAsCode/content/blob/master/products/rhel8/profiles/stig.profile) scan of a [RedHat Universal Base Image 8](https://catalog.redhat.com/software/containers/ubi8/ubi/5c359854d70cc534b3a3784e).

1. On the host on which the twistcli sandbox analysis will occur create a directory `/opt/sandbox`.
2. Download the [latest ComplianceAsCode release](https://github.com/ComplianceAsCode/content/releases), extract `ssg-rhel8-ds.xml` and copy to the `/opt/sandbox` directory.
3. Copy the following bash script to `/opt/sandbox/openscap_analysis.sh`.

   ```
   #!/bin/bash
   # Install tools and OpenSCAP
   yum update -y -q
   yum install -y -q openscap-scanner

   # Run OpenSCAP scan
   # Note: HTML and XML OSCAP output files are written to the host mounted directory
   oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_stig --report /opt/sandbox/openscap_sandbox_stig.html --results /opt/sandbox/openscap_sandbox_stig.xml /opt/sandbox/ssg-rhel8-ds.xml
   ```
4. Set the executable flag on openscap\_analysis.sh.

   ```
   $ chmod +x openscap_analysist.sh
   ```
5. Execute twistcli sandbox analysis of the ubi:8.7-1037 image with the following command:

   ```
   linux/twistcli sandbox \
   --address https://127.0.0.1:8083 \
   --volume /opt/sandbox:/opt/sandbox \
   --third-party-delay 5s \
   --third-party-cmd /opt/sandbox/openscap_analysis.sh \
   --third-party-output /opt/sandbox/oscap-results.txt \
   registry.access.redhat.com/ubi8/ubi:8.7-1037
   ```

   Where:

   * `--volume /opt/sandbox:/opt/sandbox` - mounts the host’s /opt/sandbox directory into the running container’s /opt/sandbox. The files necessary to execute the OpenSCAP scan are read from this directory and the output of the script is written to this directory.
   * `--third-party-delay 5s` - time delay after the sandbox analysis completes and the third party script is executed.
   * `--third-party-output /opt/sandbox/oscap-results.txt` - path to output results.
6. The following output files are written to the host’s /opt/sandbox directory:
   * openscap\_sandbox\_stig.html - OSCAP report output.
   * openscap\_sandbox\_stig.xml - OSCAP results output.
   * oscap-results.txt - stdout captured during the execution of openscap\_analysis.sh.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/admin-guide/32/how-to-guides/twistcli-sandbox-third-party-scan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
