cyberark / secrets-provider-for-k8s

Cyberark secrets provider for k8s
Apache License 2.0
26 stars 11 forks source link

Decode base64 K8s secrets #508

Closed gl-johnson closed 1 year ago

gl-johnson commented 1 year ago

Desired Outcome

Add decoding of base64 secrets based on content-type annotation in the secrets manifest

Implemented Changes

Manually tested with init container config:

kubectl exec $test_pod --namespace local-secrets-provider -- printenv VARIABLE_WITH_ENCODED_SECRET

Output:

secret-value

Manually tested with sidecar (rotation) config:

kubectl exec $test_pod --namespace local-secrets-provider -- printenv VARIABLE_WITH_ENCODED_SECRET && \
echo "Updating Conjur secret value" && \
kubectl exec $cli_pod --namespace local-conjur -- conjur variable set -i secrets/encoded -v "aGVsbG8gd29ybGQ=" && \
echo "Sleeping for 45s while secrets refresh…" && sleep 45 && \
kubectl exec $test_pod --namespace local-secrets-provider -- printenv VARIABLE_WITH_ENCODED_SECRET

Output:

secret-value
Updating Conjur secret value
Value added
Sleeping for 45s while secrets refresh…
hello world

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be merged.

Changelog

Test coverage

Documentation

Behavior

Security

codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit 4274d140 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 89.2% (0.1% change).

View more on Code Climate.