Open micahlee opened 5 years ago
From @shaharglazner regarding:
Can you place a quota constraint on a memory volumes in k8s?
Individual secrets are limited to 1MiB in size. This is to discourage creation of very large secrets which would exhaust apiserver and kubelet memory. However, creation of many smaller secrets could also exhaust memory. More comprehensive limits on memory usage due to secrets is a planned feature.
(From: https://kubernetes.io/docs/concepts/configuration/secret/)
From @shaharglazner regarding:
Can we encrypt the secrets at rest (a shared key between the sidecar and the app)
https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/
Risk of storing storing secrets in K8s secrets manager
- Encryption of etcd is the responsibility of the K8s cluster operator.
- Sidecar will attempt to delete secrets when the pod stops, but is not guaranteed.
This is how most k8s developers would prefer we provide secrets to them. It would make the product easier to use - something it could definitely benefit from. :) However it goes against good security hygiene as mapping secrets to container env vars exposes them as plain text in tools like Weave Scope. If this route is taken, healthy caveats/warnings/disclaimers must be included.
It would be most awesome if there were a way to poke secrets into shell environment variables, as Aqua does.
Roping in @doodlesbykumbi and @sgnn7. Since Secretless imports these libraries and we don't sufficiently test that use case here, I'd like to make sure any changes related to this issue are on the radar of the Secretless team.
POC Branches
Acceptance Criteria
[x] Existing sidecar behavior is maintained
init container
and as a persistentsidecar
[x] Sidecar executes on a periodic basis to:
secrets.yml
file mounted as a volume to the sidecar container[ ] Fetching frequency is configurable
[ ] Secret value is exactly the value stored in Conjur with no additional whitespace (e.g. newline) and no removed whitespace
[ ] Summon failure and reason for failure are clear in the sidecar logs, at least no less than what summon provides in the output.
Volume mount secret is updated after Summon fetches within a known elapsed time.
Risk of storing storing secrets in K8s secrets manager
[ ] Sidecar works on Stock OSS Kubernetes and OpenShift (for all supported versions)
[ ] Automated Unit Tests include:
[ ] K8s secrets API interactions
[ ] Secrets volume interactions
[ ] Conjur Authentication (Which should already exists)
[ ] Summon interaction (Conjur Secret Retrieval)
[ ] Secrets.yml via config map
[ ] Large secret data:
[ ] Sidecar container contains only what is needed for execution
[ ] The two sidecar responsibilities are clearly separated in code
[ ] The documentation clearly explains:
[ ] Container logs are clear and informative
Open Questions
Open Questions
Can you place a quota constraint on a memory volumes in k8s?
What happens if the application container has a write lock on the secret file when the sidecar attempts to update it?
Pre-stop hook for pod?
Is there an issue if we delete the secrets in the pre-stop hook?
Should the sidecar attempt to delete secret files upon termination?
Review documentation for what an application developer should expect from the secrets in the volume mount. with @Yvonne
If the call to summon fails (network/permissions)
Can we detect that the volume is a memory volume?
Follow Up Work
Ideas for follow on improvement work are:
Adding security scanning to CI
Risk of Appliance/OSS DOS load handling
Can we encrypt the secrets at rest (a shared key between the sidecar and the app)
Bump to "Wow" for overall OpenShift Conjur developer experience
K8s-conjur-demo
should be a one line deploymentWarn if using a volume type other than EmptyDir, memory backed
How to create a K8s Role instead of a ClusterRole?
Look into using a volume implementation for fetching secrets
Mounted Secrets are updated automatically
.Make demo scripts configurable rather than deploy all demos at once.
Demo scripts should be more self-documenting (e.g.
--dry-run
). See: conjurdemos/kubernetes-conjur-demo#66