Skip to content

Commit cc8ab6b

Browse files
Update README (#1466)
1 parent d90de23 commit cc8ab6b

File tree

7 files changed

+51
-102
lines changed

7 files changed

+51
-102
lines changed

README.md

Lines changed: 51 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Secure GitHub Actions CI/CD workflows via automated remediations
1616
</div>
1717

1818
<p align="center">
19-
<img src="https://github.com/step-security/supply-chain-goat/blob/main/images/secure-repo.gif" alt="Secure repo screenshot" >
19+
<img src="images/secure-repo.gif" alt="Secure repo screenshot" >
2020
</p>
2121

2222
<h3>
2323
<a href="#quickstart">Quickstart</a>
2424
<span> • </span>
25-
<a href="#functionality-overview">Functionality Overview</a>
25+
<a href="#functionality-overview">Functionality</a>
2626
<span> • </span>
2727
<a href="#contributing">Contributing</a>
2828
</h3>
@@ -34,24 +34,24 @@ Secure GitHub Actions CI/CD workflows via automated remediations
3434
To secure GitHub Actions workflows using a pull request:
3535

3636
- Go to https://app.stepsecurity.io/securerepo and enter your public GitHub repository
37-
- Login using your GitHub Account (no need to install any App or grant `write` access)
38-
- View recommendations and click `Create pull request`. Here is a [sample pull request](https://github.com/Kapiche/cobertura-action/pull/60).
37+
- Log in using your GitHub Account (no need to install any App or grant `write` access)
38+
- View recommendations and click `Create pull request.` Here is an example pull request: https://github.com/electron/electron/pull/36343.
3939

4040
### Integration with OpenSSF Scorecard
4141

4242
- Add [OpenSSF Scorecards](https://github.com/ossf/scorecard-action) starter workflow
4343
- View the Scorecard results in GitHub Code Scanning UI
44-
- Follow remediation tip that points to https://app.stepsecurity.io
44+
- Follow the remediation tip that points to https://app.stepsecurity.io
4545

46-
<p align="left">
47-
<img src="https://github.com/step-security/supply-chain-goat/blob/main/images/secure-workflows/SecureWorkflowsIntegration.png" alt="Secure workflow Scorecard integration screenshot" width="60%">
46+
<p align="center">
47+
<img src="images/SecureWorkflowsIntegration.png" alt="Secure workflow Scorecard integration screenshot" width="600">
4848
</p>
4949

5050
### Self Hosted
5151

5252
To create an instance of Secure Workflows, deploy _cloudformation/ecr.yml_ and _cloudformation/resources.yml_ CloudFormation templates in your AWS account. You can take a look at _.github/workflows/release.yml_ for reference.
5353

54-
## Functionality Overview
54+
## Functionality
5555

5656
Secure Workflows
5757

@@ -64,87 +64,42 @@ Secure Workflows
6464
#### Why is this needed?
6565

6666
- The GITHUB_TOKEN is an automatically generated secret to make authenticated calls to the GitHub API
67-
- If the token is compromised, it can be abused to compromise your environment (e.g. to overwrite releases or source code). This will also impact everyone who use your software in their software supply chain.
67+
- If the token is compromised, it can be abused to compromise your environment (e.g., to overwrite releases or source code). This compromise will also impact everyone using your software in their supply chain.
6868
- To limit the damage, [GitHub recommends setting minimum token permissions for the GITHUB_TOKEN](https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/).
6969

7070
#### Before and After the fix
7171

72-
Before the fix, your workflow may look like this (no permissions set)
73-
74-
```yaml
75-
jobs:
76-
closeissue:
77-
runs-on: ubuntu-latest
78-
79-
steps:
80-
- name: Close Issue
81-
uses: peter-evans/close-issue@v1
82-
with:
83-
issue-number: 1
84-
comment: Auto-closing issue
85-
```
86-
87-
After the fix, the workflow will have minimum permissions added for the GITHUB token.
88-
89-
```yaml
90-
permissions:
91-
contents: read
92-
93-
jobs:
94-
closeissue:
95-
permissions:
96-
issues: write # for peter-evans/close-issue to close issues
97-
runs-on: ubuntu-latest
98-
99-
steps:
100-
- name: Close Issue
101-
uses: peter-evans/close-issue@v1
102-
with:
103-
issue-number: 1
104-
comment: Auto-closing issue
105-
```
72+
**Pull request example**: https://github.com/nginxinc/kubernetes-ingress/pull/3134
73+
74+
In this pull request, minimum permissions are set automatically for the GITHUB_TOKEN
75+
76+
<p align="center"><img src="images/token-perm-example.png" alt="Screenshot of token permissions set in a workflow" width="600" /></p>
10677

10778
#### How does SecureWorkflows fix this issue?
10879

10980
- SecureWorkflows stores the permissions needed by different GitHub Actions in a [knowledge base](<(https://github.com/step-security/secure-workflows/tree/main/knowledge-base/actions)>)
110-
- It looks up the permissions needed by each Action in your workflow, and sums the permissions up to come up with a final recommendation
81+
- It looks up the permissions needed by each Action in your workflow and sums the permissions up to come up with a final recommendation
11182
- If you are the owner of a GitHub Action, please [contribute to the knowledge base](https://github.com/step-security/secure-workflows/blob/main/knowledge-base/actions/README.md)
11283

11384
### 2. Pin Actions to a full length commit SHA
11485

11586
#### Why is this needed?
11687

117-
- GitHub Action tags and Docker tags are mutatble. This poses a security risk
88+
- GitHub Action tags and Docker tags are mutable, which poses a security risk
11889
- If the tag changes you will not have a chance to review the change before it gets used
11990
- GitHub's Security Hardening for GitHub Actions guide [recommends pinning actions to full length commit for third party actions](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions).
12091

12192
#### Before and After the fix
12293

12394
Before the fix, your workflow may look like this (use of `v1` and `latest` tags)
12495

125-
```yaml
126-
jobs:
127-
integration-test:
128-
runs-on: ubuntu-latest
129-
steps:
130-
- name: Checkout
131-
uses: actions/checkout@v1
132-
- name: Integration test
133-
uses: docker://ghcr.io/step-security/integration-test/int:latest
134-
```
135-
136-
After the fix, each Action and docker image will be pinned to an immutable checksum.
137-
138-
```yaml
139-
jobs:
140-
integration-test:
141-
runs-on: ubuntu-latest
142-
steps:
143-
- name: Checkout
144-
uses: actions/checkout@544eadc6bf3d226fd7a7a9f0dc5b5bf7ca0675b9
145-
- name: Integration test
146-
uses: docker://ghcr.io/step-security/integration-test/int@sha256:1efef3bbdd297d1b321b9b4559092d3131961913bc68b7c92b681b4783d563f0
147-
```
96+
After the fix, SecureWorkflows pins each Action and docker image to an immutable checksum.
97+
98+
**Pull request example**: https://github.com/electron/electron/pull/36343
99+
100+
In this pull request, the workflow file has the GitHub Actions tags pinned automatically to their full-length commit SHA.
101+
102+
<p align="center"><img src="images/pin-example.png" alt="Screenshot of Action pinned to commit SHA" width="600" /></p>
148103

149104
#### How does SecureWorkflows fix this issue?
150105

@@ -159,45 +114,39 @@ jobs:
159114

160115
#### Before and After the fix
161116

162-
Before the fix, your workflow may look like this
163-
164-
```yaml
165-
jobs:
166-
closeissue:
167-
runs-on: ubuntu-latest
168-
169-
steps:
170-
- name: Close Issue
171-
uses: peter-evans/close-issue@v1
172-
with:
173-
issue-number: 1
174-
comment: Auto-closing issue
175-
```
176-
177-
After the fix, each workflow has the harden-runner Action added as the first step.
178-
179-
```yaml
180-
jobs:
181-
closeissue:
182-
runs-on: ubuntu-latest
183-
184-
steps:
185-
- name: Harden Runner
186-
uses: step-security/harden-runner@v2
187-
with:
188-
egress-policy: audit
189-
190-
- name: Close Issue
191-
uses: peter-evans/close-issue@v1
192-
with:
193-
issue-number: 1
194-
comment: Auto-closing issue
195-
```
117+
**Pull request example**: https://github.com/python-attrs/attrs/pull/1034
118+
119+
This pull request adds the Harden Runner GitHub Action to the workflow file.
120+
121+
<p align="center"><img src="images/harden-runner-example.png" width="600" alt="Screenshot of Harden-Runner GitHub Action added to a workflow" /></p>
196122

197123
#### How does SecureWorkflows fix this issue?
198124

199125
SecureWorkflows updates the YAML file and adds [Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) as the first step to each job.
200126

127+
### 4. Add or update Dependabot configuration
128+
129+
#### Why is this needed?
130+
131+
- You enable Dependabot version updates by checking a `dependabot.yml` configuration file into your repository
132+
- Dependabot ensures that your repository automatically keeps up with the latest releases of the packages and applications it depends on
133+
134+
#### Before and After the fix
135+
136+
Before the fix, you might not have a `dependabot.yml` file or it might not cover all ecosystems used in your project.
137+
138+
After the fix, the `dependabot.yml` file is added or updated with configuration for all package ecosystems used in your project.
139+
140+
**Pull request example**: https://github.com/muir/libschema/pull/31
141+
142+
This pull request updates the Dependabot configuration.
143+
144+
<p align="center"><img src="images/dependabot-example.png" width="600" alt="Screenshot of Dependabot config updated" /></p>
145+
146+
#### How does SecureWorkflows fix this issue?
147+
148+
SecureWorkflows 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.
149+
201150
## Contributing
202151

203152
Contributions are welcome!

images/SecureWorkflowsIntegration.png

104 KB
Loading

images/dependabot-example.png

42.5 KB
Loading

images/harden-runner-example.png

59.2 KB
Loading

images/pin-example.png

88.7 KB
Loading

images/secure-repo.gif

2.76 MB
Loading

images/token-perm-example.png

67.3 KB
Loading

0 commit comments

Comments
 (0)