-
Notifications
You must be signed in to change notification settings - Fork 37
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 #413 from fmount/httpd_scc
Run neutron httpd sidecar container using NeutronUID
- Loading branch information
Showing
9 changed files
with
85 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
package neutronapi | ||
|
||
import corev1 "k8s.io/api/core/v1" | ||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/utils/ptr" | ||
) | ||
|
||
func getNeutronSecurityContext() *corev1.SecurityContext { | ||
trueVal := true | ||
runAsUser := int64(NeutronUID) | ||
runAsGroup := int64(NeutronGID) | ||
|
||
return &corev1.SecurityContext{ | ||
RunAsUser: &runAsUser, | ||
RunAsGroup: &runAsGroup, | ||
RunAsNonRoot: &trueVal, | ||
RunAsUser: ptr.To(NeutronUID), | ||
RunAsGroup: ptr.To(NeutronGID), | ||
RunAsNonRoot: ptr.To(true), | ||
Capabilities: &corev1.Capabilities{ | ||
Drop: []corev1.Capability{ | ||
"MKNOD", | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func getNeutronHttpdSecurityContext() *corev1.SecurityContext { | ||
runAsUser := int64(0) | ||
|
||
return &corev1.SecurityContext{ | ||
RunAsUser: &runAsUser, | ||
} | ||
} |
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,49 @@ | ||
{ | ||
"command": "/usr/sbin/httpd -DFOREGROUND", | ||
"config_files": [ | ||
{ | ||
"source": "/var/lib/config-data/tls/certs/*", | ||
"dest": "/etc/pki/tls/certs/", | ||
"owner": "neutron:neutron", | ||
"perm": "0640", | ||
"optional": true, | ||
"merge": true | ||
}, | ||
{ | ||
"source": "/var/lib/config-data/tls/private/*", | ||
"dest": "/etc/pki/tls/private/", | ||
"owner": "neutron:neutron", | ||
"perm": "0640", | ||
"optional": true, | ||
"merge": true | ||
}, | ||
{ | ||
"source": "/var/lib/config-data/default/httpd.conf", | ||
"dest": "/etc/httpd/conf/httpd.conf", | ||
"owner": "neutron:apache", | ||
"optional": true, | ||
"perm": "0644" | ||
}, | ||
{ | ||
"source": "/var/lib/config-data/default/10-neutron-httpd.conf", | ||
"dest": "/etc/httpd/conf.d/10-neutron.conf", | ||
"owner": "neutron:apache", | ||
"optional": true, | ||
"perm": "0644" | ||
}, | ||
{ | ||
"source": "/var/lib/config-data/default/ssl.conf", | ||
"dest": "/etc/httpd/conf.d/ssl.conf", | ||
"owner": "neutron:apache", | ||
"optional": true, | ||
"perm": "0644" | ||
} | ||
], | ||
"permissions": [ | ||
{ | ||
"path": "/etc/httpd/run", | ||
"owner": "neutron:apache", | ||
"recurse": true | ||
} | ||
] | ||
} |
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
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