File permissions on snapshot files created by consul
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
### `consul version` for both Client and Server(Same version used for both client and server)
Client: `0.7.5`
Server: `0.7.5`
### `consul Info`
Server:
agent:
check_monitors = 0
check_ttls = 1
checks = 1
services = 2
build:
prerelease =
revision = ''
version = 0.7.5
consul:
bootstrap = false
known_datacenters = 1
leader = false
leader_addr = 10.200.212.15:5825
server = true
raft:
applied_index = 11008
commit_index = 11008
fsm_pending = 0
last_contact = 84.552463ms
last_log_index = 11008
last_log_term = 14
last_snapshot_index = 8192
last_snapshot_term = 2
latest_configuration = [{Suffrage:Voter ID:10.200.212.15:5825 Address:10.200.212.15:5825} {Suffrage:Voter ID:10.200.212.14:5825 Address:10.200.212.14:5825} {Suffrage:Voter ID:10.200.212.13:5825 Address:10.200.212.13:5825}]
latest_configuration_index = 9247
num_peers = 2
protocol_version = 1
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 14
runtime:
arch = amd64
cpu_count = 8
goroutines = 59
max_procs = 8
os = linux
version = go1.8
serf_lan:
encrypted = true
event_queue = 0
event_time = 4
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 9
members = 3
query_queue = 0
query_time = 1
serf_wan:
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 1
members = 1
query_queue = 0
query_time = 1
### Operating system and Environment details
RHEL 7.2
### Description of the Issue (and unexpected/desired result)
I see the files and snapshots created for consul have world-readable/executable flags:
eg:
-rwxr-xr-x. 1 cuser cgrp 967 May 8 10:01 /absolute/path/to/peers.info
-rw-r--r--. 1 cuser cgrp 394 May 8 10:01 /absolute/path/to/checkpoint-signature
snapshot files
-rw-r--r--. 1 cuser cgrp 16534 Jul 16 10:05 /absolute/path/to/raft/snapshots/192-720915-1500199526622/state.bin
-rw-r--r--. 1 cuser cgrp 491 Jul 16 10:05 /absolute/path/to/raft/snapshots/192-720915-1500199526622/meta.json
-rw-r--r--. 1 cuser cgrp 16534 Jul 16 10:05 /absolute/path/to/raft/snapshots/192-720917-1500199542557/state.bin
-rw-r--r--. 1 cuser cgrp 491 Jul 16 10:05 /absolute/path/to/raft/snapshots/192-720917-1500199542557/meta.json
-rwxr-xr-x. 1 cuser cgrp 4961 Jul 17 08:27 /absolute/path/to/serf/local.snapshot
-rwxr-xr-x. 1 cuser cgrp 95202 Jul 17 08:27 /absolute/path/to/serf/remote.snapshot
-rwxr-xr-x. 1 cuser cgrp 103286 Jul 17 08:27 /absolute/path/to/serf/local.snapshot
-rwxr-xr-x. 1 cuser cgrp 128579 Jul 17 08:27 /absolute/path/to/serf/remote.snapshot
Is it possible to forbid any read access of these Consul configurations by other unprivileged user in order to not leak sensible settings?
I had asked the same question in consul googlegroups, but did not get any response, so filing a bug to see if this can be addressed.
### Desired result:
Avoid giving world-readable read/write/execute access on above mentioned files.
### Reproduction steps
Just starting consul agent would suffice.
### Log Fragments or Link to [gist](https://gist.github.com/)
NA
Contributor guide
Assessment
This issue has not been assessed yet.