-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer:
Airgap Installer (may take a few minutes before the airgap bundle is built):
Happy debugging! |
@nvanthao please do not run linting on a code base in the some change as your actual change. This PR has several changes from " to ' which are not related to this in any way. It's also undesirable to have every person's personal inter changing things back and forth on every PR causing unnecessary noise in the change history. If you can undo your linting and just submit the changed portions. |
pkg/preflights/host-preflight.yaml
Outdated
outcomes: | ||
- fail: | ||
when: 'false' | ||
message: 'Possible wildcard DNS entry detected at: {{ "{{" }} .resolvedFromSearch {{ "}}" }} . Remove the search domain OR remove the wildcard DNS entry.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not going to write a code suggestion because I can't test it easily, but here is my desired output (open to suggestions too):
Wildcard DNS entry *.foo.testcluster.net detected. Remove the wildcard DNS entry or the foo.testcluster.net search domain from resolv.conf.
pkg/preflights/host-preflight.yaml
Outdated
@@ -367,17 +371,30 @@ spec: | |||
regex: 'nameserver\s*(localhost|127\.0\.0\.1)' | |||
outcomes: | |||
- fail: | |||
when: "true" | |||
when: 'true' | |||
message: "Neither 'nameserver localhost' nor 'nameserver 127.0.0.1' can be present in resolv.conf. Remove them to continue." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes me wonder if we should reword this one a bit to match more closely. If this wording looks right.
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." |
78bb11f
to
ebfe34c
Compare
Hi @chris-sanders, I've made the request changes. Please let me know how it goes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That addresses my comments I'm good now.
I just ran this, and I think there are a few issues with the templating. It looks like this:
The quickest fix might be to remove the period from the end of the templating (that just seems wrong to me), and then remove the templating from the second sentence. It would be nice if we could be specific about which search domain to remove, but I don't want to say it with a period at the beginning if that's not what will be in resolv.conf. |
The I will create a seperate PR in troubleshoot repo to trim the prefix and suffix That being said, please let me know if there's any changes required in this PR. |
6ab57c9
to
a2917ab
Compare
PR created and merged in troubleshoot repo replicatedhq/troubleshoot#1629 |
01d6acb
to
b216bd7
Compare
Hi @ajp-io, could you help me with the review? |
Can you show me a screenshot of what a failure looks like? |
b216bd7
to
2901c1c
Compare
pkg/preflights/host-preflight.yaml
Outdated
outcomes: | ||
- fail: | ||
when: 'false' | ||
message: 'Wildcard DNS entry {{ "{{" }} .resolvedFromSearch {{ "}}" }} detected. Remove the wildcard DNS entry or the {{ "{{" }} .resolvedFromSearch {{ "}}" }} search domain from resolv.conf.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wildcard DNS entry would look like this, right?
message: 'Wildcard DNS entry {{ "{{" }} .resolvedFromSearch {{ "}}" }} detected. Remove the wildcard DNS entry or the {{ "{{" }} .resolvedFromSearch {{ "}}" }} search domain from resolv.conf.' | |
message: 'Wildcard DNS entry *.{{ "{{" }} .resolvedFromSearch {{ "}}" }} detected. Remove the wildcard DNS entry or the {{ "{{" }} .resolvedFromSearch {{ "}}" }} search domain from resolv.conf.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you did it backwards. The asterisk would be before the period. *.example.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, it's updated now.
2901c1c
to
80de68a
Compare
111f790
to
d44025e
Compare
5bc4e75
to
2669a7a
Compare
What this PR does / why we need it:
Add Host DNS Wildcard preflight check
Demo: https://asciinema.org/a/F2BtS3GLpIz0K4CqoaPpnyZeI
Which issue(s) this PR fixes:
Does this PR require a test?
NONE
Does this PR require a release note?
NONE
Does this PR require documentation?
NONE