Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new approach for storing gateway cache encryption key in k8s secrets #265

Merged
merged 8 commits into from
Nov 7, 2024

Conversation

idanmantin
Copy link
Contributor

@idanmantin idanmantin commented Oct 29, 2024

Description

Task: ASM-12592 - Redis Enc Key Management In SaaS Gator

Changes:

  • New field: storeEncryptionKeyToK8sSecrets - When set to true, the cache encryption key is stored in K8s secrets, supporting Auto Scaling scenarios without network connectivity.

  • Enhancements to field encryptionKeyExistingSecret:

    • Still specifies the K8s secret name to be used for managing the cache encryption key.
    • If empty, the chart will generate name based on the deployment name
    • The Gateway will use and manage this secret’s content, will create/update the k8s secret with the cache enc key, useful for Scaling Up without network connectivity.
  • When chart creating the Service Account, we also take care to create a Role and Role Binding to the created Service Account with appropriate K8s secret permissions (get, create, update) on this specific secret name, allowing the gateway to manage the cache encryption key securely in Kubernetes.

@idanmantin idanmantin requested a review from a team October 29, 2024 12:03
omriezra
omriezra previously approved these changes Oct 29, 2024

{{/* RBAC rule to access the secret if storeEncryptionKeyToK8sSecrets is true and clusterCacheEncryptionKeyExist is not empty */}}
{{- if and (eq $.Values.cachingConf.clusterCache.storeEncryptionKeyToK8sSecrets true) (not (eq (include "akeyless-api-gw.clusterCacheEncryptionKeyExist" $) "")) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this condition needs to be update to support all the cases:

  • if secret exist
  • if secret not exist

should basically be create if cache enabled
@rani-sharim

@omriezra omriezra dismissed their stale review October 31, 2024 13:33

role and rolebinding logic issue

@rani-sharim rani-sharim merged commit be58c7b into main Nov 7, 2024
1 check passed
@rani-sharim rani-sharim deleted the store_gw_cache_enc_key branch November 7, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants