Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

feat(aws): allow custom endpoints for aws services #602

Merged
merged 3 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ Access to AWS secrets backends (SSM & secrets manager) can be granted in various

4. Directly provide AWS access credentials to the `kubernetes-external-secrets` pod by environmental variables.

5. Optionally configure custom endpoints using environment variables
* [AWS_SM_ENDPOINT](https://docs.aws.amazon.com/general/latest/gr/asm.html) - Useful to set endpoints for FIPS compliance.
* [AWS_STS_ENDPOINT](https://docs.aws.amazon.com/general/latest/gr/sts.html) - Useful to set endpoints for FIPS compliance or regional latency.
* [AWS_SSM_ENDPOINT](https://docs.aws.amazon.com/general/latest/gr/ssm.html) - Useful to set endpoints for FIPS compliance or custom VPC endpoint.


##### Using AWS access credentials

Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars in the `kubernetes-external-secrets` session/pod.
Expand Down
4 changes: 4 additions & 0 deletions charts/kubernetes-external-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ env:
# Set a role to be used when assuming roles specified in external secret (AWS only)
# AWS_INTERMEDIATE_ROLE_ARN:
# GOOGLE_APPLICATION_CREDENTIALS: /app/gcp-creds/gcp-creds.json
# Use custom endpoints for FIPS compliance
# AWS_STS_ENDPOINT: https://sts-fips.us-east-1.amazonaws.com
# AWS_SSM_ENDPOINT: http://ssm-fips.us-east-1.amazonaws.com
# AWS_SM_ENDPOINT: http://secretsmanager-fips.us-east-1.amazonaws.com

# Create environment variables from existing k8s secrets
# envVarsFromSecret:
Expand Down
16 changes: 16 additions & 0 deletions config/aws-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,29 @@ const localstack = process.env.LOCALSTACK || 0

const intermediateRole = process.env.AWS_INTERMEDIATE_ROLE_ARN || 0

const stsEndpoint = process.env.AWS_STS_ENDPOINT || 0
const ssmEndpoint = process.env.AWS_SSM_ENDPOINT || 0
const smEndpoint = process.env.AWS_SM_ENDPOINT || 0

let secretsManagerConfig = {}
let systemManagerConfig = {}
let stsConfig = {
region: process.env.AWS_REGION || 'us-west-2',
stsRegionalEndpoints: process.env.AWS_STS_ENDPOINT_TYPE || 'regional'
}

if (smEndpoint) {
secretsManagerConfig.endpoint = smEndpoint
}

if (ssmEndpoint) {
systemManagerConfig.endpoint = ssmEndpoint
}

if (stsEndpoint) {
stsConfig.endpoint = stsEndpoint
}

if (localstack) {
moolen marked this conversation as resolved.
Show resolved Hide resolved
secretsManagerConfig = {
endpoint: process.env.LOCALSTACK_SM_URL || 'http://localhost:4584',
Expand Down