Detect tampering of source code during build
Last updated
Last updated
Harden-Runner monitors file writes and detects if any source code files are overwritten during a build.
Source code overwrites are unexpected in a release build.
All source code files are monitored, including infrastructure-as-code (IaC) files such as Kubernetes manifests and Terraform configurations.
Notifications can be enabled to receive alerts when source code modifications occur.
No additional changes are needed for self-hosted runners to enable file monitoring.
Step 1: Access the Workflow Runs
Navigate to Latest Workflow Runs
under the Harden-Runner
menu in your StepSecurity dashboard. If any files were overwritten, you’ll see an alert similar to this:
Step 2: View File Write Events
Click on the workflow insights
Go to the File Write Events
tab
You’ll see a list of overwritten files, including their paths and timestamps.
Step 3: Investigate the Overwrite
Identify the file and its path.
Review the detection timestamp for when the overwrite occurred.
If unexpected, trigger a security review or rollback to a safe commit.