Skip to content

Commit

Permalink
feat(preflights): add host dns wildcard check (#1210)
Browse files Browse the repository at this point in the history
* add host dns wildcard check

* update from code review

* rebase

* update message

* update message
  • Loading branch information
nvanthao authored Oct 14, 2024
1 parent fd08366 commit d39db4a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pkg/preflights/host-preflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ spec:
- -c
- |
[ -d "{{ .DataDir }}" ] && [ -L "{{ .DataDir }}" ] && echo "{{ .DataDir }} is a symlink" || echo "{{ .DataDir }} is not a symlink"
- dns:
collectorName: 'wildcard-check'
hostnames:
- '*'
analyzers:
- cpu:
checkName: CPU
Expand Down Expand Up @@ -403,7 +407,7 @@ spec:
outcomes:
- fail:
when: "true"
message: "Neither 'nameserver localhost' nor 'nameserver 127.0.0.1' can be present in resolv.conf. Remove them to continue."
message: "Local DNS resolver detected. Remove the localhost and/or 127.0.0.1 nameserver entries from resolv.conf."
- pass:
when: "false"
message: "Neither 'nameserver localhost' nor 'nameserver 127.0.01' is present in resolv.conf"
Expand Down Expand Up @@ -763,3 +767,16 @@ spec:
- pass:
when: 'false'
message: {{ .DataDir }} is not a symlink.
- jsonCompare:
checkName: Wildcard DNS
fileName: host-collectors/dns/wildcard-check/result.json
path: 'resolvedFromSearch'
value: |
""
outcomes:
- fail:
when: 'false'
message: 'Wildcard DNS entry *.{{ "{{" }} .resolvedFromSearch {{ "}}" }} detected. Remove the wildcard DNS entry or the {{ "{{" }} .resolvedFromSearch {{ "}}" }} search domain from resolv.conf.'
- pass:
when: 'true'
message: No wildcard DNS entry detected.

0 comments on commit d39db4a

Please sign in to comment.