Skip to content

Commit

Permalink
Merge pull request #14625 from liggitt/scc-volumes
Browse files Browse the repository at this point in the history
Allow setting volumes:["none"] to disallow all volume types in SCC
  • Loading branch information
smarterclayton committed Jun 16, 2017
2 parents 517be84 + 2136bfc commit ca96ee9
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 20 deletions.
2 changes: 1 addition & 1 deletion api/swagger-spec/openshift-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -81054,7 +81054,7 @@
}
},
"volumes": {
"description": "Volumes is a white list of allowed volume plugins. FSType corresponds directly with the field names of a VolumeSource (azureFile, configMap, emptyDir). To allow all volumes you may use '*'.",
"description": "Volumes is a white list of allowed volume plugins. FSType corresponds directly with the field names of a VolumeSource (azureFile, configMap, emptyDir). To allow all volumes you may use \"*\". To allow no volumes, set to [\"none\"].",
"type": "array",
"items": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion pkg/openapi/zz_generated.openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -18273,7 +18273,7 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
},
"volumes": {
SchemaProps: spec.SchemaProps{
Description: "Volumes is a white list of allowed volume plugins. FSType corresponds directly with the field names of a VolumeSource (azureFile, configMap, emptyDir). To allow all volumes you may use '*'.",
Description: "Volumes is a white list of allowed volume plugins. FSType corresponds directly with the field names of a VolumeSource (azureFile, configMap, emptyDir). To allow all volumes you may use \"*\". To allow no volumes, set to [\"none\"].",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
Expand Down
2 changes: 1 addition & 1 deletion pkg/security/scc/byrestrictions.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func volumePointValue(scc *kapi.SecurityContextConstraints) int {
// default case to be non-trivial so we don't have to worry about adding
// volumes in the future unless they're trivial.
case kapi.FSTypeSecret, kapi.FSTypeConfigMap,
kapi.FSTypeEmptyDir, kapi.FSTypeDownwardAPI:
kapi.FSTypeEmptyDir, kapi.FSTypeDownwardAPI, kapi.FSTypeNone:
// do nothing
default:
hasNonTrivialVolume = true
Expand Down
4 changes: 3 additions & 1 deletion vendor/k8s.io/kubernetes/pkg/api/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 18 additions & 6 deletions vendor/k8s.io/kubernetes/pkg/api/v1/defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/k8s.io/kubernetes/pkg/api/v1/defaults_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/k8s.io/kubernetes/pkg/api/v1/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions vendor/k8s.io/kubernetes/pkg/api/validation/validation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca96ee9

Please sign in to comment.