Commit e217d97
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 <micha@dietpi.com>1 parent 0d9189d commit e217d97
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
| |||
348 | 350 | | |
349 | 351 | | |
350 | 352 | | |
| 353 | + | |
| 354 | + | |
351 | 355 | | |
352 | 356 | | |
353 | 357 | | |
| |||
0 commit comments