You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,13 @@ When Newt receives WireGuard control messages, it will use the information encod
33
33
-`endpoint`: The endpoint where both Gerbil and Pangolin reside in order to connect to the websocket.
34
34
-`id`: Newt ID generated by Pangolin to identify the client.
35
35
-`secret`: A unique secret (not shared and kept private) used to authenticate the client ID with the websocket in order to receive commands.
36
+
-`mtu`: MTU for the internal WG interface. Default: 1280
36
37
-`dns`: DNS server to use to resolve the endpoint
37
38
-`log-level` (optional): The log level to use. Default: INFO
38
39
-`updown` (optional): A script to be called when targets are added or removed.
39
40
-`tls-client-cert` (optional): Client certificate (p12 or pfx) for mTLS. See [mTLS](#mtls)
40
41
-`docker-socket` (optional): Set the Docker socket to use the container discovery integration
42
+
-`docker-enforce-network-validation` (optional): Validate the container target is on the same network as the newt process
41
43
42
44
- Example:
43
45
@@ -99,6 +101,26 @@ services:
99
101
- DOCKER_SOCKET=/var/run/docker.sock
100
102
```
101
103
104
+
#### Hostnames vs IPs
105
+
106
+
When the Docker Socket Integration is used, depending on the network which Newt is run with, either the hostname (generally considered the container name) or the IP address of the container will be sent to Pangolin. Here are some of the scenarios where IPs or hostname of the container will be utilised:
107
+
- **Running in Network Mode 'host'**: IP addresses will be used
108
+
- **Running in Network Mode 'bridge'**: IP addresses will be used
109
+
- **Running in docker-compose without a network specification**: Docker compose creates a network for the compose by default, hostnames will be used
110
+
- **Running on docker-compose with defined network**: Hostnames will be used
111
+
112
+
### Docker Enforce Network Validation
113
+
114
+
When run as a Docker container, Newt can validate that the target being provided is on the same network as the Newt container and only return containers directly accessible by Newt. Validation will be carried out against either the hostname/IP Address and the Port number to ensure the running container is exposing the ports to Newt.
115
+
116
+
It is important to note that if the Newt container is run with a network mode of `host` that this feature will not work. Running in `host` mode causes the container to share its resources with the host machine, therefore making it so the specific host container information for Newt cannot be retrieved to be able to carry out network validation.
117
+
118
+
**Configuration:**
119
+
120
+
Validation is `false` by default. It can be enabled via setting the `--docker-enforce-network-validation` CLI argument or by setting the `DOCKER_ENFORCE_NETWORK_VALIDATION` environment variable.
121
+
122
+
If validation is enforced and the Docker socket is available, Newt will **not** add the target as it cannot be verified. A warning will be presented in the Newt logs.
123
+
102
124
### Updown
103
125
104
126
You can pass in a updown script for Newt to call when it is adding or removing a target:
0 commit comments