I have deployed AKS cluster using : https://learn.microsoft.com/en-us/azure/aks/tutorial-kubernetes-deploy-cluster?tabs=azure-cli
I have 54% secure score & I am getting no. of security alerts in the Microsoft defender for cloud through my security engineer, such as:
- Internet exposed Kubernetes pod is running a container with high severity vulnerabilities.
- Container registry images should have vulnerability findings resolved
- Container images should be deployed from trusted registries only
- Running container images should have vulnerability findings resolved
- Least privileged Linux capabilities should be enforced for containers
- Immutable (read-only) root filesystem should be enforced for containers
- Running containers as root user should be avoided
- Container with privilege escalation should be avoided
- Storage account public access should be disallowed
- Guest accounts with owner permissions on Azure resources should be removed
- Azure Cosmos DB accounts should use Azure Active Directory as the only authentication method
- Kubernetes API server should be configured with restricted access
- Services should listen on allowed ports only
- Container registries should use private link
- Container registries should not allow unrestricted network access
- Storage account should use a private link connection
- Storage accounts should restrict network access using virtual network rules
- Firewall should be enabled on Key Vault
- Access to storage accounts with firewall and virtual network configurations should be restricted
- Subnets should be associated with a network security group
- [Enable if required] Container registries should be encrypted with a customer-managed key (CMK)
- [Enable if required] Storage accounts should use customer-managed key (CMK) for encryption
- [Enable if required] Azure Cosmos DB accounts should use customer-managed keys to encrypt data at rest
- Kubernetes clusters should disable automounting API credentials
I am very new to Kubernetes. I am looking at securing the cluster, but unable to get what things to be prioritize. Can someone help me with the above points or any reference links to execute using cli or terraform.
It would be a great help for me if any links to terraform code in Github which takes care of everything for the public AKS cluster.