> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/ci-cd-security/pipeline-based-access-controls/appsec-cicd-54.md).

# Jenkins jobs are executed with high privileges by default

## Rule Details

|                       |                                |
| --------------------- | ------------------------------ |
| Cortex AppSec Rule ID | APPSEC\_CICD\_54               |
| Category              | Pipeline Based Access Controls |
| Severity              | HIGH                           |

## Impact

Each executed Jenkins job is assigned with the privileges of a Jenkins user. These privileges are used to interact with the Jenkins system, and include creating jobs, running builds, and executing on the various configured Jenkins nodes. By default, Jenkins jobs run with the Jenkins SYSTEM user account (that should not be confused with the operating system user). This user account has high privileges over the system, and is allowed to perform any action on the Jenkins instance. Thus, any newly created job runs with the highest level of privileges, unless specifically set otherwise by an administrator. An attacker executing malicious code in a job running with SYSTEM privileges can take advantage of it to perform impactful actions on the Jenkins instance and its nodes. For more information about access controls for builds: <https://www.jenkins.io/doc/book/security/build-authorization/>

## Recommended Solution - Buildtime

Change the default user used to execute Jenkins jobs to support the least privilege principle:

1. Install the Authorize Project plugin.
2. On the Jenkins instance, under “Manage Jenkins”, browse to “Configure Global Security”.
3. Under “Access Control for Builds”, set “Project default build authorization” to one of the following:
   * **Run as Anonymous**
   * **Run as User who triggered Build**
   * **Run as Specific user**
4. In addition, configure the **Per-project configurable Build Authorization** setting to NOT include the **Run as SYSTEM** strategy, to prevent it from being configured for specific jobs. Instead, set one or more of the options above.

**📌 NOTE**\
Follow the least privilege principle when configuring a job to run by a specific user.


---

# 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://cortex-docs.paloaltonetworks.com/appsec-rules/ci-cd-security/pipeline-based-access-controls/appsec-cicd-54.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.
