# Policies

Use this page to view and manage all workflow run policies created in your organization.

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FEx2sg06rk8xoftZS2xos%2FScreenshot%202025-05-05%20at%2023.50.40.png?alt=media&#x26;token=114bf1e5-3564-4268-aa6b-b15be8d49886" alt=""><figcaption><p>Existing workflow run policies displayed in the dashboard</p></figcaption></figure>

## Creating a New Policy in Your Organization

There are four policy types you can create:

* [Compromised Actions Policy](#compromised-actions-policy) - Block the use of compromised Actions
* [Secret Exfiltration Policy ](#secret-exfiltration-policy)- Prevents unauthorized access to Secrets
* [Allowed Actions Policy ](#allowed-actions-policy)- Block specific GitHub Actions
* [Runner Label Policy](#runner-label-policy) - Prevent or monitor usage of specific runners

### Compromised Actions Policy

The Compromised Actions Policy prevents the use of known malicious or compromised GitHub Actions in workflows. It scans for references to actions flagged as security risks and blocks their execution to protect your environment.

#### **Why It Matters**

Workflows often rely on third-party actions, which may be:

* Compromised via account takeovers
* Malicious by design
* Altered to include malware or backdoors

This policy reduces risk by:

* Maintaining a list of compromised actions
* Scanning workflows for those references
* Blocking runs using them
* Alerting developers with actionable feedback

**What Developers See**

If a compromised action is used:

* The workflow is automatically canceled and a PR comment explains the violation and suggests trusted alternatives

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2F8iBBba5gJ8VLX9EHhArz%2FScreenshot%202025-05-13%20at%2000.47.47.png?alt=media&#x26;token=6b4b9544-4c8b-4dac-9bbe-8e0c3711f7f2" alt=""><figcaption></figcaption></figure>

To try the Compromised Action policy, add this action to your workflow:

```
step-security/dummy-compromised-action@main
```

To create a compromised Actions policy, follow the steps below:

**Step 1: Navigate to the Workflow Run Policies page**

* Go to your StepSecurity dashboard, then to Workflow Run Policies → Policies in the sidebar.

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2F5utmWIlin0umvcxQOn7r%2FScreenshot%202025-08-31%20at%2012.16.59.png?alt=media&#x26;token=314cf402-a340-4e74-9b9d-0d63547db3c0" alt=""><figcaption></figcaption></figure>

**Step 2: Click “Create Policy”**

* Click the Create Policy button on the top right of the page.

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FUbNF4zBUbVCkXdmg8zsY%2FCreate%20GitHub%20Action%20Security%20Policies%20with%20Step%20Security%20-%20Step%201.png?alt=media&#x26;token=2d031af3-dac3-4aba-b664-e4a4f4c081e5" alt=""><figcaption><p>Click the create button</p></figcaption></figure>

**Step 3: Fill in Policy Details**

* Policy Name – e.g., *Compromised Actions Policy*
* Policy Type – Select "Compromised Actions Policy"
* Action – Choose between:
  * Enforce: Actively blocks compromised Actions
  * Dry Run: Does not block the workflow run but records the violation in the Evaluations page

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FzMQPwiwuheIacjyhcQUR%2FCreating%20a%20Compromised%20Actions%20Policy%20in%20GitHub%20-%20Step%204.png?alt=media&#x26;token=ef0947b3-4662-49cc-af6a-794e305d779d" alt=""><figcaption><p>Setting up Compromised Actions Policy</p></figcaption></figure>

**Step 4: Select Repositories/Organizations**

* Choose whether to apply the policy to:
  * All current and future repositories/organizations *(default)*, or
  * Select specific repositories/organizations manually

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2F7vXjg0bbf7dmbldGZFnP%2FScreenshot%202025-08-21%20at%2005.02.19.png?alt=media&#x26;token=498a85e4-c51d-4abf-8c18-068d3bba5ce2" alt=""><figcaption></figcaption></figure>

**Step 6: Save the Policy**

* After configuring all settings, click Save to create the policy.

![Click the save button](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/83faa3ac-1ad1-4d61-8a12-95ced8eee9d3/ascreenshot.jpeg?tl_px=195,859\&br_px=1724,1714\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=524,494)

Follow this interactive demo to see how this workflow run policy works in practice:

{% embed url="<https://app.storylane.io/share/ywepexcm8irs>" %}

### Secret Exfiltration Policy

The Secret Exfiltration Policy protects against unauthorized secret access in GitHub Actions. It blocks modified workflows in non-default branches from using secrets unless explicitly approved.

#### **Why It Matters**

Workflows often need secrets to access protected resources. Attackers may exploit non-default branches to run malicious workflows and exfiltrate secrets. This policy helps stop that by:

* Allowing secret access only if the workflow matches the default branch
* Enforcing approval for legitimate changes
* Creating an auditable approval trail

**How It Works**

* Detects non-default branch workflows accessing secrets (${{ secrets.X }}, toJSON(secrets))
* Compares workflow content to the default branch using SHA256
* Requires a workflows-approved label from a different team member for approval
* Blocks runs without proper matching or approval

**What Developers See**

If a modified workflow accesses secrets:

* The run is canceled, and a PR comment explains the block and how to get approval (a teammate has to add the "**workflows-approved**" label to the PR)

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FyJrOLhQQtksfDSFYy1kx%2F1747097633331.png?alt=media&#x26;token=a9941938-8c98-4a73-9fae-9d2a8b488aa2" alt=""><figcaption></figcaption></figure>

* Once the "workflows-approved" label has been added by a teammate, the workflow can be re-run

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2Fbt41ceDF7oA1Y9C4ELBZ%2F1747097806382.png?alt=media&#x26;token=3781bcdf-af78-44dd-b10e-f034630beea7" alt=""><figcaption></figcaption></figure>

To create a Secrets Exfiltration policy, follow the steps below:

**Step 1: Select “Secret Exfiltration Policy”**

* You can exempt specific users or bot accounts from this policy. When a workflow is triggered by an exempted user or bot, the run will not be blocked by the policy.

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FieJHolmInjsIAEYRmq33%2FScreenshot%202025-10-14%20at%2006.10.15.png?alt=media&#x26;token=c332900f-4bc8-460e-9060-08a6dbe0a67f" alt=""><figcaption></figcaption></figure>

**Step 2: Choose Target Repositories/Organizations**

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FHORdofXkocJuXAQj3NWb%2FScreenshot%202025-08-21%20at%2005.04.13.png?alt=media&#x26;token=5a7a6172-0e88-4780-ba22-fa9cccaae571" alt=""><figcaption></figcaption></figure>

**Step 3: Save the Policy**

![Setting up Secret Exfiltration Policy](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/ecea59af-b24a-48d9-a739-7997c8bb5537/ascreenshot.jpeg?tl_px=0,175\&br_px=2752,1714\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=353,450)

Follow this interactive demo to see how this workflow run policy works in practice:

{% embed url="<https://app.storylane.io/share/ehzs59gzdatf>" %}

### Allowed Actions Policy

Use this policy to enforce an allowlist of GitHub Actions. Any action not listed is blocked (Enforce) or flagged (Dry Run).

To create a Allowed Actions policy, follow the steps below:

**Step 1: Select “Allowed Actions Policy”**

![Setting Up Allowed Actions Policy](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-12/b7e88d67-ccff-4b58-b71d-3ed68a294a32/ascreenshot.jpeg?tl_px=0,49\&br_px=1376,818\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=502,277)

&#x20;**Step 2: Add Actions to Allowlist**

* Manually type and add actions (e.g., `actions/checkout`) **OR**

![Setting Up Allowed Actions Policy](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-12/be8920f9-1486-4dec-85fd-b9a412babfaf/ascreenshot.jpeg?tl_px=0,202\&br_px=1376,971\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=462,277)

* Use All Actions (Used) to select from known usage

![Setting up Actions Policy using existing Action in the organization](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/8e15cbc3-cb84-43c0-9857-f83c0f34a5cf/ascreenshot.jpeg?tl_px=0,175\&br_px=2752,1714\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=452,292)

* Select one Action and click "Add to Allowed List"

![Setting up Actions Policy using existing Action in the organization](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/560f6dc1-6ed8-4b44-a0a8-e713fe4e4e96/ascreenshot.jpeg?tl_px=272,0\&br_px=3024,1538\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=809,166)

* Decide whether to allow all versions (default) or select specific commit versions **OR**

![Setting up Actions Policy using existing Action in the organization](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/5131ed95-a2d4-4344-b512-835a27697f51/ascreenshot.jpeg?tl_px=0,12\&br_px=2752,1551\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=423,277)

* **Use Repository Filter (Optional):** Go to **By Repository (Used)** tab → Select a repo → Add used actions

![Setting up Actions Policy by Repository using Actions](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/6f6b7c07-313a-4ceb-8362-bd3a60dfc627/ascreenshot.jpeg?tl_px=272,142\&br_px=3024,1681\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=863,276)

**Step 3: Click "Save"**

![Setting up Actions Policy by Repository using Actions](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/c2d8ec92-557b-468e-8998-c67e6432d108/ascreenshot.jpeg?tl_px=0,175\&br_px=2752,1714\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=359,512)

Follow this interactive demo to see how this workflow run policy works in practice:

{% embed url="<https://app.storylane.io/share/oyniugodihnf>" %}

### Runner Label Policy

Use this policy to block untrusted GitHub-hosted runners or allow only specific self-hosted runners.

To create a Runner Label policy, follow the steps below:

**Step 1: Fill in Policy Details**

* Policy Name – e.g., *Do not allow GitHub-Hosted Runners*
* Policy Type – Select Runner Label Policy
* Action – Choose between:
  * Enforce: Actively blocks disallowed runner labels
  * Dry Run: Does not block the workflow run but records the violation in the Evaluations page

![Selecting Runner Label Policy Type](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/461225cc-47fc-4dae-b864-303b1aa0c8ca/ascreenshot.jpeg?tl_px=797,304\&br_px=2763,1403\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=401,205)

**Step 2: Specify Disallowed Runner Labels**

* Type in the runner labels you want to block (e.g., ubuntu-latest, macos-latest) and press Enter to add.

![Specify runner labels to disable](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/59ea0f12-1149-4805-b3ed-72f70d25cb34/ascreenshot.jpeg?tl_px=733,460\&br_px=2699,1559\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=405,246)

**Step 3: Select Repositories/Organizations**

Choose whether to apply the policy to:

* All current and future repositories/organizations *(default)*, or
* Select specific repositories/organizations manually

<figure><img src="https://754495266-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQJRZY4cfEeY3I7DXTOCp%2Fuploads%2FT5yhgqZiuca0Jj8Hz8IR%2FScreenshot%202025-08-21%20at%2005.06.24.png?alt=media&#x26;token=df05b03d-e5b3-4afd-916b-13b150e3d222" alt=""><figcaption><p>Select Repositories</p></figcaption></figure>

**Step 4: Save the Policy**

* After configuring all settings, click Save to create the policy.

![Click the save button](https://ajeuwbhvhr.cloudimg.io/https://colony-recorder.s3.amazonaws.com/files/2025-05-05/83faa3ac-1ad1-4d61-8a12-95ced8eee9d3/ascreenshot.jpeg?tl_px=195,859\&br_px=1724,1714\&force_format=jpeg\&q=100\&width=1120.0\&wat=1\&wat_opacity=1\&wat_gravity=northwest\&wat_url=https://colony-recorder.s3.amazonaws.com/images/watermarks/8B5CF6_standard.png\&wat_pad=524,494)

Follow this interactive demo to see how this workflow run policy works in practice:

{% embed url="<https://app.storylane.io/share/z0ld7pz9bhmn>" %}
