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

Fixes #37604 - Validate DNS forwarders #260

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jun 27, 2024

A user can input an invalid value and the service will refuse to start up. We can catch this in data types, preventing service downtime.

A user can input an invalid value and the service will refuse to start
up. We can catch this in data types, preventing service downtime.
Comment on lines +6 to +11
type Dns::Forwarder = Variant[
Pattern[/\A([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])){3}(\s+port\s+[0-9]{1,5})?\z/],
Stdlib::IP::Address::V6::Nosubnet,
# This is a really gross simplification of IPv6
Pattern[/(\A(:{0,2}[[:xdigit:]]{1,4}){1,8}\s+port\s[0-9]{1,5}\Z)/],
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, it can also be <ip> port <int> tls <name> and similar:
https://bind9.readthedocs.io/en/latest/reference.html#namedconf-statement-forwarders

Well, at least since 9.19.10: https://bind9.readthedocs.io/en/v9.19.10/notes.html#new-features

I don't think we need to care right now, but in the future

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see that in man named.conf on Fedora 39

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fedora still has 9.18.something

@ekohl ekohl merged commit 3f53f46 into theforeman:master Jul 5, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants