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

Commit

Permalink
genevive's feedback: clean up annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-santos-code committed Feb 27, 2023
1 parent eba0895 commit 896f2b6
Show file tree
Hide file tree
Showing 56 changed files with 112 additions and 118 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ The `key` is a combination of the override type (container or pod) and an `overr
1. **Container overrides**, which override the auditor for that specific container, are formatted as follows:

```yaml
container.audit.kubeaudit.io/[container name].[override identifier]
container.kubeaudit.io/[container name].[override identifier]
```

2. **Pod overrides**, which override the auditor for all containers within the pod, are formatted as follows:

```yaml
audit.kubeaudit.io/pod.[override identifier]
kubeaudit.io/[override identifier]
```

If the `value` is set to a non-empty string, it will be displayed in the `info` result as the `OverrideReason`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
annotations:
container.apparmor.security.beta.kubernetes.io/container2: unconfined
labels:
container.audit.kubeaudit.io/container2.allow-disabled-apparmor: "SomeReason"
container.kubeaudit.io/container2.allow-disabled-apparmor: "SomeReason"
spec:
containers:
- name: container
Expand Down
2 changes: 1 addition & 1 deletion auditors/apparmor/fixtures/apparmor-disabled-overriden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
annotations:
container.apparmor.security.beta.kubernetes.io/container: unconfined
labels:
container.audit.kubeaudit.io/container.allow-disabled-apparmor: "SomeReason"
container.kubeaudit.io/container.allow-disabled-apparmor: "SomeReason"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
metadata:
labels:
name: replicationcontroller
audit.kubeaudit.io/pod.allow-automount-service-account-token: "SomeReason"
kubeaudit.io/allow-automount-service-account-token: "SomeReason"
spec:
automountServiceAccountToken: false
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
metadata:
labels:
name: replicationcontroller
audit.kubeaudit.io/pod.allow-automount-service-account-token: "SomeReason"
kubeaudit.io/allow-automount-service-account-token: "SomeReason"
spec:
automountServiceAccountToken: true
containers:
Expand Down
2 changes: 1 addition & 1 deletion auditors/capabilities/fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestFixCapabilities(t *testing.T) {
},
{
testName: "Pod override",
overrides: []string{override.GetPodOverrideLabel(getOverrideLabel("orange"))},
overrides: []string{override.GetOverrideLabel(getOverrideLabel("orange"))},
add: []string{"orange"},
expectedAdd: []string{"orange"},
drop: []string{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ spec:
metadata:
labels:
name: deployment
container.audit.kubeaudit.io/container1.allow-capability-chown: "SomeReason"
container.audit.kubeaudit.io/container1.allow-capability-sys-time: "SomeReason"
container.audit.kubeaudit.io/container2.allow-capability-chown: "SomeReason"
container.audit.kubeaudit.io/container2.allow-capability-sys-time: "SomeReason"
container.kubeaudit.io/container1.allow-capability-chown: "SomeReason"
container.kubeaudit.io/container1.allow-capability-sys-time: "SomeReason"
container.kubeaudit.io/container2.allow-capability-chown: "SomeReason"
container.kubeaudit.io/container2.allow-capability-sys-time: "SomeReason"
spec:
containers:
- name: container1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ spec:
metadata:
labels:
name: deployment
audit.kubeaudit.io/pod.allow-capability-chown: "SomeReason"
container.audit.kubeaudit.io/container1.allow-capability-chown: "SomeReason"
container.audit.kubeaudit.io/container1.allow-capability-sys-time: "SomeReason"
container.audit.kubeaudit.io/container2.allow-capability-sys-time: "SomeReason"
kubeaudit.io/allow-capability-chown: "SomeReason"
container.kubeaudit.io/container1.allow-capability-chown: "SomeReason"
container.kubeaudit.io/container1.allow-capability-sys-time: "SomeReason"
container.kubeaudit.io/container2.allow-capability-sys-time: "SomeReason"
spec:
containers:
- name: container1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
metadata:
labels:
name: deployment
container.audit.kubeaudit.io/container1.allow-capability-chown: "SomeReason"
container.audit.kubeaudit.io/container1.allow-capability-sys-time: "SomeReason"
container.kubeaudit.io/container1.allow-capability-chown: "SomeReason"
container.kubeaudit.io/container1.allow-capability-sys-time: "SomeReason"
spec:
containers:
- name: container1
Expand Down
4 changes: 2 additions & 2 deletions auditors/capabilities/fixtures/capabilities-some-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
metadata:
labels:
name: deployment
audit.kubeaudit.io/pod.allow-capability-chown: "SomeReason"
audit.kubeaudit.io/pod.allow-capability-sys-time: "SomeReason"
kubeaudit.io/allow-capability-chown: "SomeReason"
kubeaudit.io/allow-capability-sys-time: "SomeReason"
spec:
containers:
- name: container
Expand Down
2 changes: 1 addition & 1 deletion auditors/hostns/fixtures/host-ipc-true-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
namespace: host-ipc-true-allowed
labels:
audit.kubeaudit.io/pod.allow-namespace-host-IPC: "SomeReason"
kubeaudit.io/allow-namespace-host-IPC: "SomeReason"
spec:
hostIPC: true
containers:
Expand Down
2 changes: 1 addition & 1 deletion auditors/hostns/fixtures/host-network-true-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
namespace: host-network-true-allowed
labels:
audit.kubeaudit.io/pod.allow-namespace-host-network: "SomeReason"
kubeaudit.io/allow-namespace-host-network: "SomeReason"
spec:
hostNetwork: true
containers:
Expand Down
2 changes: 1 addition & 1 deletion auditors/hostns/fixtures/host-pid-true-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
namespace: host-pid-true-allowed
labels:
audit.kubeaudit.io/pod.allow-namespace-host-PID: "SomeReason"
kubeaudit.io/allow-namespace-host-PID: "SomeReason"
spec:
hostPID: true
containers:
Expand Down
6 changes: 3 additions & 3 deletions auditors/hostns/fixtures/namespaces-all-true-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: pod
namespace: namespaces-all-true-allowed
labels:
audit.kubeaudit.io/pod.allow-namespace-host-network: "SomeReason"
audit.kubeaudit.io/pod.allow-namespace-host-IPC: "SomeReason"
audit.kubeaudit.io/pod.allow-namespace-host-PID: "SomeReason"
kubeaudit.io/allow-namespace-host-network: "SomeReason"
kubeaudit.io/allow-namespace-host-IPC: "SomeReason"
kubeaudit.io/allow-namespace-host-PID: "SomeReason"
spec:
hostPID: true
hostIPC: true
Expand Down
2 changes: 1 addition & 1 deletion auditors/hostns/fixtures/namespaces-redundant-override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
namespace: namespaces-redundant-override
labels:
audit.kubeaudit.io/pod.allow-namespace-host-network: "SomeReason"
kubeaudit.io/allow-namespace-host-network: "SomeReason"
spec:
hostNetwork: false
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: pod
labels:
name: pod
container.audit.kubeaudit.io/container1.allow-host-path-mount-proc-volume: "SomeReason"
container.audit.kubeaudit.io/container2.allow-host-path-mount-proc-volume: "SomeReason"
container.kubeaudit.io/container1.allow-host-path-mount-proc-volume: "SomeReason"
container.kubeaudit.io/container2.allow-host-path-mount-proc-volume: "SomeReason"
namespace: proc-mounted-allowed-multi-containers-multi-labels
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
container.audit.kubeaudit.io/container1.allow-host-path-mount-proc-volume: "SomeReason"
container.kubeaudit.io/container1.allow-host-path-mount-proc-volume: "SomeReason"
namespace: proc-mounted-allowed-multi-containers-single-label
spec:
containers:
Expand Down
2 changes: 1 addition & 1 deletion auditors/mounts/fixtures/proc-mounted-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
audit.kubeaudit.io/pod.allow-host-path-mount-proc-volume: "SomeReason"
kubeaudit.io/allow-host-path-mount-proc-volume: "SomeReason"
namespace: proc-mounted-allowed
spec:
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Namespace
metadata:
name: namespace-missing-default-deny-egress-netpol-allowed
labels:
audit.kubeaudit.io/namespace.allow-non-default-deny-egress-network-policy: "SomeReason"
kubeaudit.io/allow-non-default-deny-egress-network-policy: "SomeReason"
---
# https://kubernetes.io/docs/concepts/services-networking/network-policies/#default-deny-all-ingress-traffic
apiVersion: networking.k8s.io/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Namespace
metadata:
name: namespace-missing-default-deny-ingress-netpol-allowed
labels:
audit.kubeaudit.io/namespace.allow-non-default-deny-ingress-network-policy: "SomeReason"
kubeaudit.io/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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ kind: Namespace
metadata:
name: namespace-missing-default-deny-netpol-allowed
labels:
audit.kubeaudit.io/namespace.allow-non-default-deny-egress-network-policy: "SomeReason"
audit.kubeaudit.io/namespace.allow-non-default-deny-ingress-network-policy: "SomeReason"
kubeaudit.io/allow-non-default-deny-egress-network-policy: "SomeReason"
kubeaudit.io/allow-non-default-deny-ingress-network-policy: "SomeReason"
---
# https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/07-allow-traffic-from-some-pods-in-another-namespace.md
kind: NetworkPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
metadata:
labels:
name: deployment
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: pod
labels:
name: pod
container.audit.kubeaudit.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.audit.kubeaudit.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-non-root-psc-false-allowed-multi-containers-multi-labels
spec:
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
container.audit.kubeaudit.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-non-root-psc-false-allowed-multi-containers-single-label
spec:
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-non-root-psc-false-allowed
spec:
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
metadata:
labels:
name: deployment
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-non-root-redundant-override-pod
spec:
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion auditors/nonroot/fixtures/run-as-user-0-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
metadata:
labels:
name: deployment
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
name: pod
labels:
name: pod
container.audit.kubeaudit.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.audit.kubeaudit.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-user-psc-0-allowed-multi-containers-multi-labels
spec:
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
container.audit.kubeaudit.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-user-psc-0-allowed-multi-containers-single-label
spec:
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion auditors/nonroot/fixtures/run-as-user-psc-0-allowed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-user-psc-0-allowed
spec:
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
metadata:
labels:
name: deployment
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: pod
labels:
name: pod
audit.kubeaudit.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-run-as-root: "SuperuserPrivilegesNeeded"
namespace: run-as-user-redundant-override-pod
spec:
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
metadata:
labels:
name: statefulset
audit.kubeaudit.io/pod.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
kubeaudit.io/allow-privilege-escalation: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
metadata:
labels:
name: statefulset
audit.kubeaudit.io/pod.allow-privilege-escalation: ""
kubeaudit.io/allow-privilege-escalation: ""
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ spec:
metadata:
labels:
name: statefulset
container.audit.kubeaudit.io/container1.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
container.audit.kubeaudit.io/container2.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container1.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container2.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
metadata:
labels:
name: statefulset
container.audit.kubeaudit.io/container2.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
container.kubeaudit.io/container2.allow-privilege-escalation: "SuperuserPrivilegesNeeded"
spec:
containers:
- name: container1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
metadata:
labels:
name: daemonset
audit.kubeaudit.io/pod.allow-privileged: "SomeReason"
kubeaudit.io/allow-privileged: "SomeReason"
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ spec:
metadata:
labels:
name: daemonset
container.audit.kubeaudit.io/container1.allow-privileged: "SomeReason"
container.audit.kubeaudit.io/container2.allow-privileged: "SomeReason"
container.kubeaudit.io/container1.allow-privileged: "SomeReason"
container.kubeaudit.io/container2.allow-privileged: "SomeReason"
spec:
containers:
- name: container1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
metadata:
labels:
name: daemonset
container.audit.kubeaudit.io/container2.allow-privileged: "SomeReason"
container.kubeaudit.io/container2.allow-privileged: "SomeReason"
spec:
containers:
- name: container1
Expand Down
Loading

0 comments on commit 896f2b6

Please sign in to comment.