Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(preflights): add host dns wildcard check #1210

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Changes from all commits
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
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.
Loading