-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from appuio/upgrade-permission-fix
Fix 4.10 cluster upgrades: Create higher prio `privileged` SCC
- Loading branch information
Showing
5 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local inv = kap.inventory(); | ||
// The hiera parameters for the component | ||
local params = inv.parameters.openshift4_config; | ||
|
||
kube._Object('security.openshift.io/v1', 'SecurityContextConstraints', 'privileged-higher-prio') { | ||
metadata+: { | ||
labels+: { | ||
'app.kubernetes.io/managed-by': 'commodore', | ||
'app.kubernetes.io/component': 'openshift4-config', | ||
}, | ||
annotations+: { | ||
'kubernetes.io/description': ||| | ||
Copy of `privileged` with increased priority to be choosen over other custom SCCs. | ||
privileged allows access to all privileged and host features and the ability to run as any user, any group, any fsGroup, and with any SELinux context. | ||
WARNING: this is the most relaxed SCC and should be used only for cluster administration. Grant with caution. | ||
|||, | ||
}, | ||
}, | ||
allowHostDirVolumePlugin: true, | ||
allowHostIPC: true, | ||
allowHostNetwork: true, | ||
allowHostPID: true, | ||
allowHostPorts: true, | ||
allowPrivilegeEscalation: true, | ||
allowPrivilegedContainer: true, | ||
allowedCapabilities: [ | ||
'*', | ||
], | ||
allowedUnsafeSysctls: [ | ||
'*', | ||
], | ||
defaultAddCapabilities: null, | ||
fsGroup: { | ||
type: 'RunAsAny', | ||
}, | ||
groups: [ | ||
'system:cluster-admins', | ||
'system:nodes', | ||
'system:masters', | ||
], | ||
priority: params.clusterUpgradeSCCPermissionFix.priority, | ||
readOnlyRootFilesystem: false, | ||
requiredDropCapabilities: null, | ||
runAsUser: { | ||
type: 'RunAsAny', | ||
}, | ||
seLinuxContext: { | ||
type: 'RunAsAny', | ||
}, | ||
seccompProfiles: [ | ||
'*', | ||
], | ||
supplementalGroups: { | ||
type: 'RunAsAny', | ||
}, | ||
users: [ | ||
'system:admin', | ||
'system:serviceaccount:openshift-infra:build-controller', | ||
], | ||
volumes: [ | ||
'*', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...olden/defaults/openshift4-config/openshift4-config/02_clusterUpgradeSCCPermissionFix.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
allowHostDirVolumePlugin: true | ||
allowHostIPC: true | ||
allowHostNetwork: true | ||
allowHostPID: true | ||
allowHostPorts: true | ||
allowPrivilegeEscalation: true | ||
allowPrivilegedContainer: true | ||
allowedCapabilities: | ||
- '*' | ||
allowedUnsafeSysctls: | ||
- '*' | ||
apiVersion: security.openshift.io/v1 | ||
defaultAddCapabilities: null | ||
fsGroup: | ||
type: RunAsAny | ||
groups: | ||
- system:cluster-admins | ||
- system:nodes | ||
- system:masters | ||
kind: SecurityContextConstraints | ||
metadata: | ||
annotations: | ||
kubernetes.io/description: 'Copy of `privileged` with increased priority to be | ||
choosen over other custom SCCs. | ||
privileged allows access to all privileged and host features and the ability | ||
to run as any user, any group, any fsGroup, and with any SELinux context. | ||
WARNING: this is the most relaxed SCC and should be used only for cluster administration. | ||
Grant with caution. | ||
' | ||
labels: | ||
app.kubernetes.io/component: openshift4-config | ||
app.kubernetes.io/managed-by: commodore | ||
name: privileged-higher-prio | ||
name: privileged-higher-prio | ||
priority: 3 | ||
readOnlyRootFilesystem: false | ||
requiredDropCapabilities: null | ||
runAsUser: | ||
type: RunAsAny | ||
seLinuxContext: | ||
type: RunAsAny | ||
seccompProfiles: | ||
- '*' | ||
supplementalGroups: | ||
type: RunAsAny | ||
users: | ||
- system:admin | ||
- system:serviceaccount:openshift-infra:build-controller | ||
volumes: | ||
- '*' |