Skip to content

Commit

Permalink
Grant access to privileged SCC to system:admin user and members of sy…
Browse files Browse the repository at this point in the history
…stem:masters group.

This change improves UX and allows to a member of the sudoer
group to, for example, create a privileged pod using impersonation:

$ oc create -f privileged.pod --as system:admin
  • Loading branch information
php-coder committed Sep 7, 2017
1 parent 1ca9030 commit 9f94f06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/server/bootstrappolicy/securitycontextconstraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ func GetBootstrapSecurityContextConstraints(sccNameToAdditionalGroups map[string
// GetBoostrapSCCAccess provides the default set of access that should be passed to GetBootstrapSecurityContextConstraints.
func GetBoostrapSCCAccess(infraNamespace string) (map[string][]string, map[string][]string) {
groups := map[string][]string{
SecurityContextConstraintPrivileged: {ClusterAdminGroup, NodesGroup},
SecurityContextConstraintPrivileged: {ClusterAdminGroup, NodesGroup, MastersGroup},
SecurityContextConstraintsAnyUID: {ClusterAdminGroup},
SecurityContextConstraintRestricted: {AuthenticatedGroup},
}

buildControllerUsername := serviceaccount.MakeUsername(infraNamespace, InfraBuildControllerServiceAccountName)
pvRecyclerControllerUsername := serviceaccount.MakeUsername(infraNamespace, InfraPersistentVolumeRecyclerControllerServiceAccountName)
users := map[string][]string{
SecurityContextConstraintPrivileged: {buildControllerUsername},
SecurityContextConstraintPrivileged: {SystemAdminUsername, buildControllerUsername},
SecurityContextConstraintHostMountAndAnyUID: {pvRecyclerControllerUsername},
}
return groups, users
Expand Down

0 comments on commit 9f94f06

Please sign in to comment.