Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
renames namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-santos-code committed Feb 24, 2023
1 parent 913ec0b commit 7d5b684
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion auditors/apparmor/apparmor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestAuditAppArmor(t *testing.T) {
{"apparmor-annotation-init-container-missing.yml", []string{AppArmorAnnotationMissing}, true},
{"apparmor-disabled.yml", []string{AppArmorDisabled}, true},
{"apparmor-disabled-overriden.yml", []string{override.GetOverriddenResultName(AppArmorDisabled)}, true},
// {"apparmor-disabled-overriden-old-label.yml", []string{override.GetOverriddenResultName(AppArmorDisabled)}, true},
{"apparmor-disabled-overriden-old-label.yml", []string{override.GetOverriddenResultName(AppArmorDisabled)}, true},
{"apparmor-disabled-overriden-multiple.yml", []string{AppArmorAnnotationMissing, override.GetOverriddenResultName(AppArmorDisabled)}, true},
// These are invalid manifests so we should only test it in manifest mode as kubernetes will fail to apply it
{"apparmor-bad-value.yml", []string{AppArmorBadValue}, false},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: Pod
metadata:
name: pod
namespace: apparmor-disabled-overriden-old
namespace: apparmor-disabled-overriden-old-label
annotations:
container.apparmor.security.beta.kubernetes.io/container: unconfined
labels:
Expand Down
2 changes: 1 addition & 1 deletion auditors/capabilities/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestAuditCapabilities(t *testing.T) {
CapabilityShouldDropAll,
override.GetOverriddenResultName(CapabilityAdded),
}},
{"capabilities-some-allowed-mix-old-labels.yml", fixtureDir, []string{
{"capabilities-some-allowed-multi-containers-mix-old-labels.yml", fixtureDir, []string{
CapabilityAdded,
CapabilityShouldDropAll,
override.GetOverriddenResultName(CapabilityAdded),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment
namespace: capabilities-some-allowed-multi-containers-mix-labels
namespace: capabilities-some-allowed-multi-containers-mix-old-labels
spec:
selector:
matchLabels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# this is to test backwards compatibility with old unregistered annotations (kubernetes.io)

apiVersion: v1
kind: Namespace
metadata:
name: namespace-missing-default-deny-ingress-netpol-allowed
name: namespace-allow-missing-default-deny-ingress-old-label
labels:
audit.kubernetes.io/namespace.allow-non-default-deny-ingress-network-policy: "SomeReason"
audit.kubeaudit.io/namespace.allow-non-default-deny-ingress-network-policy: "SomeReason"
---
# https://kubernetes.io/docs/concepts/services-networking/network-policies/#default-deny-all-ingress-traffic
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: namespace-missing-default-deny-ingress-netpol-allowed
namespace: namespace-allow-missing-default-deny-ingress-old-label
spec:
podSelector: {}
policyTypes:
Expand Down
4 changes: 2 additions & 2 deletions printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ func (p *Printer) PrintReport(report *Report) {
}

func (p *Printer) prettyPrintReport(report *Report) {
p.printColor(color.YellowColor, p.deprecationWarning)

if len(report.ResultsWithMinSeverity(p.minSeverity)) < 1 {
p.printColor(color.GreenColor, "All checks completed. 0 high-risk vulnerabilities found\n")
return
}

p.printColor(color.YellowColor, p.deprecationWarning)

for _, workloadResult := range report.ResultsWithMinSeverity(p.minSeverity) {
resource := workloadResult.GetResource().Object()
objectMeta := k8s.GetObjectMeta(resource)
Expand Down

0 comments on commit 7d5b684

Please sign in to comment.