> 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/content-collections/search-and-investigate/application-asset-queries/application-asset-examples.md).

# Application Asset Query Examples

Learn how to build and analyze Application Asset queries.

## Query Example #1

Find all code repositories that have a `CODEOWNER` file but the repository’s branch protection rule is not using it. Utilizing the `CODEOWNER` file in branch protection rules can improve security and code quality since any pull request that modifies code owned by a code owner must be approved by that code owner before the pull request can be merged into the protected branch.

1. Select **Application Asset** from **Find**.
2. In **Type** select **VCS repository**, which represents a repository.
3. In **WHERE**, select **Has Code Owner** > **is** > **true**.
4. Select a branch protection rule attribute: **Add** > **That Contains VCSBranchProtectionRule**.

   The **VCSBranchProtectionRule** is displayed in the **\[THAT CONTAINS]** field.
5. Select a rule. In **WHERE**: **Add** > **Is Code Owner Reviews Required** > **is** > **false**.
6. Select the branch: **Add** > **That Protects VCSBranchPattern** > **Name** > **is** > **main**.
7. Select **Search**.

   The query results are displayed.

   <figure><img src="https://3990409212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyqPwsbMSaogAot23rTIu%2Fuploads%2Fgit-blob-7be75939ad46c7a042cf9d4d6a5006ccc4119a8a%2Finvestigate-eg4.1.png?alt=media" alt="investigate eg4.1"><figcaption></figcaption></figure>

## Query Example #2

Find all VCS deploy keys that have **write** permissions.

To minimize the risk of a stolen deploy key being used by an attacker, it is recommended to reduce the level of permissions of all deploy keys to **read-only** when write permissions are not necessary for the pipeline to function properly.

<figure><img src="https://3990409212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyqPwsbMSaogAot23rTIu%2Fuploads%2Fgit-blob-99e53ee308504033b973df671bd7d9d4eab266f5%2Finvestigate-eg2.1.png?alt=media" alt="investigate eg2.1"><figcaption></figcaption></figure>

## Query Example #3

Find all private code repositories that can be forked.

An attacker could use a fork to create a pull request that triggers a pipeline, which could then be used to deploy malicious code to your production environment. If you do not need to allow forks, it is best to disable fork permission for each repository, preferably at the organization level.

<figure><img src="https://3990409212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyqPwsbMSaogAot23rTIu%2Fuploads%2Fgit-blob-587d9d3e6e4ae090ee389be3f4933aa85f1ed9cb%2Finvestigate-eg5.1.png?alt=media" alt="investigate eg5.1"><figcaption></figcaption></figure>

## Query Example #4

Find all code repositories that import packages infected with the **CVE-2017-20165** vulnerability through package files.

1. Select **Investigate** on the Prisma Cloud console.
2. Select **Application Asset** from the **Select a Query Type** field.
3. Under **Type**, select **VCSRepository**, which represents a repository.
4. Add clauses:
   1. Click **+ Add** > **That Contains PackageFile**.
   2. Click **+ Add** > **That Depends On Package**.
   3. Click **+ Add** > **That Has Vulnerability**
   4. Click **+ Add** > **id** > **is** > **CVE-2017-20165**.

      <figure><img src="https://3990409212-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyqPwsbMSaogAot23rTIu%2Fuploads%2Fgit-blob-abb395e3ca883d72bc111ac5d4b23b21abde850b%2Fsbom-dep-graph-query1.1.png?alt=media" alt="sbom dep graph query1.1"><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.prismacloud.io/content-collections/search-and-investigate/application-asset-queries/application-asset-examples.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
