> 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/credential-hygiene/appsec-cicd-192.md).

# Insecure definition of secret variable in pipeline

## Rule Details

|                       |                    |
| --------------------- | ------------------ |
| Cortex AppSec Rule ID | APPSEC\_CICD\_192  |
| Category              | Credential Hygiene |
| Severity              | MEDIUM             |

## Impact

The task.setvariable command is the least secure way to set secret variables in Azure Pipelines. This is because the secret is stored in plain text in the pipeline yaml file, which anyone with access to the pipeline can view. In addition, hard coded secrets can make it difficult to maintain your code. If you need to change a secret or to perform a periodic rotation, you will need to update it in all of the places where it is used. This can be a time-consuming and error-prone process.

## Recommended Solution - Buildtime

Use OIDC instead of long term credentials as it is more secure, when the service you authenticate against supports it.

The recommended ways to set secret variables in Azure Pipelines are:

* Set a pipeline secret variable. The secret is encrypted and stored in Azure Pipelines exclusively for the pipeline
* Set a secret in a variable group. Variable groups are a way to group together related variables. Secret variables can be added to variable groups and then used in pipelines. This makes it easy to manage secret variables and to reuse them across multiple pipelines
* Link secrets from an Azure key vault. Azure key vault is a service that provides secure storage for secrets. Secret variables can be added to Azure key vault and then used in pipelines

For more information refer to: <https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables?view=azure-devops\\&tabs=yaml%2Cbash>.


---

# 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://cortex-docs.paloaltonetworks.com/appsec-rules/ci-cd-security/credential-hygiene/appsec-cicd-192.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.
