Skip to content

Commit

Permalink
Improve documentations regarding accept/deny lists
Browse files Browse the repository at this point in the history
  • Loading branch information
michielp1807 authored and davidv1992 committed Sep 12, 2024
1 parent 121479e commit 2639253
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/guide/migrating-chrony.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ filter = [
action = "deny"
```

The allow and deny list configuration is optional in ntpd-rs. By default, a server accepts traffic from anywhere. When configuring both allow and deny lists, ntpd-rs will first check if a remote is on the deny list. Only if this is not the case will the allow list be considered. This ordering needs to be taken into account when translating interleaved combinations of chrony's `allow` and `deny` commands.
The allow and deny list configurations are both optional in ntpd-rs. By default, a server accepts traffic from anywhere. When configuring both allow and deny lists, ntpd-rs will first check if a remote is on the deny list. Only if this is not the case will the allow list be considered. This ordering needs to be taken into account when translating interleaved combinations of chrony's `allow` and `deny` commands.

NTS can be enabled for a server by configuring an NTS key exchange server:
```toml
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/migrating-ntpd.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ filter = [
action = "deny"
```

The allow and deny list configuration is optional in ntpd-rs. By default, if a server is configured it will accept traffic from anywhere. When configuring both allow and deny lists, ntpd-rs will first check if a remote is on the deny list. Only if this is not the case will the allow list be considered.
The allow and deny list configurations are both optional in ntpd-rs. By default, if a server is configured it will accept traffic from anywhere. When configuring both allow and deny lists, ntpd-rs will first check if a remote is on the deny list. Only if this is not the case will the allow list be considered.

The `allowlist.action` and `denylist.action` properties can have two values:

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/migrating-ntpsec.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ filter = [
action = "deny"
```

The allow and deny list configuration is optional in ntpd-rs. By default, if a server is configured it will accept traffic from anywhere. When configuring both allow and deny lists, ntpd-rs will first check if a remote is on the deny list. Only if this is not the case will the allow list be considered.
The allow and deny list configurations are both optional in ntpd-rs. By default, if a server is configured it will accept traffic from anywhere. When configuring both allow and deny lists, ntpd-rs will first check if a remote is on the deny list. Only if this is not the case will the allow list be considered.

The `allowlist.action` and `denylist.action` properties can have two values:

Expand Down
34 changes: 30 additions & 4 deletions docs/guide/server-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ address = "<your server ip>:123"
```

## Limiting access
If you only want specific ip addresses to be able to access the server, you can
If you only want specific IP addresses to be able to access the server, you can
configure a list of allowed clients through the allowlist mechanism. For this,
edit the server configuration to look like:
```toml
Expand All @@ -30,9 +30,35 @@ listen = "0.0.0.0:123"
filter = ["<allowed ipv4 1>/32", "<allowed ipv4 2>/32", "<allowed ipv6 1>/128"]
action = "ignore"
```
When configured this way, your server will only respond to the listed ip
addresses. You can allow entire subnets at a time by specifying the size of the
subnet instead of 32 or 128 after the slash.
When configured this way, your server will only respond to the listed IP
addresses. The IP addresses are written in CIDR notation, which means you can
allow entire subnets at a time by specifying the size of the subnet instead of
the 32 or 128 after the slash. For example, `192.168.1.1/24` will allow any IP
address of the form `192.168.1.*`.

If you want to block certain IP addresses from accessing the server, you can
configure a list of blocked clients as follows:
```toml
[[server]]
listen = "0.0.0.0:123"
[server.denylist]
filter = ["<blocked ipv4 1>/32", "<blocked ipv4 2>/32", "<blocked ipv6 1>/128"]
action = "deny"
```
The deny list uses the same CIDR notion as the allow list, and can also be used
to block subnets. Connections from IP addresses contained in the deny list will
always be blocked, even if they also happen to be in the allow list.

The allow and deny list configurations are both optional in ntpd-rs. By
default, if a server is configured it will accept traffic from anywhere. When
configuring both allow and deny lists, ntpd-rs will first check if a remote is
on the deny list. Only if this is not the case will the allow list be
considered.

The `allowlist.action` and `denylist.action` properties can have two values:

- `ignore` silently ignores the request
- `deny` sends a deny kiss-o'-death packet

## Adding your server to the NTP pool

Expand Down
1 change: 1 addition & 0 deletions docs/includes/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
*[CA]: Certificate Authority
*[OS]: Operating System
*[DNS]: Domain Name System
*[CIDR]: Classless Inter-Domain Routing

0 comments on commit 2639253

Please sign in to comment.