aws / aws/amazon-eks-pod-identity-webhook
Random token mount path
- Dominant language
- Go
- Stars
- 691
- Forks
- 202
- Avg merge
- 4h 38m
- Merged PRs (30d)
- 1
Description
**What would you like to be added**:
Currently, the webhook uses the value of `--token-mount-path` (default `/var/run/secrets/eks.amazonaws.com/serviceaccount/token`) to determine where inside the pod the token file should be mounted.
Instead, I would like the ability for the path to the token file to contain a random element (eg. `/var/run/secrets/eks.amazonaws.com/serviceaccount/token-`).
**Why is this needed**:
To prevent [Local File Inclusion](https://brightsec.com/blog/file-inclusion-vulnerabilities/#lfi) attacks. If an attacker knows where the file is and has gained the ability to read files from disk, they can read the token file and potentially assume a role that trusts the service account. If the path is random then they can't do that.
---
I'm checking to see if you would be willing to accept a PR for this feature. If so, I would be happy to submit one.
Contributor guide
Research direction
Start by tracing how the --token-mount-path value is used to mount and expose the service-account token inside the pod. Verify how a random suffix is generated and retained wherever the token path is consumed. Done means the token path includes an unpredictable element while the webhook continues to provide a usable token.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100