Skip to content

Commit

Permalink
Add secrets manager tool (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
michelemin authored Jan 21, 2025
1 parent 843df0e commit bf86457
Show file tree
Hide file tree
Showing 9 changed files with 482 additions and 38 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ConfigChecker.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Release config checker

on:
push:
tags:
- '*'
workflow_call:

permissions:
contents: write
Expand All @@ -29,7 +27,8 @@ jobs:
- name: Build config checker
run: cd runtime && cargo build --bin=config_check --release

- name: Release
uses: softprops/action-gh-release@v2
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
files: runtime/target/release/config_check
name: config_check
path: runtime/target/release/config_check
38 changes: 38 additions & 0 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
config_check:
uses: ./.github/workflows/ConfigChecker.yaml

secrets_manager:
uses: ./.github/workflows/SecretsManager.yaml

release:
name: Release
needs: [config_check, secrets_manager]
runs-on: ubuntu-latest
steps:
- name: Download config checker
uses: actions/download-artifact@v4
with:
name: config_check

- name: Download secrets manager
uses: actions/download-artifact@v4
with:
name: secrets_manager

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
config_check
secrets_manager
29 changes: 29 additions & 0 deletions .github/workflows/SecretsManager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release secrets manager

on:
workflow_call:

permissions:
contents: write

jobs:
release_secrets_manager:
name: Release secrets manager
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build secrets manager for aarch64
run: |
cd runtime
docker build -t secrets_manager -f plaid/resources/Dockerfile_secrets_manager.aarch64 .
# By default, this container prints the base64 encoding of the executable.
# We take it and pipe-decode it into a file, which will then be released.
docker run --rm secrets_manager | base64 -d > secrets_manager
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: secrets_manager
path: runtime/secrets_manager
2 changes: 1 addition & 1 deletion modules/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 61 additions & 28 deletions runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/plaid-stl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plaid_stl"
version = "0.14.0"
version = "0.14.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
9 changes: 7 additions & 2 deletions runtime/plaid/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plaid"
version = "0.14.0"
version = "0.14.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -12,8 +12,9 @@ aws = ["aws-sdk-kms", "aws-config"]
[dependencies]
alkali = "0.3.0"
async-trait = "0.1.56"
aws-sdk-secretsmanager = "1.57.0"
base64 = "0.13"
clap = { version = "4", default-features = false, features = ["std"] }
clap = { version = "4", default-features = false, features = ["std", "help", "usage"] }
crossbeam-channel = "0.5"
env_logger = "0.8"
flate2 = "1.0"
Expand Down Expand Up @@ -73,3 +74,7 @@ path = "src/bin/config_check.rs"
[[bin]]
name = "request_handler"
path = "src/bin/request_handler.rs"

[[bin]]
name = "secrets_manager"
path = "src/bin/secrets_manager.rs"
9 changes: 9 additions & 0 deletions runtime/plaid/resources/Dockerfile_secrets_manager.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM messense/rust-musl-cross:aarch64-musl

RUN mkdir /build
WORKDIR /build
COPY . .

RUN cargo build --release --bin=secrets_manager

ENTRYPOINT ["/usr/bin/base64", "-w0", "target/aarch64-unknown-linux-musl/release/secrets_manager"]
Loading

0 comments on commit bf86457

Please sign in to comment.