AKS icon indicating copy to clipboard operation
AKS copied to clipboard

AKS monitoring addon stores and reveals secret environment variables

Open saykumar opened this issue 8 years ago • 9 comments

What happened: We created a cluster with the monitoring addon enabled. We then went to the log querying interface under Azure Portal -> AKS Cluster -> Monitoring / Logs -> Query Box

We search for ContainerInventory and resulting results have all the environment variables' values visible -- including ones passed as a secret!

What you expected to happen: Not see values of secret environment variables.

How to reproduce it (as minimally and precisely as possible): Create an AKS cluster with monitoring addon, search for ContainerInventory on Azure's log querying interface.

Anything else we need to know?: We don't really care for the values in the variables - would be happy to not have the values of env vars in the logging system at all.

Environment:

  • Kubernetes version (use kubectl version): v1.10.5
  • Size of cluster (how many worker nodes are in the cluster?) 3-10
  • General description of workloads in the cluster (e.g. HTTP microservices, Java app, Ruby on Rails, machine learning, etc.) Microservices
  • Others: NA

saykumar avatar Aug 10 '18 13:08 saykumar

Hi @saykumar,

We are looking into this now. Thank you for the feedback.

jskulavik avatar Aug 10 '18 13:08 jskulavik

@jskulavik any update on this issue? We have prominent customer using AKS for which this is a serious security concern.

Could you imagine having to change all your connection strings and passwords because support staff shouldn’t be seeing this information and could compromise your application. Appreciate an update. Thanks.

griffinbird avatar Oct 25 '18 22:10 griffinbird

@saykumar @griffinbird what would be an acceptable solution? may be we can exclude collecting env vars that start with a prefix like ‘secret’ ? in the future we can also have a regex based blacklist may be?

vishiy avatar Oct 30 '18 00:10 vishiy

@vishiy In our use case, I think we would be fine with skipping environment variables altogether until a blacklist is possible. Is there anyway we can selectively disable the environment variable logging in the OMS agent?

saykumar avatar Oct 31 '18 22:10 saykumar

@saykumar thank you. will take this as feature request.

vishiy avatar Nov 04 '18 19:11 vishiy

@saykumar @griffinbird - We have this feature tested and ready to go out. The way it will work (atleast to start with) is based on an environment variable inside the container, we will either collect or not collect (all) environment variables in that container. I will share the doc soon that will explain this, when changes go out in 1-2-3 weeks or so...

vishiy avatar Dec 07 '18 19:12 vishiy

@saykumar @griffinbird - Please see the below document on how to disable env variables in individual container. https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-manage-agent

Agent changes are being deployed region wise and agents in existing AKS clusters will be auto upgraded in a week or so based on your region. Also, you will get the newest agent if you create a new AKS cluster or upgrade kubernetes in existing clusters.

New agent image is oms:ciprod11292018

vishiy avatar Dec 14 '18 17:12 vishiy

@vishiy Thanks - this is great, we'll test in the coming weeks once we see the agents are updated!

saykumar avatar Dec 14 '18 19:12 saykumar

Closing this issue as old/stale/resolved.

Note: If this issue still comes up, please confirm you are running the latest AKS release. If you are on the latest release and the issue can be re-created outside of your specific cluster please open a new github issue.

If you are only seeing this behavior on clusters with a unique configuration (such as custom DNS/VNet/etc) please open an Azure technical support ticket.

jnoller avatar Apr 04 '19 18:04 jnoller