Logs are readable by any user on the system by default #3309
Replies: 4 comments 1 reply
|
This should already be covered. Query logging is off by default, so a stock install doesn't record queries at all. You have to uncomment the So if you're seeing The first possibility is that you're looking at The second possibility, and the more likely one if it really is the query log, is that the file already existed before dnscrypt-proxy ever wrote to it. If that's what happened, a |
|
This has to do with what user you are running dnscrypt-proxy as. It also has to do with what directory you choose to put the logs into. |
|
I just renamed the log files and restarted the service, the created files look like this: Auto created My service file looks like this, the only lines i remember editing is adding the wg-quick and pihole stuff near the top. [Unit]
Description=DNSCrypt client proxy
Documentation=https://github.com/DNSCrypt/dnscrypt-proxy/wiki
Wants=pihole-FTL.service
Before=pihole-FTL.service
Wants=wg-quick@wg.service
After=wg-quick@wg.service
Requires=dnscrypt-proxy.socket
[Install]
Also=dnscrypt-proxy.socket
WantedBy=multi-user.target
[Service]
NonBlocking=true
ExecStart=/usr/sbin/dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml
ProtectHome=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectControlGroups=true
MemoryDenyWriteExecute=true
User=_dnscrypt-proxy
CacheDirectory=dnscrypt-proxy
LogsDirectory=dnscrypt-proxy
RuntimeDirectory=dnscrypt-proxyMy config is this, I have edited this but specifically the lines about log file paths were there already (I believe commented out by default) 1
2 listen_addresses = ["127.0.0.1:5030"]
3 server_names = ['libre_dns']
4
5 ipv6_servers = false
6 block_ipv6 = true
7
8 require_dnssec = true
9
10 http3 = true
11 cache = false
12
13 log_level = 3
14 use_syslog = true
15 ignore_system_dns = true
16
17 [blocked_ips]
18 blocked_ips_file = 'blocked-ips.txt'
19
20
21 [query_log]
22 file = '/var/log/dnscrypt-proxy/query.log'
23
24 [nx_log]
25 file = '/var/log/dnscrypt-proxy/nx.log'
26
[...] (only DNS provider configuration follows here so I cut that out.)Using Debian forky Im not too familiar what the umask stuff means, but it appears to be the setting for default file permissions on the system. Maybe this should be set in the service file by default? |
|
Following up on my earlier comment, which I need to correct: I said the log file is created with 600 permissions. That The 644 you're seeing is deliberate, though. dnscrypt-proxy runs under its own dedicated user, _dnscrypt-proxy in your The access control is meant to live on the directory instead. That's the more reliable place for it anyway, since it In your case the directory is created by systemd, through the LogsDirectory=dnscrypt-proxy line in the unit file. Then reload and restart: After that the directory is only accessible to |
Uh oh!
There was an error while loading. Please reload this page.
version 2.1.18
What's happening?
When log files are enabled (unsure whether this is the default, I believe it is), all queries can be read by any user on the system since they use -rw-r--r-- 644 permissions.
When does this occur?
n/a
Where does it happen?
n/a
How do we replicate the issue?
Install dnscrypt-proxy and check file permissions of log files
Expected behavior
Privacy: don't make this accessible to regular users.
Additional context
n/a
All reactions