Commit f8e35af
committed
discourse-doctor: prevent others from reading sensitive log content
The log file is world-readable until the script finished, while sensitive settings are written to it at the very start. If the container is not running, a rebuild is done, which can leave the file with sensitive content world-readable for quite a long time.
This commit makes the log file readable to root only, while the script is running, and applies default mode only after sensitive content has been reducted, for convenience and to remain a non-breaking change.
An alternative would be to redact sensitive content right after it was written, in the `get_discourse_config()` function, but it would require more code and sensitive content might be printed later as well if a rebuild is done.
Signed-off-by: MichaIng <[email protected]>1 parent c73028a commit f8e35af
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| |||
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
355 | | - | |
| 357 | + | |
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
| |||
0 commit comments