-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow access to sealed secret services/proxy to any authenticated user #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Is it worth also adding a large, obvious notice where the http mux is configured in httpserver
warning that it must never expose anything secret because of the default rbac?
controller.jsonnet
Outdated
], | ||
resourceNames: [ | ||
'http:sealed-secrets-controller:', // kubeseal uses net.JoinSchemeNamePort when crafting proxy subresource URLs | ||
'sealed-secrets-controller', // but often services are referred by name only, let's not make it unnecessary cryptic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/unnecessary/unnecessarily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@atomatt as I mentioned in the PR description, even before this RBAC change leaking secrets was a terrible idea. That said, it doesn't hurt to add such a warning in the code |
This allows kubeseal to fetch the certificate public key (and perform other actions such as /verify and /rotate endpoints) even if the caller doesn't have otherwise the rights to access the kube-system namespace (or any other namespace where the sealed-secrets controller might have been deployed), as it often happens that users are not granted such broad permissions on production clusters. We historically suggested users to just distribute the certificate out of bound and use the `--cert` flag. However, with the advent of master key rotation, this is becoming increasingly more cumbersome, especially since it's critical that users end up using the right certificate (i.e. the certificate has to be authenticated). Master key rotation also requires users to periodically rotate the secrets, which requires access to the /rotate endpoint. This change includes a fine-grained RBAC rule that allows access to the sealed-secrets controller HTTP API to any authenticated user in the cluster. Users are still free to disable this feature by applying an override during deployment, but our default RBAC config should include it. The controller currently exposes the following endpoints: - `/healthz' - `/v1/verify` - `/v1/rotate` - `/v1/cert.pem` The controller already must not expose any secrets via the HTTP endpoint, since while RBAC would prevent end-users to access the service via the proxy, nothing prevents any unprivileged workload in the cluster unless admins have explicitly configured a strict network policy rule set. Closes #166
bors r+ |
208: Allow access to sealed secret services/proxy to any authenticated user r=mkmik a=mkmik This allows kubeseal to fetch the certificate public key (and perform other actions such as /verify and /rotate endpoints) even if the caller doesn't have otherwise the rights to access the kube-system namespace (or any other namespace where the sealed-secrets controller might have been deployed), as it often happens that users are not granted such broad permissions on production clusters. We historically suggested users to just distribute the certificate out of bound and use the `--cert` flag. However, with the advent of master key rotation, this is becoming increasingly more cumbersome, especially since it's critical that users end up using the right certificate (i.e. the certificate has to be authenticated). Master key rotation also requires users to periodically rotate the secrets, which requires access to the /rotate endpoint. This change includes a fine-grained RBAC rule that allows access to the sealed-secrets controller HTTP API to any authenticated user in the cluster. Users are still free to disable this feature by applying an override during deployment, but our default RBAC config should include it. The controller currently exposes the following endpoints: - `/healthz' - `/v1/verify` - `/v1/rotate` - `/v1/cert.pem` The controller already must not expose any secrets via the HTTP endpoint, since while RBAC would prevent end-users to access the service via the proxy, nothing prevents any unprivileged workload in the cluster unless admins have explicitly configured a strict network policy rule set. Closes #166 Rel #137 Co-authored-by: Marko Mikulicic <[email protected]>
Build succeeded |
This allows kubeseal to fetch the certificate public key (and perform other actions such as /verify and /rotate endpoints) even if the caller doesn't have otherwise the rights to access the kube-system namespace (or any other namespace where the sealed-secrets controller might have been deployed), as it often happens that users are not granted such broad permissions on production clusters.
We historically suggested users to just distribute the certificate out of bound and use the
--cert
flag.However, with the advent of master key rotation, this is becoming increasingly more cumbersome, especially since
it's critical that users end up using the right certificate (i.e. the certificate has to be authenticated).
Master key rotation also requires users to periodically rotate the secrets, which requires access to the /rotate endpoint.
This change includes a fine-grained RBAC rule that allows access to the sealed-secrets controller HTTP API to any authenticated user in the cluster.
Users are still free to disable this feature by applying an override during deployment, but our default RBAC config should include it.
The controller currently exposes the following endpoints:
/v1/verify
/v1/rotate
/v1/cert.pem
The controller already must not expose any secrets via the HTTP endpoint, since while RBAC would prevent
end-users to access the service via the proxy, nothing prevents any unprivileged workload in the cluster unless
admins have explicitly configured a strict network policy rule set.
Closes #166
Rel #137