Skip to content

Commit ab21626

Browse files
Update README (#1981)
1 parent 77dcaa8 commit ab21626

File tree

2 files changed

+83
-13
lines changed

2 files changed

+83
-13
lines changed

README.md

Lines changed: 83 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,13 @@ To create an instance of Secure Workflows, deploy _cloudformation/ecr.yml_ and _
5252
## Functionality
5353

5454
1. [Automatically set minimum GITHUB_TOKEN permissions](#1-automatically-set-minimum-github_token-permissions)
55-
2. [Pin Actions to a full length commit SHA](#2-pin-actions-to-a-full-length-commit-sha)
56-
3. [Add Harden-Runner GitHub Action to each job](#3-add-harden-runner-github-action-to-each-job)
57-
4. [Add or update Dependabot configuration](#4-add-or-update-dependabot-configuration)
58-
5. [Add CodeQL workflow (SAST)](#5-add-codeql-workflow-sast)
55+
2. [Add Harden-Runner GitHub Action to each job](#2-add-harden-runner-github-action-to-each-job)
56+
3. [Pin Actions to a full length commit SHA](#3-pin-actions-to-a-full-length-commit-sha)
57+
4. [Pin image tags to digests in Dockerfiles](#4-pin-image-tags-to-digests-in-dockerfiles)
58+
5. [Add or update Dependabot configuration](#5-add-or-update-dependabot-configuration)
59+
6. [Add CodeQL workflow (SAST)](#6-add-codeql-workflow-sast)
60+
7. [Add Dependency review workflow](#7-add-dependency-review-workflow)
61+
8. [Add OpenSSF Scorecard workflow](#8-add-openssf-scorecard-workflow)
5962

6063
### 1. Automatically set minimum GITHUB_TOKEN permissions
6164

@@ -79,7 +82,25 @@ In this pull request, minimum permissions are set automatically for the GITHUB_T
7982
- It looks up the permissions needed by each Action in your workflow and sums the permissions up to come up with a final recommendation
8083
- If you are the owner of a GitHub Action, please [contribute to the knowledge base](https://github.com/step-security/secure-repo/blob/main/knowledge-base/actions/README.md)
8184

82-
### 2. Pin Actions to a full length commit SHA
85+
### 2. Add Harden-Runner GitHub Action to each job
86+
87+
#### Why is this needed?
88+
89+
[Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) installs a security agent on the Github-hosted runner to prevent exfiltration of credentials, monitor the build process, and detect compromised dependencies.
90+
91+
#### Before and After the fix
92+
93+
**Pull request example**: https://github.com/python-attrs/attrs/pull/1034
94+
95+
This pull request adds the Harden Runner GitHub Action to the workflow file.
96+
97+
<p align="center"><img src="images/harden-runner-example.png" width="600" alt="Screenshot of Harden-Runner GitHub Action added to a workflow" /></p>
98+
99+
#### How does Secure-Repo fix this issue?
100+
101+
Secure-Repo updates the YAML file and adds [Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) as the first step to each job.
102+
103+
### 3. Pin Actions to a full length commit SHA
83104

84105
#### Why is this needed?
85106

@@ -104,25 +125,32 @@ In this pull request, the workflow file has the GitHub Actions tags pinned autom
104125
- Secure-Repo automates the process of getting the commit SHA for each mutable Action version or Docker image tag
105126
- It does this by using GitHub and Docker registry APIs
106127

107-
### 3. Add Harden-Runner GitHub Action to each job
128+
### 4. Pin image tags to digests in Dockerfiles
108129

109130
#### Why is this needed?
110131

111-
[Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) installs a security agent on the Github-hosted runner to prevent exfiltration of credentials, monitor the build process, and detect compromised dependencies.
132+
- Docker tags are mutable, so use digests in place of tags when pulling images
133+
- If the tag changes you will not have a chance to review the change before it gets used
134+
- OpenSSF Scorecard [recommends pinning image tags for Dockerfiles used in building and releasing your project](https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies).
112135

113136
#### Before and After the fix
114137

115-
**Pull request example**: https://github.com/python-attrs/attrs/pull/1034
138+
Before the fix, your Dockerfile uses image:tag, e.g. `rust:latest`
116139

117-
This pull request adds the Harden Runner GitHub Action to the workflow file.
140+
After the fix, Secure-Repo pins each docker image to an immutable checksum, e.g. `rust:latest@sha256:02a53e734724bef4a58d856c694f826aa9e7ea84353516b76d9a6d241e9da60e`.
118141

119-
<p align="center"><img src="images/harden-runner-example.png" width="600" alt="Screenshot of Harden-Runner GitHub Action added to a workflow" /></p>
142+
**Pull request example**: https://github.com/fleetdm/fleet/pull/10205
143+
144+
In this pull request, the Docker file has tags pinned automatically to their checksum.
145+
146+
<p align="center"><img src="images/pin-docker-example.png" alt="Screenshot of docker image pinned to checksum" width="600" /></p>
120147

121148
#### How does Secure-Repo fix this issue?
122149

123-
Secure-Repo updates the YAML file and adds [Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) as the first step to each job.
150+
- Secure-Repo automates the process of getting the checksum for each Docker image tag
151+
- It does this by using Docker registry APIs
124152

125-
### 4. Add or update Dependabot configuration
153+
### 5. Add or update Dependabot configuration
126154

127155
#### Why is this needed?
128156

@@ -145,7 +173,7 @@ This pull request updates the Dependabot configuration.
145173

146174
Secure-Repo updates the `dependabot.yml` file to add missing ecosystems. For example, if the Dependabot configuration updates npm packages but not GitHub Actions, it is updated to add the GitHub Actions ecosystem.
147175

148-
### 5. Add CodeQL workflow (SAST)
176+
### 6. Add CodeQL workflow (SAST)
149177

150178
#### Why is this needed?
151179

@@ -165,6 +193,48 @@ This pull request adds CodeQL to the list of workflows.
165193

166194
Secure-Repo has a [workflow-templates](https://github.com/step-security/secure-repo/tree/main/workflow-templates) folder. This folder has the default CodeQL workflow, which gets added as part of the pull request. The placeholder for languages in the template gets replaced with languages for your GitHub repository.
167195

196+
### 7. Add Dependency review workflow
197+
198+
#### Why is this needed?
199+
200+
- The Dependency review workflow scans for vulnerable versions of dependencies introduced by package version changes in pull requests, and warns you about the associated security vulnerabilities.
201+
- This gives you better visibility of what's changing in a pull request, and helps prevent vulnerabilities being added to your repository.
202+
203+
#### Before and After the fix
204+
205+
Before the fix, you do not have a dependency review workflow.
206+
207+
After the fix, a `depdendency-review.yml` GitHub Actions workflow gets added to your project.
208+
209+
**Pull request example**: https://github.com/input-output-hk/catalyst-core/pull/286
210+
211+
This pull request adds GitHub's `actions/dependency-review-action` workflow to the list of workflows.
212+
213+
#### How does Secure-Repo fix this issue?
214+
215+
Secure-Repo has a [workflow-templates](https://github.com/step-security/secure-repo/tree/main/workflow-templates) folder. This folder has the default dependency review workflow, which gets added as part of the pull request.
216+
217+
### 8. Add OpenSSF Scorecard workflow
218+
219+
#### Why is this needed?
220+
221+
- OpenSSF Scorecard is an automated tool that assesses a number of important heuristics ("checks") associated with software security and assigns each check a score of 0-10.
222+
- You can use these scores to understand specific areas to improve in order to strengthen the security posture of your project.
223+
224+
#### Before and After the fix
225+
226+
Before the fix, you do not have a OpenSSF Scorecard workflow.
227+
228+
After the fix, a `scorecards.yml` GitHub Actions workflow gets added to your project.
229+
230+
**Pull request example**: https://github.com/mcornick/clilol/pull/14
231+
232+
This pull request adds OpenSSF Scorecard to the list of workflows.
233+
234+
#### How does Secure-Repo fix this issue?
235+
236+
Secure-Repo has a [workflow-templates](https://github.com/step-security/secure-repo/tree/main/workflow-templates) folder. This folder has the default Scorecard workflow, which gets added as part of the pull request.
237+
168238
## Contributing
169239

170240
Contributions are welcome!

images/pin-docker-example.png

87.3 KB
Loading

0 commit comments

Comments
 (0)