equinor / equinor/radix-platform
Add exception: Least privileged Linux capabilities should be enforced for containers [Medium]
- Dominant language
- HCL
- Stars
- 2
- Forks
- 0
- Avg merge
- 18h 5m
- Merged PRs (30d)
- 10
Description
To reduce attack surface of your container, restrict Linux capabilities and grant specific privileges to containers without granting all the privileges of the root user. We recommend dropping all capabilities, then adding those that are required.
- [ ] **Add exception for nginx**
Sample from list:
ingress-nginx/ingress-nginx-controller-597555d48f-qsjmf
Others needs to be remediated
Manual remediation:
1. Make sure lists of dropped capabilities and allowed capabilities are configured, via the security policy parameters. Recommend to set parameter 'Required drop capabilities' as ["ALL"] to enforce to drop all capabilities. The recommendation by default will only block to add capacities.
2. From the Unhealthy resources tab, select the cluster. Defender for Cloud lists the running containers with capabilities outside the configured list.
3. Limit the containers' Linux capabilities. To add or remove Linux capabilities for a container, include a capabilities section in the securityContext section of the container manifest with the relevant capabilities set e.g. Drop: ALL ; add: ["NET_ADMIN", "SYS_TIME"]. Read more [1](https://snyk.io/blog/kubernetes-securitycontext-linux-capabilities/), [2](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-capabilities-for-a-container)
4. After making your changes, redeploy the pod with the updated capabilities.
Contributor guide
Research direction
Start by locating the policy configuration that evaluates Linux capabilities and inspect the ingress-nginx/ingress-nginx-controller resource named in the issue. Review the Kubernetes securityContext capabilities guidance and confirm how an nginx exception is represented; done means the nginx resource is exempted while other unhealthy resources remain subject to the configured drop and allowed-capability rules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, nginx
- Domain
- devops, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100