Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pkg/builtinchecks/yamls/insecure-route-termination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: insecure-route-termination
description: >-
OpenShift Route allows plaintext HTTP via InsecureEdgeTerminationPolicy: Allow.
Credential-bearing endpoints should enforce TLS by using Redirect or None.
remediation: >-
Set spec.tls.insecureEdgeTerminationPolicy to 'Redirect' or 'None'.
scope:
objectKinds:
- Any
template: cel-expression
params:
check: >
object.kind == 'Route' &&
has(object.spec.tls) &&
has(object.spec.tls.insecureEdgeTerminationPolicy) &&
object.spec.tls.insecureEdgeTerminationPolicy == 'Allow'
? 'Route allows plaintext HTTP — credential-bearing endpoints should use Redirect or None' : ''
45 changes: 45 additions & 0 deletions tests/checks/insecure-route-termination.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: dont-fire-redirect
spec:
to:
kind: Service
name: my-service
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: dont-fire-none
spec:
to:
kind: Service
name: my-service
tls:
termination: edge
insecureEdgeTerminationPolicy: None
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: fire-allow-insecure
spec:
to:
kind: Service
name: my-service
tls:
termination: edge
insecureEdgeTerminationPolicy: Allow
---
apiVersion: v1
kind: Service
metadata:
name: dont-fire-not-a-route
spec:
type: ClusterIP
ports:
- port: 80
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Loading