Compare commits

..
Author SHA1 Message Date
Brian DeHamer 429e2ac7fe skip attestation store
Signed-off-by: Brian DeHamer <[email protected]>
2024-05-31 10:07:45 -07:00
14 changed files with 2369 additions and 3648 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ updates:
- minor - minor
- patch - patch
ignore: ignore:
- dependency-name: 'actions/attest-sbom' - dependency-name: "actions/attest-sbom"
- package-ecosystem: npm - package-ecosystem: npm
directory: / directory: /
+2 -2
View File
@@ -38,7 +38,7 @@ jobs:
- name: Lint Codebase - name: Lint Codebase
id: super-linter id: super-linter
uses: super-linter/super-linter/slim@v7 uses: super-linter/super-linter/slim@v6
env: env:
DEFAULT_BRANCH: main DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/* FILTER_REGEX_EXCLUDE: dist/**/*
@@ -46,5 +46,5 @@ jobs:
TYPESCRIPT_DEFAULT_STYLE: prettier TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_ALL_CODEBASE: true VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVASCRIPT_STANDARD: false VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_TYPESCRIPT_STANDARD: false
VALIDATE_JSCPD: false VALIDATE_JSCPD: false
VALIDATE_GITHUB_ACTIONS: false
@@ -1,22 +0,0 @@
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/[email protected]
+15 -46
View File
@@ -21,8 +21,8 @@ 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]. CLI][7].
See [Using artifact attestations to establish provenance for builds][11] for See [Using artifact attestations to establish provenance for builds][11]
more information on artifact attestations. for more information on artifact attestations.
## Usage ## Usage
@@ -63,8 +63,7 @@ See [action.yml](action.yml)
- uses: actions/attest-sbom@v1 - uses: actions/attest-sbom@v1
with: with:
# Path to the artifact serving as the subject of the attestation. Must # Path to the artifact serving as the subject of the attestation. Must
# specify exactly one of "subject-path" or "subject-digest". May contain a # specify exactly one of "subject-path" or "subject-digest".
# glob pattern or list of paths (total subject count cannot exceed 1024).
subject-path: subject-path:
# SHA256 digest of the subject for the attestation. Must be in the form # SHA256 digest of the subject for the attestation. Must be in the form
@@ -77,8 +76,8 @@ See [action.yml](action.yml)
# path. # path.
subject-name: subject-name:
# Path to the JSON-formatted SBOM file to attest. File size cannot exceed # Path to the JSON-formatted SBOM file to attest. When specified, the
# 16MB. # "scan-path" and "sbom-format" inputs are ignored.
sbom-path: sbom-path:
# Whether to push the attestation to the image registry. Requires that the # Whether to push the attestation to the image registry. Requires that the
@@ -86,10 +85,6 @@ See [action.yml](action.yml)
# the "subject-digest" parameter be specified. Defaults to false. # the "subject-digest" parameter be specified. Defaults to false.
push-to-registry: 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 # The GitHub token used to make authenticated API requests. Default is
# ${{ github.token }} # ${{ github.token }}
github-token: github-token:
@@ -100,25 +95,16 @@ See [action.yml](action.yml)
<!-- markdownlint-disable MD013 --> <!-- markdownlint-disable MD013 -->
| Name | Description | Example | | Name | Description | Example |
| ------------- | -------------------------------------------------------------- | ---------------------- | | ------------- | -------------------------------------------------------------- | ----------------------- |
| `bundle-path` | Absolute path to the file containing the generated attestation | `/tmp/attestaion.json` | | `bundle-path` | Absolute path to the file containing the generated attestation | `/tmp/attestaion.jsonl` |
<!-- markdownlint-enable MD013 --> <!-- markdownlint-enable MD013 -->
Attestations are saved in the JSON-serialized [Sigstore bundle][8] format. Attestations are saved in the JSON-serialized [Sigstore bundle][8] format.
If multiple subjects are being attested at the same time, a single attestation If multiple subjects are being attested at the same time, each attestation will
will be created with references to each of the supplied subjects. be written to the output file on a separate line (using the [JSON Lines][9]
format).
## 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 ## Examples
@@ -158,10 +144,10 @@ jobs:
sbom-path: 'sbom.spdx.json' sbom-path: 'sbom.spdx.json'
``` ```
### Identify Multiple Subjects ### Identify Subjects by Wildcard
If you are generating multiple artifacts, you can attest all of them at the same If you are generating multiple artifacts, you can generate an attestation for
time by using a wildcard in the `subject-path` input. each by using a wildcard in the `subject-path` input.
```yaml ```yaml
- uses: actions/attest-sbom@v1 - uses: actions/attest-sbom@v1
@@ -173,23 +159,6 @@ time by using a wildcard in the `subject-path` input.
For supported wildcards along with behavior and documentation, see For supported wildcards along with behavior and documentation, see
[@actions/glob][10] which is used internally to search for files. [@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@v1
with:
subject-path: 'dist/foo, dist/bar'
```
```yaml
- uses: actions/attest-sbom@v1
with:
subject-path: |
dist/foo
dist/bar
```
### Container Image ### Container Image
When working with container images you can invoke the action with the When working with container images you can invoke the action with the
@@ -263,6 +232,6 @@ jobs:
[7]: https://cli.github.com/manual/gh_attestation_verify [7]: https://cli.github.com/manual/gh_attestation_verify
[8]: [8]:
https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto 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 [10]: https://github.com/actions/toolkit/tree/main/packages/glob#patterns
[11]: [11]: https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
+9 -8
View File
@@ -1,12 +1,12 @@
# Release Instructions # Release Instructions
Follow the steps below to tag a new release for the `actions/attest-sbom` Follow the steps below to tag a new release for the
action. `actions/attest-sbom` action.
If changes were made to the internal `actions/attest-sbom/predicate` action (any If changes were made to the internal `actions/attest-sbom/predicate`
updates to [`./predicate/action.yaml`](./predicate/action.yml) or any of the action (any updates to [`./predicate/action.yaml`](./predicate/action.yml) or
code in the [`./src`](./src) directory), start with step #1; otherwise, skip any of the code in the [`./src`](./src) directory), start with step #1;
directly to step #5. otherwise, skip directly to step #5.
1. Merge the latest changes to the `main` branch. 1. Merge the latest changes to the `main` branch.
1. Create and push a new predicate tag of the form `[email protected]` following 1. Create and push a new predicate tag of the form `[email protected]` following
@@ -17,8 +17,9 @@ directly to step #5.
git push --tags git push --tags
``` ```
1. Update the reference to the `actions/attest-sbom/predicate` action in 1. Update the reference to the `actions/attest-sbom/predicate`
[`action.yml`](./action.yml) to point to the SHA of the newly created tag. 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 1. Push the `action.yml` change and open a PR. Once it has been reviewed, merge
the PR and proceed with the release instructions. the PR and proceed with the release instructions.
1. Create a new release for the top-level action using a tag of the form 1. Create a new release for the top-level action using a tag of the form
+4 -1
View File
@@ -6,7 +6,10 @@
"documentNamespace": "https://anchore.com/syft/dir/80b363b6-87f4-4162-853f-60d402537d20", "documentNamespace": "https://anchore.com/syft/dir/80b363b6-87f4-4162-853f-60d402537d20",
"creationInfo": { "creationInfo": {
"licenseListVersion": "3.22", "licenseListVersion": "3.22",
"creators": ["Organization: Anchore, Inc", "Tool: syft-0.103.1"], "creators": [
"Organization: Anchore, Inc",
"Tool: syft-0.103.1"
],
"created": "2024-01-31T18:22:50Z" "created": "2024-01-31T18:22:50Z"
}, },
"packages": [ "packages": [
+1 -1
View File
@@ -27,7 +27,7 @@ describe('SBOM Action', () => {
}) })
afterEach(() => { afterEach(() => {
fs.rmSync(tempDir, { recursive: true }) fs.rmdirSync(tempDir, { recursive: true })
outputs = {} outputs = {}
}) })
+1 -1
View File
@@ -17,7 +17,7 @@ describe('parseSBOMFromPath', () => {
}) })
afterEach(() => { afterEach(() => {
fs.rmSync(tempDir, { recursive: true }) fs.rmdirSync(tempDir, { recursive: true })
}) })
it('correctly parses an SPDX file', async () => { it('correctly parses an SPDX file', async () => {
+7 -15
View File
@@ -9,8 +9,7 @@ inputs:
subject-path: subject-path:
description: > description: >
Path to the artifact serving as the subject of the attestation. Must Path to the artifact serving as the subject of the attestation. Must
specify exactly one of "subject-path" or "subject-digest". May contain a specify exactly one of "subject-path" or "subject-digest".
glob pattern or list of paths (total subject count cannot exceed 1024).
required: false required: false
subject-digest: subject-digest:
description: > description: >
@@ -25,9 +24,9 @@ inputs:
path. path.
sbom-path: sbom-path:
description: > description: >
Path to the JSON-formatted SBOM file to attest. File size cannot exceed Path to the JSON-formatted SBOM file to attest. When specified, the
16MB. "scan-path" and "sbom-format" inputs are ignored.
required: true required: false
push-to-registry: push-to-registry:
description: > description: >
Whether to push the provenance statement to the image registry. Requires Whether to push the provenance statement to the image registry. Requires
@@ -35,12 +34,6 @@ inputs:
and that the "subject-digest" parameter be specified. Defaults to false. and that the "subject-digest" parameter be specified. Defaults to false.
default: false default: false
required: 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: github-token:
description: > description: >
The GitHub token used to make authenticated API requests. The GitHub token used to make authenticated API requests.
@@ -49,7 +42,7 @@ inputs:
outputs: outputs:
bundle-path: bundle-path:
description: 'The path to the file containing the attestation bundle.' description: 'The path to the file containing the attestation bundle(s).'
value: ${{ steps.attest.outputs.bundle-path }} value: ${{ steps.attest.outputs.bundle-path }}
runs: runs:
@@ -58,8 +51,8 @@ runs:
- uses: actions/attest-sbom/predicate@534423496eab34674190bc45fdacbb8b1198e07f # [email protected] - uses: actions/attest-sbom/predicate@534423496eab34674190bc45fdacbb8b1198e07f # [email protected]
id: generate-sbom-predicate id: generate-sbom-predicate
with: with:
sbom-path: ${{ inputs.sbom-path }} sbom-path: ${{ inputs.sbom-path || steps.sbom-output.outputs.path }}
- uses: actions/attest@v2.0.0 - uses: actions/attest@bdehamer/skip-attestation-store
id: attest id: attest
with: with:
subject-path: ${{ inputs.subject-path }} subject-path: ${{ inputs.subject-path }}
@@ -70,5 +63,4 @@ runs:
predicate-path: predicate-path:
${{ steps.generate-sbom-predicate.outputs.predicate-path }} ${{ steps.generate-sbom-predicate.outputs.predicate-path }}
push-to-registry: ${{ inputs.push-to-registry }} push-to-registry: ${{ inputs.push-to-registry }}
show-summary: ${{ inputs.show-summary }}
github-token: ${{ inputs.github-token }} github-token: ${{ inputs.github-token }}
Generated Vendored
+1274 -2028
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+13 -24
View File
@@ -10,18 +10,6 @@ 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. 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 @actions/http-client
MIT MIT
Actions Http Client for Node.js Actions Http Client for Node.js
@@ -47,18 +35,6 @@ 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. 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 @fastify/busboy
MIT MIT
Copyright Brian White. All rights reserved. Copyright Brian White. All rights reserved.
@@ -129,3 +105,16 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. 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.
+979 -1436
View File
File diff suppressed because it is too large Load Diff
+16 -16
View File
@@ -70,25 +70,25 @@
] ]
}, },
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1" "@actions/core": "^1.10.1"
}, },
"devDependencies": { "devDependencies": {
"@actions/attest": "^1.5.0", "@actions/attest": "^1.2.1",
"@types/jest": "^29.5.14", "@types/jest": "^29.5.12",
"@types/node": "^22.10.1", "@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.17.0", "@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^7.10.0",
"@vercel/ncc": "^0.38.3", "@vercel/ncc": "^0.38.1",
"eslint": "^8.57.1", "eslint": "^8.57.0",
"eslint-plugin-github": "^5.1.3", "eslint-plugin-github": "^4.10.2",
"eslint-plugin-jest": "^28.9.0", "eslint-plugin-jest": "^28.5.0",
"eslint-plugin-jsonc": "^2.18.2", "eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0", "jest": "^29.7.0",
"markdownlint-cli": "^0.43.0", "markdownlint-cli": "^0.41.0",
"prettier": "^3.4.1", "prettier": "^3.2.5",
"prettier-eslint": "^16.3.0", "prettier-eslint": "^16.3.0",
"ts-jest": "^29.2.5", "ts-jest": "^29.1.3",
"typescript": "^5.7.2" "typescript": "^5.4.5"
} }
} }