Enable Runtime Security (Self-hosted VM Runners)
To enable runtime security for self-hosted runners on Cloud VMs (e.g. EC2 instances), you can add the Harden-Runner agent to your runner image.
Please email us at support@stepsecurity.io for instructions on how to install the Harden-Runner agent on your runner image. This agent is different than the one used for GitHub-hosted runners.
Demo
For a demo of a workflows running on self-hosted Cloud VMs (e.g. EC2) with Harden Runner integrated, follow these links:
Network Monitoring
View this workflow file: https://github.com/step-security/github-actions-goat/blob/main/.github/workflows/self-hosted-network-monitoring-hr.yml
Notice that
harden-runner
Action is not added to this workflow, and that this workflow runs on aself-hosted
EC2 runner.Check out an example run of this workflow here: https://github.com/step-security/github-actions-goat/actions/runs/6386599320
Visit the workflow insights for this run here: https://app.stepsecurity.io/github/step-security/github-actions-goat/actions/runs/6386599320 You can see the outbound traffic for each of the steps, without the need to add
harden-runner
to each job.
Even though you do not need to add Harden-Runner Action, the insights are exactly the same as with GitHub-Hosted runner.
Network Filtering with Harden Runner
To filter traffic to specific destinations in a job run in self-hosted VM runner, you use the harden-runner
GitHub Action in block
mode.
View the workflow file: https://github.com/step-security/github-actions-goat/blob/main/.github/workflows/self-hosted-network-filtering-hr.yml
Notice that
harden-runner
Action is added and there is a list of allowed endpoints.Check out an example run of this workflow here: https://github.com/step-security/github-actions-goat/actions/runs/6386598192
Visit the workflow insights for this run here: https://app.stepsecurity.io/github/step-security/github-actions-goat/actions/runs/6386598192
You will notice that the call to
attacker.com
was blocked in this case.
File Monitoring
View this workflow file: https://github.com/step-security/github-actions-goat/blob/main/.github/workflows/self-hosted-file-monitor-with-hr.yml
Notice that
harden-runner
Action is not added to this workflow, and that this workflow runs on aself-hosted
runner.Check out an example run of this workflow here: https://github.com/step-security/github-actions-goat/actions/runs/6386649358
Visit the workflow insights for this run here: https://app.stepsecurity.io/github/step-security/github-actions-goat/actions/runs/6386649358
You can see that the file overwrite event is detected, without the need to add
harden-runner
to each job.