Skip to content

Commit

Permalink
Resolve maintainer's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Cereberus committed Oct 30, 2023
1 parent 4a63e93 commit 65ade9b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/generated/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ key: owner
**Enabled by default**: No
**Description**: Indicates when allowPrivilegedContainer SSC set to True
**Description**: Indicates when allowPrivilegedContainer SecurityContextConstraints set to true
**Remediation**: SecurityContextConstraints has AllowPrivilegedContainer set to "true". Using this option is dangerous, please consider using allowedCapabilities instead.
**Remediation**: SecurityContextConstraints has AllowPrivilegedContainer set to "true". Using this option is dangerous, please consider using allowedCapabilities instead. Refer to https://docs.openshift.com/container-platform/4.12/authentication/managing-security-context-constraints.html#scc-settings_configuring-internal-oauth for details.
**Template**: [scc-deny-privileged-container](templates.md#securitycontextconstraints-allowprivilegedcontainer)
Expand Down
4 changes: 2 additions & 2 deletions pkg/builtinchecks/yamls/scc-deny-privileged-container.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "scc-deny-privileged-container"
description: "Indicates when allowPrivilegedContainer SSC set to True"
description: "Indicates when allowPrivilegedContainer SecurityContextConstraints set to true"
remediation: >-
SecurityContextConstraints has AllowPrivilegedContainer set to "true". Using this option is dangerous, please consider using allowedCapabilities instead.
SecurityContextConstraints has AllowPrivilegedContainer set to "true". Using this option is dangerous, please consider using allowedCapabilities instead. Refer to https://docs.openshift.com/container-platform/4.12/authentication/managing-security-context-constraints.html#scc-settings_configuring-internal-oauth for details.
scope:
objectKinds:
- SecurityContextConstraints
Expand Down
5 changes: 1 addition & 4 deletions pkg/templates/sccdenypriv/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ func init() {
Instantiate: params.WrapInstantiateFunc(func(p params.Params) (check.Func, error) {
return func(_ lintcontext.LintContext, object lintcontext.Object) []diagnostic.Diagnostic {
state, found := extract.SCCallowPrivilegedContainer(object.K8sObject)
if !found {
return nil
}
if state == p.AllowPrivilegedContainer {
if found && state == p.AllowPrivilegedContainer {
return []diagnostic.Diagnostic{
{Message: fmt.Sprintf("SCC has allowPrivilegedContainer set to %v", state)},
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/templates/sccdenypriv/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ func (s *SCCPrivTestSuite) addSCCWithPriv(name string, allowFlag bool) {
}

func (s *SCCPrivTestSuite) TestPrivFalse() {
const (
acceptableScc = "scc-priv-false"
)
const acceptableScc = "scc-priv-false"

s.addSCCWithPriv(acceptableScc, false)

Expand Down

0 comments on commit 65ade9b

Please sign in to comment.