Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/anomalous-outbound-calls.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Anomalous Outbound Calls
on:
workflow_dispatch:

permissions:
contents: read

jobs:
unexpected-outbound-calls:
name: AnomalousOutboundCalls
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/arc-codecov-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "ARC: Network Filtering with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: self-hosted
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/arc-secure-by-default.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "ARC: Secure-By-Default Cluster-Level Policy"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
direct-ip-hosted:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/arc-solarwinds-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "ARC: File Monitoring with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
arc-solarwinds-simulation:
runs-on: self-hosted
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/arc-zero-effort-observability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "ARC: Zero-effort Observability"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: self-hosted
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/baseline_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
workflow_dispatch:
pull_request:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/block-dns-exfiltration.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Block DNS Exfiltration With Harden-Runner
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Deploy
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/changed-files-vulnerability-with-hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
pull-requests: read
contents: read

jobs:
changed_files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
pull-requests: read
contents: read

jobs:
changed_files:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hosted-file-monitor-with-hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "Hosted: File Monitoring with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hosted-file-monitor-without-hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "Hosted: File Monitoring without Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hosted-https-monitoring-hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "Hosted: HTTPS Monitoring with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hosted-network-filtering-hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "Hosted: Network Filtering with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hosted-network-monitoring-hr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "Hosted: Network Monitoring with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/hosted-network-without-hr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "Hosted: Network Monitoring without Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Puzzle
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/self-hosted-file-monitor-with-hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: "Self-Hosted (VM): File Monitoring with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: [self-hosted, ec2]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/self-hosted-network-filtering-hr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "Self-Hosted (VM): Network Filtering with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/self-hosted-network-monitoring-hr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: "Self-Hosted (VM): Network Monitoring with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/unexpected-outbound-calls.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Unexpected Outbound Calls
on:
workflow_dispatch:

permissions:
contents: read

jobs:
unexpected-outbound-calls:
name: UnexpectedOutboundCalls
Expand Down
36 changes: 36 additions & 0 deletions docs/Solutions/FixGITHUB_TOKENPermissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,39 @@ In this tutorial you will update the token permissions for workflows in this rep
6. Merge the pull request. Check the permissions for the jobs in the "Set up job" section of the workflow run log. You will notice that the permissions are set to the minimum needed.

> https://app.stepsecurity.io/securerepo has been used by over 500 public repositories to apply GitHub Actions Security best practices. You can browse pull requests for the Top 50 repositories at https://app.stepsecurity.io/securerepo/trending

## Using Fine-Grained Permissions for GitHub Tokens

To enhance security, it is important to use fine-grained permissions for GitHub tokens. This follows the principle of least privilege, ensuring that each job only has access to what it absolutely needs.

### Example

In the `.github/workflows/hosted-network-filtering-hr.yml` file, you can add `permissions: contents: read` to limit access:

```yaml
name: "Hosted: Network Filtering with Harden-Runner"
on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
www.githubstatus.com:443
- uses: crazy-max/ghaction-github-status@v4
- uses: actions/checkout@v3
- run: |
curl https://exfiltrationdemo.blob.core.windows.net/
```

By setting the minimum required permissions for the GitHub token in your workflows, you can significantly reduce the risk of accidental or malicious misuse.
Loading