You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been successfully testing limitador-operator v0.6.0, and I have identified a possible not intended credentials leak in the deployment container command.
Then redis storage is configured on an external secret with the connection string set at URL, and I guess it is a secret and not a configmap, because connection string to connect to redis might have use user/password:
apiVersion: v1kind: Secretmetadata:
name: redisconfigstringData:
URL: redis://127.0.0.1/a # Redis URL of its running instancetype: Opaque
However, instead of mounting the secret on the deployment and extract the URL into possibly an ENVVAR, it is taking the URL from the secret, and configure it directly on the container command showing its plain value (even if it possibly has a secret password):
I think we can explore the expansion feature from container environment. From kubernetes 1.25 ref:
command
string array
Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
Passing the Redis URL via a environment variable and not exposed in the deployment works straight forward.
The one side affect of taken this approach seems to mean the secret with the redis credentials needs to be defined in the same namespace as the limitador deployment.
PR has being put together with the changes required. #109
I have been successfully testing limitador-operator
v0.6.0
, and I have identified a possible not intended credentials leak in the deployment container command.I deployed the following CR called
cluster
:Then redis storage is configured on an external secret with the connection string set at
URL
, and I guess it is a secret and not a configmap, because connection string to connect to redis might have use user/password:However, instead of mounting the secret on the deployment and extract the
URL
into possibly an ENVVAR, it is taking theURL
from the secret, and configure it directly on the container command showing its plain value (even if it possibly has a secret password):My recommendation would be to extract its value like any standard deployment and inject it on an ENVVAR maybe, something similar to:
And then, you will need also to update how to use its value from the container command.
The text was updated successfully, but these errors were encountered: