Skip to content

CloudFront Controller - Ability to reference K8s secrets key/value in custom headers #2603

@trc-ikeskin

Description

@trc-ikeskin

Is your feature request related to a problem?

As describe in the AWS documentation it is good practice to secure access to Application Load Balancer origins using secret HTTP header KV-pair on both the CloudFront origin request and ALB listener rule to make backend access exclusive to the configured CloudFront Distributions.

Such secret values are typically stored in AWS Secrets Manager and synced to the cluster in the form of K8s secrets using tools like the External Secrets Operator for further use in other K8s resources.

Describe the solution you'd like

Make it possible to declare a secret reference (name and key) for both the headerName and headerValue keys of the items in distributionConfig.origins.items[].customHeaders.items[] of the Distribution custom resource.

Example:

distributionConfig:
  origins:
        items:
          - customHeaders:
              items:
                - headerName:
                    fromSecretName: this-is-a-k8s-secret-name
                    fromSecretKey: this-is-a-key-in-above-k8s-secret
                  headerValue:
                    fromSecretName: this-is-a-k8s-secret-name
                    fromSecretKey: this-is-a-key-in-above-k8s-secret
# ...

Similar options exist e.g. for the RDS Controllers DBInstance resource where the master password can be referenced using masterUserPassword.name, masterUserPassword.key and
masterUserPassword.namespace.

Describe alternatives you've considered

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions