Skip to content

Commit 1b7581d

Browse files
committed
feat: integrate WebAssembly component signing with dual-layer security
- Add wasmsign2 component signing integration using rules_wasm_component - Implement OCI image signing with Cosign keyless signing (GitHub OIDC) - Create dual-layer security model: component + container manifest signing - Add signature verification rules and comprehensive security documentation - Update CI/CD pipelines to build and publish signed components - Support both signed and unsigned variants for different security requirements - Include verification keys and comprehensive verification instructions
1 parent eb10409 commit 1b7581d

File tree

7 files changed

+569
-88
lines changed

7 files changed

+569
-88
lines changed

.bazelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ build:release --copt=-O3
5656
build:release --copt=-DNDEBUG
5757

5858
# Security settings
59-
build --experimental_enable_runfiles_with_generated_files
6059
build --incompatible_run_shell_command_string=false
6160

6261
try-import %workspace%/.bazelrc.local

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ jobs:
6767
run: |
6868
bazel build //tinygo:file_ops_component_wasm
6969
70+
- name: Build Signed WebAssembly Component
71+
run: |
72+
# Generate signing keys and build signed component
73+
bazel build //tinygo:component_signing_keys //tinygo:file_ops_component_signed
74+
75+
# Verify the signature
76+
bazel build //tinygo:verify_file_ops_signature
77+
7078
- name: Validate WebAssembly Component
7179
run: |
7280
# Install wasm-tools if not available
@@ -75,9 +83,13 @@ jobs:
7583
sudo mv wasm-tools*/wasm-tools /usr/local/bin/ || mv wasm-tools*/wasm-tools.exe /usr/local/bin/
7684
fi
7785
78-
# Validate the generated WebAssembly component
86+
# Validate the unsigned WebAssembly component
7987
wasm-tools validate bazel-bin/tinygo/file_ops_component_wasm.wasm
8088
wasm-tools component wit bazel-bin/tinygo/file_ops_component_wasm.wasm
89+
90+
# Validate the signed WebAssembly component
91+
wasm-tools validate bazel-bin/tinygo/file_ops_component_signed.wasm
92+
wasm-tools component wit bazel-bin/tinygo/file_ops_component_signed.wasm
8193
8294
- name: Upload TinyGo Artifacts
8395
uses: actions/upload-artifact@v4
@@ -86,6 +98,8 @@ jobs:
8698
path: |
8799
bazel-bin/tinygo/file_ops_tinygo*
88100
bazel-bin/tinygo/file_ops_component_wasm.wasm
101+
bazel-bin/tinygo/file_ops_component_signed.wasm
102+
bazel-bin/tinygo/component_signing_keys*
89103
retention-days: 7
90104

91105
# Build and test Rust implementation

0 commit comments

Comments
 (0)