Skip to content

Commit 41dde5d

Browse files
authored
Merge pull request #6 from zeroconfigio/feat/enterprise-hardening-s6-provenance
feat: add dependabot, security policy, and release attestation
2 parents c2b070a + f27ae4e commit 41dde5d

5 files changed

Lines changed: 143 additions & 0 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

‎.github/workflows/release.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: MIT
2+
#
3+
# On a version tag push, archives the tagged tree and attests it via
4+
# actions/attest-build-provenance, then creates a GitHub Release with the
5+
# archive attached. This repo has no compiled artifact or container image,
6+
# so the attestation covers "this tarball of the tagged tree came from this
7+
# workflow run in this repo", not a full build-provenance chain the way it
8+
# would for a compiled binary. A real but thinner guarantee, stated plainly
9+
# rather than oversold.
10+
11+
name: release
12+
13+
on:
14+
push:
15+
tags:
16+
- "v*"
17+
18+
permissions: {}
19+
20+
jobs:
21+
release:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
id-token: write
26+
attestations: write
27+
steps:
28+
# No `with:` overrides needed: actions/checkout fetches the exact
29+
# ref/SHA that triggered the workflow by default (a single commit,
30+
# fetch-depth: 1). On a `push: tags:` trigger that ref is
31+
# refs/tags/<tag>, and checkout's refspec logic fetches that tag ref
32+
# locally by name in this case, so it is already resolvable for the
33+
# `git archive` step below without fetch-depth: 0 or fetch-tags: true.
34+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35+
36+
- name: Archive tagged tree
37+
run: git archive --format=tar.gz -o "$RUNNER_TEMP/release.tar.gz" "$GITHUB_REF_NAME"
38+
39+
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
40+
with:
41+
subject-path: ${{ runner.temp }}/release.tar.gz
42+
43+
- name: Create GitHub Release
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: gh release create "$GITHUB_REF_NAME" "$RUNNER_TEMP/release.tar.gz" --generate-notes

‎CHANGELOG.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,30 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
3333
carrying a `drift-detection` label when `has-changes == 'true'`, instead
3434
of filing a new Issue every run. See the README's "Drift detection"
3535
section.
36+
- `.github/dependabot.yml`: weekly `github-actions` update checks,
37+
covering every pinned SHA in `action.yml` and the workflow files.
38+
- `SECURITY.md`: documents the SHA-pinning verification practice and
39+
points to GitHub's private vulnerability reporting as the disclosure
40+
channel.
41+
- `.github/workflows/release.yml`: on a `v*` tag push, archives the
42+
tagged tree and attests it with `actions/attest-build-provenance`,
43+
then creates a GitHub Release from that archive. See the README's
44+
"Supply chain" section for exactly what the attestation does and does
45+
not prove.
46+
- README "Supply chain" section: Dependabot cadence, the `SECURITY.md`
47+
link, the release attestation's scope and limits, and a manual
48+
follow-up note to enable tag protection on `v*` once `v1` is tagged.
49+
50+
### Notes
51+
52+
- `v1` hasn't been tagged yet. Before it is, a few things still need a
53+
real, live run rather than a static check: a plan/apply against a real
54+
R2 bucket and a real S3 bucket, a `policy-command` failure proven to
55+
block a real `apply` (not just a step that reports failure), and a
56+
real tag push exercised through `release.yml` end to end. Once `v1`
57+
exists, tag protection on `v*` also needs to be enabled by hand in the
58+
repo's Settings, see the README's "Supply chain" section.
59+
- Private vulnerability reporting (Settings -> Security -> Private
60+
vulnerability reporting) needs enabling by hand too. `SECURITY.md`
61+
documents it as the disclosure channel, but the toggle isn't on by
62+
default, so it needs confirming before that channel actually exists.

‎README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,30 @@ only issues carrying that label for its marker before deciding whether to
246246
`PATCH` an existing Issue or `POST` a new one, so the search stays bounded
247247
instead of scanning every open issue in the repo.
248248

249+
## Supply chain
250+
251+
`.github/dependabot.yml` watches every pinned `github-actions` SHA, in
252+
`action.yml` and in the workflow files, on a weekly schedule, and opens a
253+
PR when a pin goes stale.
254+
255+
See [`SECURITY.md`](SECURITY.md) for how to verify a pin yourself and
256+
where to report a vulnerability, this README doesn't repeat that here.
257+
258+
On a `v*` tag push, `.github/workflows/release.yml` archives the tagged
259+
tree and attests it with `actions/attest-build-provenance`. The
260+
attestation proves one specific thing: a tarball of the tagged tree was
261+
produced by that workflow, in this repo, for that tag. It's not a full
262+
build-provenance chain for a compiled artifact, this project doesn't
263+
produce one, there's no compiled binary or container image for a chain
264+
like that to cover. A real guarantee, a narrower one than the phrase
265+
"build provenance" might suggest by itself.
266+
267+
**Manual follow-up, not something any workflow configures:** once `v1`
268+
is tagged, enable tag protection on `v*` in the repo's Settings
269+
(Rulesets, or branch/tag protection). Without it, the tag could be
270+
silently repointed at different code later, and nothing in this repo's
271+
workflows would catch that.
272+
249273
## Inputs
250274

251275
| Input | Required | Default | Description |

‎SECURITY.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Security Policy
2+
3+
## Action pinning
4+
5+
Every third-party action this repo uses, in `action.yml` and in the
6+
workflow and example files, is pinned to a full commit SHA with a
7+
version-tag comment next to it, for example:
8+
9+
```yaml
10+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
11+
```
12+
13+
The comment is a label for humans. The SHA is what actually runs. A
14+
mutable tag like `@v7` can be moved to point at different code later,
15+
a pinned SHA can't.
16+
17+
You don't have to take the tag-to-SHA mapping on faith. Check it
18+
yourself:
19+
20+
```bash
21+
git ls-remote --tags https://github.com/actions/checkout
22+
```
23+
24+
Find the tag named in the comment (`v7.0.1` in the example above) and
25+
confirm its commit matches the SHA pinned in the `uses:` line. If they
26+
don't match, treat it as a problem and open an issue.
27+
28+
## Reporting a vulnerability
29+
30+
Report vulnerabilities through GitHub's private vulnerability
31+
reporting for this repo: go to the repo's **Security** tab, then
32+
**Report a vulnerability**. This sends the report privately to the
33+
maintainers instead of a public issue, and keeps the conversation in
34+
one place.
35+
36+
## Supported versions
37+
38+
This is a GitHub Action, not a versioned library with a support
39+
matrix. Only the latest tagged release gets security fixes. Update
40+
your pin to the newest tag when a fix ships.

0 commit comments

Comments
 (0)