Skip to content

Commit 40694c9

Browse files
author
Maxim Konovalenko
committed
Adding functionality for signing external modules
1 parent 454451d commit 40694c9

File tree

5 files changed

+61
-11
lines changed

5 files changed

+61
-11
lines changed

.examples/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ jobs:
2929
svace_enabled: ${{ github.event.inputs.svace_enabled || contains(github.event.pull_request.labels.*.name, 'analyze/svace') }}
3030
svace_analyze_host: "${{ secrets.SVACE_ANALYZE_HOST }}"
3131
svace_analyze_ssh_user: "${{ secrets.SVACE_ANALYZE_SSH_USER }}"
32-
svace_analyze_ssh_key: "${{ secrets.SVACE_ANALYZE_SSH_PRIVATE_KEY }}"
32+
svace_analyze_ssh_key: "${{ secrets.SVACE_ANALYZE_SSH_PRIVATE_KEY }}"
33+
werf_sign_cert: "${{ secrets.WERF_SIGN_CERT }}"
34+
werf_sign_intermediates: "${{ secrets.WERF_SIGN_INTERMEDIATES }}"
35+
werf_sign_key: "${{ secrets.WERF_SIGN_KEY }}"
36+
vault_addr: "${{ secrets.VAULT_ADDR }}"
37+
vault_role_id: "${{ secrets.VAULT_ROLE_ID }}"
38+
vault_secret_id: "${{ secrets.VAULT_SECRET_ID }}"
39+
transit_secret_engine_path: "${{ secrets.TRANSIT_SECRET_ENGINE_PATH }}"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
This repository contains GitHub Actions workflows for building and deploying modules for the Deckhouse Kubernetes Platform.
88

99
## Workflows
10-
| Workflow | Description |
11-
|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
12-
| [**setup**](./setup/action.yml) | Sets up the environment for building and deploying modules. This workflow **must** be run before any other workflows. |
13-
| [**build**](./build/action.yml) | Builds the Deckhouse modules using the [werf](https://werf.io/) tool. |
14-
| [**deploy**](./deploy/action.yml) | Deploys the Deckhouse modules to the one of selected release channels. |
15-
| [**cve_scan**](./cve_scan/action.yml) | Trivy CVE Scan of module images. Documentation can be found [here](./.docs/cve_scan.md) |
16-
| [**svace_analyze**](./svace_analyze/action.yml) | Include svace analyze action to analyze and import builds made with svace tool |
10+
| Workflow | Description |
11+
|-------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
12+
| [**setup**](./setup/action.yml) | Sets up the environment for building and deploying modules. This workflow **must** be run before any other workflows. |
13+
| [**build**](./build/action.yml) | Builds the Deckhouse modules using the [werf](https://werf.io/) tool. |
14+
| [**deploy**](./deploy/action.yml) | Deploys the Deckhouse modules to the one of selected release channels. |
15+
| [**cve_scan**](./cve_scan/action.yml) | Trivy CVE Scan of module images. Documentation can be found [here](./.docs/cve_scan.md) |
16+
| [**svace_analyze**](./svace_analyze/action.yml) | Include svace analyze action to analyze and import builds made with svace tool |
1717

1818
## Examples
1919

build/action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Добавляем подписывание модулей
12
name: 'Build Deckhouse Module'
23
description: 'Build Deckhouse module'
34
inputs:
@@ -10,6 +11,27 @@ inputs:
1011
module_tag:
1112
description: 'The version of the module to deploy to release channel, e.g., v1.21.1'
1213
required: true
14+
werf_sign_cert:
15+
description: "Image signing certificate (file path or Base64)"
16+
requierd: true
17+
werf_sign_intermediates:
18+
description: "Intermediate certificates (file path or Base64)"
19+
requierd: true
20+
werf_sign_key:
21+
description: "Private key for signing (file path or Base64)"
22+
requierd: true
23+
vault_addr:
24+
description: "Vault URL, e.g., http://localhost:8200"
25+
requierd: true
26+
vault_role_id:
27+
description: "Vault role ID"
28+
requierd: true
29+
vault_secret_id:
30+
description: "Vault secret ID"
31+
requierd: true
32+
transit_secret_engine_path:
33+
description: "Vault namespace, e.g., dh-signer-dev"
34+
requierd: true
1335
secondary_repo:
1436
description: 'Secondary repository address for module, e.g., registry.example.com/module-source/module_name'
1537
required: false
@@ -124,6 +146,17 @@ runs:
124146
SVACE_ANALYZE_HOST: "${{ inputs.svace_analyze_host }}"
125147
SVACE_ANALYZE_SSH_USER: "${{ inputs.svace_analyze_ssh_user }}"
126148
SVACE_ENABLED: "${{ inputs.svace_enabled }}"
149+
WERF_SIGN_CERT: "${{ inputs.werf_sign_cert }}"
150+
WERF_SIGN_INTERMEDIATES: "${{ inputs.werf_sign_intermediates }}"
151+
WERF_SIGN_KEY: "${{ inputs.werf_sign_key }}"
152+
VAULT_ADDR: "${{ inputs.vault_addr }}"
153+
VAULT_ROLE_ID: "${{ inputs.vault_role_id }}"
154+
VAULT_SECRET_ID: "${{ inputs.vault_secret_id }}"
155+
TRANSIT_SECRET_ENGINE_PATH: "${{ inputs.transit_secret_engine_path }}"
156+
WERF_SIGN_MANIFEST: "1"
157+
WERF_ANNOTATE_LAYERS_WITH_DM_VERITY_ROOT_HASH: "1"
158+
WERF_SIGN_ELF_FILES: "1"
159+
WERF_BSIGN_ELF_FILES: "1"
127160

128161
- name: Cleanup ssh-agent
129162
if: ${{ steps.ssh_agent.outcome != 'skipped' && always() }}

cve_scan/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,5 +278,4 @@ runs:
278278
send_report "License" "${module_reports}/ext_${MODULE_NAME}_${IMAGE_NAME}_report_license.json"
279279
done < <(jq -rc 'to_entries[]' <<< "${digests}")
280280
done
281-
rm -r ${workdir}
282-
281+
rm -r ${workdir}

setup/action.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@ inputs:
1010
registry_password:
1111
description: 'Registry password'
1212
required: true
13+
werf_version:
14+
description: 'Werf version'
15+
required: true
1316

1417
runs:
1518
using: "composite"
1619
steps:
17-
- uses: werf/actions/install@v2
1820
- uses: imjasonh/[email protected]
1921

22+
- name: Install werf
23+
shell: bash
24+
run: |
25+
curl --fail -sSL -o ~/bin/werf \
26+
-H "PRIVATE-TOKEN: ${{ secrets.FOX_ACCESS_TOKEN }}" \
27+
"https://${{ secrets.DECKHOUSE_PRIVATE_REPO }}/api/v4/projects/4052/packages/generic/werf/${{ inputs.werf_version }}/werf"
28+
chmod +x ~/bin/werf
29+
export PATH=~/bin:$PATH
30+
2031
- name: Print werf version
2132
shell: bash
2233
run: werf version

0 commit comments

Comments
 (0)