Skip to content

Commit f5339a6

Browse files
feat: update issue map and tomls for kube-linter
1 parent 13078d4 commit f5339a6

File tree

10 files changed

+154
-1
lines changed

10 files changed

+154
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "dangling-servicemonitor"
3+
verbose_name = "dangling-servicemonitor"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when a service monitor's selectors don't match any service. ServiceMonitors are a custom resource only used by the Prometheus operator (https://prometheus-operator.dev/docs/operator/design/#servicemonitor).
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Check selectors and your services.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "job-ttl-seconds-after-finished"
3+
verbose_name = "job-ttl-seconds-after-finished"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when standalone jobs do not set ttlSecondsAfterFinished and when jobs managed by cronjob do set ttlSecondsAfterFinished.
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Set Job.spec.ttlSecondsAfterFinished. Unset CronJob.Spec.JobTemplate.Spec.ttlSecondsAfterFinished.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "liveness-port"
3+
verbose_name = "liveness-port"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when containers have a liveness probe to a not exposed port.
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Check which ports you've exposed and ensure they match what you have specified in the liveness probe.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "pdb-unhealthy-pod-eviction-policy"
3+
verbose_name = "pdb-unhealthy-pod-eviction-policy"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when a PodDisruptionBudget does not explicitly set the unhealthyPodEvictionPolicy field.
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Set unhealthyPodEvictionPolicy to AlwaysAllow. Refer to https://kubernetes.io/docs/tasks/run-application/configure-pdb/#unhealthy-pod-eviction-policy for more information.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "priority-class-name"
3+
verbose_name = "priority-class-name"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when a deployment-like object does not use a valid priority class name
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Set up the priority class name for your object to any accepted values.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "readiness-port"
3+
verbose_name = "readiness-port"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when containers have a readiness probe to a not exposed port.
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Check which ports you've exposed and ensure they match what you have specified in the readiness probe.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "restart-policy"
3+
verbose_name = "restart-policy"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when a deployment-like object does not use a restart policy
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Set up the restart policy for your object to 'Always' or 'OnFailure' to increase the fault tolerance.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "scc-deny-privileged-container"
3+
verbose_name = "scc-deny-privileged-container"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when allowPrivilegedContainer SecurityContextConstraints set to true
9+
10+
<!--more-->
11+
12+
## Remediation
13+
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.
14+
"""
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
title = "startup-port"
3+
verbose_name = "startup-port"
4+
severity = "major"
5+
category = "antipattern"
6+
weight = 70
7+
description = """
8+
Indicates when containers have a startup probe to a not exposed port.
9+
10+
<!--more-->
11+
12+
## Remediation
13+
Check which ports you've exposed and ensure they match what you have specified in the startup probe.
14+
"""

analyzers/kube-linter/utils/issue_map.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,32 @@
151151
},
152152
"writable-host-mount": {
153153
"issue_code": "KUBELIN-W1051"
154+
},
155+
"dangling-servicemonitor": {
156+
"issue_code": "KUBELIN-W1052"
157+
},
158+
"job-ttl-seconds-after-finished": {
159+
"issue_code": "KUBELIN-W1053"
160+
},
161+
"liveness-port": {
162+
"issue_code": "KUBELIN-W1054"
163+
},
164+
"pdb-unhealthy-pod-eviction-policy": {
165+
"issue_code": "KUBELIN-W1055"
166+
},
167+
"priority-class-name": {
168+
"issue_code": "KUBELIN-W1056"
169+
},
170+
"readiness-port": {
171+
"issue_code": "KUBELIN-W1057"
172+
},
173+
"restart-policy": {
174+
"issue_code": "KUBELIN-W1058"
175+
},
176+
"scc-deny-privileged-container": {
177+
"issue_code": "KUBELIN-W1059"
178+
},
179+
"startup-port": {
180+
"issue_code": "KUBELIN-W1060"
154181
}
155-
}
182+
}

0 commit comments

Comments
 (0)