Compare commits
83 Commits
predicate@
...
v2.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbfd0027ae | ||
|
|
7ab83002c8 | ||
|
|
e4d3fb6c73 | ||
|
|
34581d8068 | ||
|
|
1455967b1b | ||
|
|
1763edca48 | ||
|
|
07be22cf65 | ||
|
|
75bd09c86f | ||
|
|
828437ffc4 | ||
|
|
b0ec042eff | ||
|
|
635d710917 | ||
|
|
6fc7229e7e | ||
|
|
8d422c6606 | ||
|
|
79cd71eb23 | ||
|
|
ac09fe97a4 | ||
|
|
386c403ae8 | ||
|
|
21fa38ed7b | ||
|
|
0730e3bc2d | ||
|
|
c82b553566 | ||
|
|
99fb7ccb42 | ||
|
|
55c18addeb | ||
|
|
5026d36637 | ||
|
|
dc92b4c0be | ||
|
|
dd4b089aa5 | ||
|
|
fa5285f58e | ||
|
|
bd470e0ef8 | ||
|
|
0d076ca0ac | ||
|
|
79af85adb2 | ||
|
|
9e75edd833 | ||
|
|
f19ab44411 | ||
|
|
8507f05fe1 | ||
|
|
25b3c0884a | ||
|
|
b5fe8a6c40 | ||
|
|
47c91cee86 | ||
|
|
6d7733f629 | ||
|
|
adc5c62972 | ||
|
|
8541e845e0 | ||
|
|
bfc4aecb6d | ||
|
|
3d6693daad | ||
|
|
8a2267cfa7 | ||
|
|
9acafbf4c3 | ||
|
|
91d05efbc3 | ||
|
|
ab8de8941e | ||
|
|
c43b2b4d84 | ||
|
|
fe4a732a3e | ||
|
|
ba663bc478 | ||
|
|
49e7311f18 | ||
|
|
cb316d67b7 | ||
|
|
4696efab19 | ||
|
|
dcbe3081a3 | ||
|
|
aaa2d0a82e | ||
|
|
dc3e3b331e | ||
|
|
c29e4e9225 | ||
|
|
798ee587a2 | ||
|
|
7d87da1e33 | ||
|
|
e318c7dfea | ||
|
|
614575ea4f | ||
|
|
d00b213255 | ||
|
|
f975621746 | ||
|
|
5297f161fa | ||
|
|
10c27177cd | ||
|
|
c80e3ed30c | ||
|
|
c168f2354d | ||
|
|
5448b22ebd | ||
|
|
b125530ffd | ||
|
|
534423496e | ||
|
|
2f5f68fcc3 | ||
|
|
36d21cdc72 | ||
|
|
38c481ec87 | ||
|
|
d9763b28c9 | ||
|
|
1afe01eb23 | ||
|
|
a624c741b8 | ||
|
|
d4f0c27f8d | ||
|
|
ab147f15c3 | ||
|
|
41d694c98d | ||
|
|
0b5415aa25 | ||
|
|
817d650747 | ||
|
|
5d89d51206 | ||
|
|
f8e0f3ab00 | ||
|
|
e37c92d3ba | ||
|
|
d023f128e6 | ||
|
|
48e5743928 | ||
|
|
05284cc010 |
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@@ -9,6 +9,8 @@ updates:
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
ignore:
|
||||
- dependency-name: 'actions/attest-sbom'
|
||||
|
||||
- package-ecosystem: npm
|
||||
directory: /
|
||||
|
||||
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
@@ -46,11 +46,12 @@ jobs:
|
||||
id: npm-ci-test
|
||||
run: npm run ci-test
|
||||
|
||||
test-attest-sbom-with-local-sbom-file:
|
||||
name: Test attest-sbom action with local sbom file
|
||||
test-attest-sbom:
|
||||
name: Test attest-sbom action with local sbom file
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
attestations: write
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
@@ -69,31 +70,3 @@ jobs:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Dump output
|
||||
run: jq < ${{ steps.attest-sbom.outputs.bundle-path }}
|
||||
test-attest-sbom:
|
||||
name: Test attest-sbom action
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
id: checkout
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Run attest-sbom with spdx format
|
||||
uses: ./
|
||||
with:
|
||||
subject-digest: 'sha256:7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32'
|
||||
subject-name: 'subject'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
sbom-format: 'spdx'
|
||||
- name: Run attest-sbom with cyclonedx format
|
||||
id: attest-sbom
|
||||
uses: ./
|
||||
env:
|
||||
INPUT_PRIVATE-SIGNING: 'true'
|
||||
with:
|
||||
subject-digest: 'sha256:7d070f6b64d9bcc530fe99cc21eaaa4b3c364e0b2d367d7735671fa202a03b32'
|
||||
subject-name: 'subject'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
sbom-format: 'cyclonedx'
|
||||
|
||||
5
.github/workflows/linter.yml
vendored
5
.github/workflows/linter.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
|
||||
- name: Lint Codebase
|
||||
id: super-linter
|
||||
uses: super-linter/super-linter/slim@v6
|
||||
uses: super-linter/super-linter/slim@v7
|
||||
env:
|
||||
DEFAULT_BRANCH: main
|
||||
FILTER_REGEX_EXCLUDE: dist/**/*
|
||||
@@ -46,4 +46,5 @@ jobs:
|
||||
TYPESCRIPT_DEFAULT_STYLE: prettier
|
||||
VALIDATE_ALL_CODEBASE: true
|
||||
VALIDATE_JAVASCRIPT_STANDARD: false
|
||||
VALIDATE_JSCPD: false
|
||||
VALIDATE_TYPESCRIPT_STANDARD: false
|
||||
VALIDATE_JSCPD: false
|
||||
|
||||
22
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
22
.github/workflows/publish-immutable-actions.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: 'Publish Immutable Action Version'
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v4
|
||||
- name: Publish
|
||||
id: publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
139
README.md
139
README.md
@@ -5,9 +5,8 @@ the [@actions/attest][1] package.
|
||||
|
||||
Attestations bind some subject (a named artifact along with its digest) to a a
|
||||
Software Bill of Materials (SBOM) using the [in-toto][2] format. The action
|
||||
accepts SBOMs which have been generated by external tools or can generate one
|
||||
automatically by invoking the [anchore/sbom-action][3]. Externally generated
|
||||
SBOMs must be in either the [SPDX][4] or [CycloneDX][5] JSON-serialized format.
|
||||
accepts SBOMs which have been generated by external tools. Provided SBOMs must
|
||||
be in either the [SPDX][4] or [CycloneDX][5] JSON-serialized format.
|
||||
|
||||
A verifiable signature is generated for the attestation using a short-lived
|
||||
[Sigstore][6]-issued signing certificate. If the repository initiating the
|
||||
@@ -19,9 +18,22 @@ Once the attestation has been created and signed, it will be uploaded to the GH
|
||||
attestations API and associated with the repository from which the workflow was
|
||||
initiated.
|
||||
|
||||
Attestations can be verified using the `attestation` command in the [GitHub
|
||||
Attestations can be verified using the [`attestation` command in the GitHub
|
||||
CLI][7].
|
||||
|
||||
See [Using artifact attestations to establish provenance for builds][11] for
|
||||
more information on artifact attestations.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
> [!NOTE]
|
||||
> Artifact attestations are available in public repositories for all
|
||||
> current GitHub plans. They are not available on legacy plans, such as Bronze,
|
||||
> Silver, or Gold. If you are on a GitHub Free, GitHub Pro, or GitHub Team plan,
|
||||
> artifact attestations are only available for public repositories. To use
|
||||
> artifact attestations in private or internal repositories, you must be on a
|
||||
> GitHub Enterprise Cloud plan.
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Usage
|
||||
|
||||
Within the GitHub Actions workflow which builds some artifact you would like to
|
||||
@@ -32,38 +44,40 @@ attest:
|
||||
```yaml
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write # TODO: Update this
|
||||
attestations: write
|
||||
```
|
||||
|
||||
The `id-token` permission gives the action the ability to mint the OIDC token
|
||||
necessary to request a Sigstore signing certificate. The `contents`
|
||||
necessary to request a Sigstore signing certificate. The `attestations`
|
||||
permission is necessary to persist the attestation.
|
||||
|
||||
1. Add the following to your workflow after your artifact has been built:
|
||||
1. Add the following to your workflow after your artifact has been built and
|
||||
your SBOM has been generated:
|
||||
|
||||
```yaml
|
||||
- uses: actions/attest-sbom@v1
|
||||
- uses: actions/attest-sbom@v2
|
||||
with:
|
||||
subject-path: '<PATH TO ARTIFACT>'
|
||||
sbom-path: '<PATH TO SBOM>'
|
||||
```
|
||||
|
||||
The `subject-path` parameter should identity the artifact for which you want
|
||||
to generate an SBOM attestation. When no other inputs are specified, the
|
||||
action will automatically generate an SPDX SBOM by scanning the
|
||||
`github.workspace` directory.
|
||||
The `subject-path` parameter should identify the artifact for which you want
|
||||
to generate an SBOM attestation. The `sbom-path` parameter should identify
|
||||
the SBOM document to be associated with the subject.
|
||||
|
||||
### Inputs
|
||||
|
||||
See [action.yml](action.yml)
|
||||
|
||||
```yaml
|
||||
- uses: actions/attest@v1
|
||||
- uses: actions/attest-sbom@v2
|
||||
with:
|
||||
# Path to the artifact serving as the subject of the attestation. Must
|
||||
# specify exactly one of "subject-path" or "subject-digest".
|
||||
# specify exactly one of "subject-path" or "subject-digest". May contain a
|
||||
# glob pattern or list of paths (total subject count cannot exceed 1024).
|
||||
subject-path:
|
||||
|
||||
# SHA256 digest of the subject for for the attestation. Must be in the form
|
||||
# SHA256 digest of the subject for the attestation. Must be in the form
|
||||
# "sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one
|
||||
# of "subject-path" or "subject-digest".
|
||||
subject-digest:
|
||||
@@ -73,24 +87,19 @@ See [action.yml](action.yml)
|
||||
# path.
|
||||
subject-name:
|
||||
|
||||
# Path to the JSON-formatted SBOM file to attest. When specified, the
|
||||
# "scan-path" and "sbom-format" inputs are ignored.
|
||||
# Path to the JSON-formatted SBOM file to attest. File size cannot exceed
|
||||
# 16MB.
|
||||
sbom-path:
|
||||
|
||||
# Path on the filesystem to scan for SBOM generation. Ignored if "sbom-path"
|
||||
# is specified. Defaults to ${{ github.workspace }}
|
||||
scan-path:
|
||||
|
||||
# Format to use for the generated SBOM output. Supported formats are
|
||||
# "spdx" and "cyclonedx". Ignored if "sbom-path" is specified. Defaults to
|
||||
# "spdx".
|
||||
sbom-format:
|
||||
|
||||
# Whether to push the attestation to the image registry. Requires that the
|
||||
# "subject-name" parameter specify the fully-qualified image name and that
|
||||
# the "subject-digest" parameter be specified. Defaults to false.
|
||||
push-to-registry:
|
||||
|
||||
# Whether to attach a list of generated attestations to the workflow run
|
||||
# summary page. Defaults to true.
|
||||
show-summary:
|
||||
|
||||
# The GitHub token used to make authenticated API requests. Default is
|
||||
# ${{ github.token }}
|
||||
github-token:
|
||||
@@ -100,17 +109,28 @@ See [action.yml](action.yml)
|
||||
|
||||
<!-- markdownlint-disable MD013 -->
|
||||
|
||||
| Name | Description | Example |
|
||||
| ------------- | -------------------------------------------------------------- | ----------------------- |
|
||||
| `bundle-path` | Absolute path to the file containing the generated attestation | `/tmp/attestaion.jsonl` |
|
||||
| Name | Description | Example |
|
||||
| ----------------- | -------------------------------------------------------------- | ------------------------------------------------ |
|
||||
| `attestation-id` | GitHub ID for the attestation | `123456` |
|
||||
| `attestation-url` | URL for the attestation summary | `https://github.com/foo/bar/attestations/123456` |
|
||||
| `bundle-path` | Absolute path to the file containing the generated attestation | `/tmp/attestation.json` |
|
||||
|
||||
<!-- markdownlint-enable MD013 -->
|
||||
|
||||
Attestations are saved in the JSON-serialized [Sigstore bundle][8] format.
|
||||
|
||||
If multiple subjects are being attested at the same time, each attestation will
|
||||
be written to the output file on a separate line (using the [JSON Lines][9]
|
||||
format).
|
||||
If multiple subjects are being attested at the same time, a single attestation
|
||||
will be created with references to each of the supplied subjects.
|
||||
|
||||
## Attestation Limits
|
||||
|
||||
### Subject Limits
|
||||
|
||||
No more than 1024 subjects can be attested at the same time.
|
||||
|
||||
### SBOM Limits
|
||||
|
||||
The SBOM supplied via the `sbom-path` input cannot exceed 16MB.
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -128,9 +148,11 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
contents: read
|
||||
attestations: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -138,21 +160,24 @@ jobs:
|
||||
- name: Build artifact
|
||||
run: make my-app
|
||||
- name: Generate SBOM
|
||||
run: make sbom
|
||||
uses: anchore/sbom-action@v0
|
||||
with:
|
||||
format: 'spdx-json'
|
||||
output-file: 'sbom.spdx.json'
|
||||
- name: Attest
|
||||
uses: actions/attest-sbom@v1
|
||||
uses: actions/attest-sbom@v2
|
||||
with:
|
||||
subject-path: '${{ github.workspace }}/my-app'
|
||||
sbom-path: '${{ github.workspace }}/my-app.sbom.spdx.json'
|
||||
sbom-path: 'sbom.spdx.json'
|
||||
```
|
||||
|
||||
### Identify Subjects by Wildcard
|
||||
### Identify Multiple Subjects
|
||||
|
||||
If you are generating multiple artifacts, you can generate an attestation for
|
||||
each by using a wildcard in the `subject-path` input.
|
||||
If you are generating multiple artifacts, you can attest all of them at the same
|
||||
time by using a wildcard in the `subject-path` input.
|
||||
|
||||
```yaml
|
||||
- uses: actions/attest-sbom@v1
|
||||
- uses: actions/attest-sbom@v2
|
||||
with:
|
||||
subject-path: 'dist/**/my-bin-*'
|
||||
sbom-path: '${{ github.workspace }}/my-bin.sbom.spdx.json'
|
||||
@@ -161,6 +186,23 @@ each by using a wildcard in the `subject-path` input.
|
||||
For supported wildcards along with behavior and documentation, see
|
||||
[@actions/glob][10] which is used internally to search for files.
|
||||
|
||||
Alternatively, you can explicitly list multiple subjects with either a comma or
|
||||
newline delimited list:
|
||||
|
||||
```yaml
|
||||
- uses: actions/attest-sbom@v2
|
||||
with:
|
||||
subject-path: 'dist/foo, dist/bar'
|
||||
```
|
||||
|
||||
```yaml
|
||||
- uses: actions/attest-sbom@v2
|
||||
with:
|
||||
subject-path: |
|
||||
dist/foo
|
||||
dist/bar
|
||||
```
|
||||
|
||||
### Container Image
|
||||
|
||||
When working with container images you can invoke the action with the
|
||||
@@ -188,7 +230,8 @@ jobs:
|
||||
permissions:
|
||||
id-token: write
|
||||
packages: write
|
||||
contents: write
|
||||
contents: read
|
||||
attestations: write
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
@@ -210,9 +253,13 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
- name: Generate SBOM
|
||||
run: make sbom
|
||||
uses: anchore/sbom-action@v0
|
||||
with:
|
||||
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
format: 'cyclonedx-json'
|
||||
output-file: 'sbom.cyclonedx.json'
|
||||
- name: Attest
|
||||
uses: actions/attest-sbom@v1
|
||||
uses: actions/attest-sbom@v2
|
||||
id: attest
|
||||
with:
|
||||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
@@ -223,12 +270,12 @@ jobs:
|
||||
|
||||
[1]: https://github.com/actions/toolkit/tree/main/packages/attest
|
||||
[2]: https://github.com/in-toto/attestation/tree/main/spec/v1
|
||||
[3]: https://github.com/anchore/sbom-action
|
||||
[4]: https://spdx.dev/
|
||||
[5]: https://cyclonedx.org/
|
||||
[6]: https://www.sigstore.dev/
|
||||
[7]: https://cli.github.com/
|
||||
[7]: https://cli.github.com/manual/gh_attestation_verify
|
||||
[8]:
|
||||
https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto
|
||||
[9]: https://jsonlines.org/
|
||||
[10]: https://github.com/actions/toolkit/tree/main/packages/glob#patterns
|
||||
[11]:
|
||||
https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
|
||||
|
||||
37
RELEASE.md
Normal file
37
RELEASE.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Release Instructions
|
||||
|
||||
Follow the steps below to tag a new release for the `actions/attest-sbom`
|
||||
action.
|
||||
|
||||
If changes were made to the internal `actions/attest-sbom/predicate` action (any
|
||||
updates to [`./predicate/action.yaml`](./predicate/action.yml) or any of the
|
||||
code in the [`./src`](./src) directory), start with step #1; otherwise, skip
|
||||
directly to step #5.
|
||||
|
||||
1. Merge the latest changes to the `main` branch.
|
||||
1. Create and push a new predicate tag of the form `predicate@X.X.X` following
|
||||
SemVer conventions:
|
||||
|
||||
```shell
|
||||
git tag -a "predicate@X.X.X" -m "predicate@X.X.X Release"
|
||||
git push --tags
|
||||
```
|
||||
|
||||
1. Update the reference to the `actions/attest-sbom/predicate` action in
|
||||
[`action.yml`](./action.yml) to point to the SHA of the newly created tag.
|
||||
1. Push the `action.yml` change and open a PR. Once it has been reviewed, merge
|
||||
the PR and proceed with the release instructions.
|
||||
1. Create a new release for the top-level action using a tag of the form
|
||||
`vX.X.X` following SemVer conventions:
|
||||
|
||||
```shell
|
||||
gh release create vX.X.X
|
||||
```
|
||||
|
||||
1. Move (or create) the major version tag to point to the same commit tagged
|
||||
above:
|
||||
|
||||
```shell
|
||||
git tag -fa vX -m "vX"
|
||||
git push origin vX --force
|
||||
```
|
||||
@@ -1,41 +1,38 @@
|
||||
{
|
||||
"spdxVersion": "SPDX-2.3",
|
||||
"dataLicense": "CC0-1.0",
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"name": "./",
|
||||
"documentNamespace": "https://anchore.com/syft/dir/80b363b6-87f4-4162-853f-60d402537d20",
|
||||
"creationInfo": {
|
||||
"licenseListVersion": "3.22",
|
||||
"creators": [
|
||||
"Organization: Anchore, Inc",
|
||||
"Tool: syft-0.103.1"
|
||||
],
|
||||
"created": "2024-01-31T18:22:50Z"
|
||||
},
|
||||
"packages": [
|
||||
{
|
||||
"name": "@ampproject/remapping",
|
||||
"SPDXID": "SPDXRef-Package-npm--ampproject-remapping-5266573ba4f24a42",
|
||||
"versionInfo": "2.2.1",
|
||||
"supplier": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"filesAnalyzed": false,
|
||||
"sourceInfo": "acquired package info from installed node module manifest file: /yarn.lock",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "Apache-2.0",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "SECURITY",
|
||||
"referenceType": "cpe23Type",
|
||||
"referenceLocator": "cpe:2.3:a:\\@ampproject\\/remapping:\\@ampproject\\/remapping:2.2.1:*:*:*:*:*:*:*"
|
||||
},
|
||||
{
|
||||
"referenceCategory": "PACKAGE-MANAGER",
|
||||
"referenceType": "purl",
|
||||
"referenceLocator": "pkg:npm/%40ampproject/remapping@2.2.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
"spdxVersion": "SPDX-2.3",
|
||||
"dataLicense": "CC0-1.0",
|
||||
"SPDXID": "SPDXRef-DOCUMENT",
|
||||
"name": "./",
|
||||
"documentNamespace": "https://anchore.com/syft/dir/80b363b6-87f4-4162-853f-60d402537d20",
|
||||
"creationInfo": {
|
||||
"licenseListVersion": "3.22",
|
||||
"creators": ["Organization: Anchore, Inc", "Tool: syft-0.103.1"],
|
||||
"created": "2024-01-31T18:22:50Z"
|
||||
},
|
||||
"packages": [
|
||||
{
|
||||
"name": "@ampproject/remapping",
|
||||
"SPDXID": "SPDXRef-Package-npm--ampproject-remapping-5266573ba4f24a42",
|
||||
"versionInfo": "2.2.1",
|
||||
"supplier": "NOASSERTION",
|
||||
"downloadLocation": "NOASSERTION",
|
||||
"filesAnalyzed": false,
|
||||
"sourceInfo": "acquired package info from installed node module manifest file: /yarn.lock",
|
||||
"licenseConcluded": "NOASSERTION",
|
||||
"licenseDeclared": "Apache-2.0",
|
||||
"copyrightText": "NOASSERTION",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "SECURITY",
|
||||
"referenceType": "cpe23Type",
|
||||
"referenceLocator": "cpe:2.3:a:\\@ampproject\\/remapping:\\@ampproject\\/remapping:2.2.1:*:*:*:*:*:*:*"
|
||||
},
|
||||
{
|
||||
"referenceCategory": "PACKAGE-MANAGER",
|
||||
"referenceType": "purl",
|
||||
"referenceLocator": "pkg:npm/%40ampproject/remapping@2.2.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('SBOM Action', () => {
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
fs.rmdirSync(tempDir, { recursive: true })
|
||||
fs.rmSync(tempDir, { recursive: true })
|
||||
outputs = {}
|
||||
})
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('parseSBOMFromPath', () => {
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
fs.rmdirSync(tempDir, { recursive: true })
|
||||
fs.rmSync(tempDir, { recursive: true })
|
||||
})
|
||||
|
||||
it('correctly parses an SPDX file', async () => {
|
||||
|
||||
76
action.yml
76
action.yml
@@ -1,16 +1,20 @@
|
||||
name: 'Attest SBOM'
|
||||
description: 'Generate SBOM attestations for build artifacts'
|
||||
author: 'GitHub'
|
||||
branding:
|
||||
color: 'blue'
|
||||
icon: 'paperclip'
|
||||
|
||||
inputs:
|
||||
subject-path:
|
||||
description: >
|
||||
Path to the artifact serving as the subject of the attestation. Must
|
||||
specify exactly one of "subject-path" or "subject-digest".
|
||||
specify exactly one of "subject-path" or "subject-digest". May contain a
|
||||
glob pattern or list of paths (total subject count cannot exceed 1024).
|
||||
required: false
|
||||
subject-digest:
|
||||
description: >
|
||||
SHA256 digest of the subject for for the attestation. Must be in the form
|
||||
SHA256 digest of the subject for the attestation. Must be in the form
|
||||
"sha256:hex_digest" (e.g. "sha256:abc123..."). Must specify exactly one of
|
||||
"subject-path" or "subject-digest".
|
||||
required: false
|
||||
@@ -21,21 +25,9 @@ inputs:
|
||||
path.
|
||||
sbom-path:
|
||||
description: >
|
||||
Path to the JSON-formatted SBOM file to attest. When specified, the
|
||||
"scan-path" and "sbom-format" inputs are ignored.
|
||||
required: false
|
||||
scan-path:
|
||||
description: >
|
||||
Path on the filesystem to scan for SBOM generation. Ignored if "sbom-path"
|
||||
is specified.
|
||||
default: ${{ github.workspace }}
|
||||
required: false
|
||||
sbom-format:
|
||||
description: >
|
||||
Format to use for the generated SBOM output. Supported formats are "spdx"
|
||||
and "cyclonedx". Ignored if "sbom-path" is specified.
|
||||
default: 'spdx'
|
||||
required: false
|
||||
Path to the JSON-formatted SBOM file to attest. File size cannot exceed
|
||||
16MB.
|
||||
required: true
|
||||
push-to-registry:
|
||||
description: >
|
||||
Whether to push the provenance statement to the image registry. Requires
|
||||
@@ -43,58 +35,46 @@ inputs:
|
||||
and that the "subject-digest" parameter be specified. Defaults to false.
|
||||
default: false
|
||||
required: false
|
||||
show-summary:
|
||||
description: >
|
||||
Whether to attach a list of generated attestations to the workflow run
|
||||
summary page. Defaults to true.
|
||||
default: true
|
||||
required: false
|
||||
github-token:
|
||||
description: >
|
||||
The GitHub token used to make authenticated API requests.
|
||||
default: ${{ github.token }}
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
bundle-path:
|
||||
description: 'The path to the file containing the attestation bundle(s).'
|
||||
description: 'The path to the file containing the attestation bundle.'
|
||||
value: ${{ steps.attest.outputs.bundle-path }}
|
||||
attestation-id:
|
||||
description: 'The ID of the attestation.'
|
||||
value: ${{ steps.attest.outputs.attestation-id }}
|
||||
attestation-url:
|
||||
description: 'The URL for the attestation summary.'
|
||||
value: ${{ steps.attest.outputs.attestation-url }}
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Generate random SBOM output file name
|
||||
if: inputs.sbom-path == ''
|
||||
id: sbom-output
|
||||
run:
|
||||
echo "path=${{ runner.temp }}/sbom_$(openssl rand -hex 6).json" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: SBOM format check
|
||||
id: check-sbom-format
|
||||
if: inputs.sbom-path == ''
|
||||
run: |
|
||||
if [ "${{inputs.sbom-format}}" != "spdx" ] && [ "${{inputs.sbom-format}}" != "cyclonedx" ] ]; then
|
||||
echo "Invalid SBOM format. Supported formats are spdx and cyclonedx."
|
||||
exit 1
|
||||
elif [ "${{inputs.sbom-format}}" == "spdx" ]; then
|
||||
echo "format=spdx-json" >> $GITHUB_OUTPUT
|
||||
elif [ "${{inputs.sbom-format}}" == "cyclonedx" ]; then
|
||||
echo "format=cyclonedx-json" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
shell: bash
|
||||
- name: Generate SBOM
|
||||
if: inputs.sbom-path == ''
|
||||
uses: anchore/sbom-action@b6a39da80722a2cb0ef5d197531764a89b5d48c3 # v0.15.8
|
||||
with:
|
||||
path: ${{ inputs.scan-path }}
|
||||
output-file: ${{ steps.sbom-output.outputs.path }}
|
||||
format: ${{ steps.check-sbom-format.outputs.format }}
|
||||
- uses: actions/attest-sbom/predicate@main
|
||||
- uses: actions/attest-sbom/predicate@534423496eab34674190bc45fdacbb8b1198e07f # predicate@1.0.0
|
||||
id: generate-sbom-predicate
|
||||
with:
|
||||
sbom-path: ${{ inputs.sbom-path || steps.sbom-output.outputs.path }}
|
||||
- uses: actions/attest@main
|
||||
sbom-path: ${{ inputs.sbom-path }}
|
||||
- uses: actions/attest@v2.1.0
|
||||
id: attest
|
||||
with:
|
||||
subject-path: ${{ inputs.subject-path }}
|
||||
subject-digest: ${{ inputs.subject-digest }}
|
||||
subject-name: ${{ inputs.subject-name }}
|
||||
push-to-registry: ${{ inputs.push-to-registry }}
|
||||
predicate-type:
|
||||
${{ steps.generate-sbom-predicate.outputs.predicate-type }}
|
||||
predicate-path:
|
||||
${{ steps.generate-sbom-predicate.outputs.predicate-path }}
|
||||
push-to-registry: ${{ inputs.push-to-registry }}
|
||||
show-summary: ${{ inputs.show-summary }}
|
||||
github-token: ${{ inputs.github-token }}
|
||||
|
||||
3621
dist/index.js
generated
vendored
3621
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
37
dist/licenses.txt
generated
vendored
37
dist/licenses.txt
generated
vendored
@@ -10,6 +10,18 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/http-client
|
||||
MIT
|
||||
Actions Http Client for Node.js
|
||||
@@ -35,6 +47,18 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
@actions/io
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@fastify/busboy
|
||||
MIT
|
||||
Copyright Brian White. All rights reserved.
|
||||
@@ -105,16 +129,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
uuid
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
3477
package-lock.json
generated
3477
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -1,21 +1,21 @@
|
||||
{
|
||||
"name": "typescript-action",
|
||||
"description": "GitHub Actions TypeScript template",
|
||||
"version": "0.0.0",
|
||||
"name": "actions/attest-sbom",
|
||||
"description": "Generate signed SBOM attestations",
|
||||
"version": "1.0.0",
|
||||
"author": "",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/actions/typescript-action",
|
||||
"homepage": "https://github.com/actions/attest-sbom",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/actions/typescript-action.git"
|
||||
"url": "git+https://github.com/actions/attest-sbom.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/typescript-action/issues"
|
||||
"url": "https://github.com/actions/attest-sbom/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"actions",
|
||||
"node",
|
||||
"setup"
|
||||
"attestation",
|
||||
"sbom"
|
||||
],
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
@@ -70,25 +70,25 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1"
|
||||
"@actions/core": "^1.11.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@actions/attest": "^1.0.0",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^20.11.24",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-github": "^4.10.2",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-jsonc": "^2.13.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"@actions/attest": "^1.5.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^22.10.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-plugin-github": "^5.1.4",
|
||||
"eslint-plugin-jest": "^28.9.0",
|
||||
"eslint-plugin-jsonc": "^2.18.2",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"jest": "^29.7.0",
|
||||
"markdownlint-cli": "^0.39.0",
|
||||
"prettier": "^3.2.5",
|
||||
"markdownlint-cli": "^0.43.0",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-eslint": "^16.3.0",
|
||||
"ts-jest": "^29.1.2",
|
||||
"typescript": "^5.3.3"
|
||||
"ts-jest": "^29.2.5",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# About:
|
||||
#
|
||||
# This is a helper script to tag and push a new release. GitHub Actions use
|
||||
# release tags to allow users to select a specific version of the action to use.
|
||||
#
|
||||
# See: https://github.com/actions/typescript-action#publishing-a-new-release
|
||||
#
|
||||
# This script will do the following:
|
||||
#
|
||||
# 1. Get the latest release tag
|
||||
# 2. Prompt the user for a new release tag
|
||||
# 3. Tag the new release
|
||||
# 4. Push the new tag to the remote
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# script/release
|
||||
|
||||
# Terminal colors
|
||||
OFF='\033[0m'
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
|
||||
# Get the latest release tag
|
||||
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
|
||||
|
||||
if [[ -z "$latest_tag" ]]; then
|
||||
# There are no existing release tags
|
||||
echo -e "No tags found (yet) - Continue to create and push your first tag"
|
||||
latest_tag="[unknown]"
|
||||
fi
|
||||
|
||||
# Display the latest release tag
|
||||
echo -e "The latest release tag is: ${BLUE}${latest_tag}${OFF}"
|
||||
|
||||
# Prompt the user for the new release tag
|
||||
read -r -p 'Enter a new release tag (vX.X.X format): ' new_tag
|
||||
|
||||
# Validate the new release tag
|
||||
tag_regex='v[0-9]+\.[0-9]+\.[0-9]+$'
|
||||
if echo "$new_tag" | grep -q -E "$tag_regex"; then
|
||||
echo -e "Tag: ${BLUE}$new_tag${OFF} is valid"
|
||||
else
|
||||
# Release tag is not `vX.X.X` format
|
||||
echo -e "Tag: ${BLUE}$new_tag${OFF} is ${RED}not valid${OFF} (must be in vX.X.X format)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Tag the new release
|
||||
git tag -a "$new_tag" -m "$new_tag Release"
|
||||
echo -e "${GREEN}Tagged: $new_tag${OFF}"
|
||||
|
||||
# Push the new tag to the remote
|
||||
git push --tags
|
||||
echo -e "${GREEN}Release tag pushed to remote${OFF}"
|
||||
echo -e "${GREEN}Done!${OFF}"
|
||||
Reference in New Issue
Block a user