File tree 4 files changed +23
-8
lines changed
4 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,12 @@ docker run \
51
51
-it \
52
52
--rm \
53
53
--cap-add NET_ADMIN \
54
+ --cap-add SYS_MODULE \
54
55
--device /dev/net/tun:/dev/net/tun \
55
56
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
56
57
--sysctl net.ipv6.conf.all.forwarding=1 \
57
58
-v wg-access-server-data:/data \
58
- -v /lib/modules:/lib/modules \
59
+ -v /lib/modules:/lib/modules:ro \
59
60
-e " WG_ADMIN_PASSWORD=$WG_ADMIN_PASSWORD " \
60
61
-e " WG_WIREGUARD_PRIVATE_KEY=$WG_WIREGUARD_PRIVATE_KEY " \
61
62
-p 8000:8000/tcp \
@@ -87,8 +88,9 @@ helm delete my-release
87
88
Download the the docker-compose.yml file from the repo and run the following command.
88
89
89
90
``` bash
90
- export WG_ADMIN_PASSWORD=" example "
91
+ export WG_ADMIN_PASSWORD=$( tr -cd ' [:alnum:] ' < /dev/urandom | fold -w30 | head -n1 )
91
92
export WG_WIREGUARD_PRIVATE_KEY=" $( wg genkey) "
93
+ echo " Your automatically generated admin password for the wg-access-server's web interface: $WG_ADMIN_PASSWORD "
92
94
93
95
docker-compose up
94
96
```
Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ services:
9
9
container_name : wg-access-server
10
10
cap_add :
11
11
- NET_ADMIN
12
+ - SYS_MODULE
12
13
sysctls :
13
14
net.ipv6.conf.all.disable_ipv6 : 0
14
15
net.ipv6.conf.all.forwarding : 1
15
16
volumes :
17
+ - " /lib/modules:/lib/modules:ro"
16
18
- " wg-access-server-data:/data"
17
19
# - "./config.yaml:/config.yaml" # if you have a custom config file
18
20
environment :
Original file line number Diff line number Diff line change @@ -9,22 +9,33 @@ docker run \
9
9
-it \
10
10
--rm \
11
11
--cap-add NET_ADMIN \
12
+ --cap-add SYS_MODULE \
12
13
--device /dev/net/tun:/dev/net/tun \
13
14
--sysctl net.ipv6.conf.all.disable_ipv6=0 \
14
15
--sysctl net.ipv6.conf.all.forwarding=1 \
15
16
-v wg-access-server-data:/data \
16
- -v /lib/modules:/lib/modules \
17
+ -v /lib/modules:/lib/modules:ro \
17
18
-e " WG_ADMIN_PASSWORD=$WG_ADMIN_PASSWORD " \
18
19
-e " WG_WIREGUARD_PRIVATE_KEY=$WG_WIREGUARD_PRIVATE_KEY " \
19
20
-p 8000:8000/tcp \
20
21
-p 51820:51820/udp \
21
22
ghcr.io/freifunkmuc/wg-access-server:latest
22
23
```
23
24
24
- Make sure you have the ` ip_tables ` and ` ip6_tables ` kernel modules loaded on the host:
25
+ ## Modules
26
+
27
+ If you load the kernel modules ` ip_tables ` and ` ip6_tables ` on the host,
28
+ you can drop the ` SYS_MODULE ` capability and remove the ` /lib/modules ` mount:
25
29
``` bash
26
30
modprobe ip_tables && modprobe ip6_tables
31
+ # Load modules on boot
32
+ echo ip_tables >> /etc/modules
33
+ echo ip6_tables >> /etc/modules
27
34
```
35
+ This is highly recommended, as a container with CAP_SYS_MODULE essentially has root privileges
36
+ over the host system and attacker could easily break out of the container.
37
+
38
+ ## IPv4-only (without IPv6)
28
39
29
40
If you don't want IPv6 inside the VPN network, set ` WG_VPN_CIDRV6=0 ` .
30
41
In this case you can also get rid of the sysctls:
Original file line number Diff line number Diff line change 1
1
# Docker Compose
2
2
3
- You can run wg-access-server using the following example
4
- Docker Compose file.
3
+ You can run wg-access-server using the following example Docker Compose file.
5
4
6
- Checkout the [ configuration docs] ( ../2-configuration.md ) to learn how wg-access-server
7
- can be configured.
5
+ Checkout the [ configuration docs] ( ../2-configuration.md ) to learn how wg-access-server can be configured.
6
+
7
+ Please also read the [ Docker instructions] ( ../1-docker.md ) for general information regarding Docker deployments.
8
8
9
9
``` yaml
10
10
{!../docker-compose.yml!}
You can’t perform that action at this time.
0 commit comments