Skip to content
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

Merged
merged 1 commit into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/controller/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type certProvider func() []*x509.Certificate
type secretChecker func([]byte) (bool, error)
type secretRotator func([]byte) ([]byte, error)

// httpserver starts an HTTP that exposes core functionality like serving the public key
// or secret rotation and validation. This endpoint is designed to be accessible by
// all users of a given cluster. It must not leak any secret material.
func httpserver(cp certProvider, sc secretChecker, sr secretRotator) {
httpRateLimiter := rateLimter()

Expand Down
27 changes: 27 additions & 0 deletions controller.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ controller {
],
},

serviceProxierRole: kube.Role('sealed-secrets-service-proxier') + $.namespace {
rules: [
{
apiGroups: [
'',
],
resources: [
'services/proxy',
],
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 unnecessarily cryptic
],
verbs: [
'get',
],
},
],
},

unsealerBinding: kube.ClusterRoleBinding('sealed-secrets-controller') {
roleRef_: $.unsealerRole,
subjects_+: [$.account],
Expand All @@ -48,6 +68,13 @@ controller {
subjects_+: [$.account],
},

serviceProxierBinding: kube.RoleBinding('sealed-secrets-service-proxier') + $.namespace {
roleRef_: $.serviceProxierRole,
// kube.libsonnet assumes object here have a namespace, but system groups don't
// thus are not supposed to use the magic "_" here.
subjects+: [kube.Group('system:authenticated')],
},

controller+: {
spec+: {
template+: {
Expand Down