-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add first version of the container sign action
- Loading branch information
1 parent
5a0a59e
commit 23e353c
Showing
3 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Action: sign-blob | ||
|
||
<!-- action-docs-description source="action.yml" --> | ||
## Description | ||
|
||
This action is used to sign a container image with a list of tags in keyless mode based on Github OIDC token. | ||
<!-- action-docs-description source="action.yml" --> | ||
|
||
## Usage | ||
|
||
### Permissions | ||
```yaml | ||
permissions: | ||
id-token: write | ||
``` | ||
### Example Workflow | ||
```yaml | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Sign a blob | ||
id: sign-blob | ||
uses: LedgerHQ/actions-security/actions/sign-container@actions/sign-container-1 | ||
with: | ||
tags: "" | ||
disgest: "" | ||
``` | ||
<!-- action-docs-inputs source="action.yml" --> | ||
## Inputs | ||
| name | description | required | default | | ||
| --- | --- | --- | --- | | ||
| `tags` | <p>List of tags to sign (based on the output of the docker/metadata-action)</p> | `true` | `""` | | ||
| `digest` | <p>Digest of the container image to sign (based on the output of the docker/build-push-action)</p> | `true` | `""` | | ||
<!-- action-docs-inputs source="action.yml" --> | ||
|
||
<!-- action-docs-outputs source="action.yml" --> | ||
|
||
<!-- action-docs-outputs source="action.yml" --> | ||
|
||
|
||
<!-- action-docs-runs source="action.yml" --> | ||
## Runs | ||
|
||
This action is a `composite` action. | ||
<!-- action-docs-runs source="action.yml" --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "[Ledger Security] Sign container image" | ||
description: "This action is used to sign a container image with a list of tags in keyless mode based on Github OIDC token." | ||
|
||
inputs: | ||
tags: | ||
description: 'List of tags to sign (based on the output of the docker/metadata-action)' | ||
required: true | ||
default: "" | ||
digest: | ||
description: 'Digest of the container image to sign (based on the output of the docker/build-push-action)' | ||
required: true | ||
default: "" | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@v3 | ||
- name: Sign containers images | ||
shell: bash | ||
run: | | ||
images="" | ||
for tag in ${TAGS}; do | ||
images+="${tag}@${DIGEST} " | ||
done | ||
cosign sign --yes ${images} |