fix(store): chmod SQLite DB files to 0600 on open #119
Reference in New Issue
Block a user
Delete Branch "fix/sqlite-umask"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Bare-metal installs created the SQLite DB with the process umask (often 022), making
uptop.db,-wal, and-shmworld-readable. These files contain alert credentials and configuration.Now
os.Chmod(path, 0600)runs on all three files aftersql.Open. Missing WAL/SHM siblings (not yet created by SQLite) are silently skipped viaos.IsNotExist. Docker was already mitigated by the non-root UID 1000.Test plan
go test -count=1 ./...— all passgolangci-lint— 0 issues