From 5899757f6d1deb90681295f1fb73b19e07716e20 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Sun, 12 Aug 2018 20:06:54 +0300 Subject: [PATCH] Use umask 0077 across the process in order to have the created files readable only by the acme-dns user (#102) --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index 1c217cd5..2eb135a1 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( stdlog "log" "net/http" "os" + "syscall" "github.com/julienschmidt/httprouter" "github.com/rs/cors" @@ -15,6 +16,8 @@ import ( ) func main() { + // Created files are not world writable + syscall.Umask(0077) // Read global config var err error if fileIsAccessible("/etc/acme-dns/config.cfg") {