From b3efea151eae2ac5bd9698c6b10ba475b549cf7e Mon Sep 17 00:00:00 2001 From: SporeStack Date: Fri, 1 Apr 2022 01:25:24 +0000 Subject: [PATCH] More aggressive umasking --- CHANGELOG.md | 6 +----- src/sporestack/cli.py | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e967468..f8bbd14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Added - -- Nothing yet. - ### Fixed -- Nothing yet. +- Protect files in ~/.sporestack with aggressive `umask`. ## [6.0.0a1 - 2022-03-31] diff --git a/src/sporestack/cli.py b/src/sporestack/cli.py index ee2060f..19d9345 100644 --- a/src/sporestack/cli.py +++ b/src/sporestack/cli.py @@ -59,6 +59,9 @@ HOME = Path(_home) SPORESTACK_DIR = HOME / ".sporestack" +# Try to protect files in ~/.sporestack +os.umask(0o0077) + cli = typer.Typer(help=HELP) token_cli = typer.Typer() @@ -251,7 +254,6 @@ def save_machine_info(machine_info: Dict[str, Any], overwrite: bool = False) -> """ Save info to disk. """ - os.umask(0o0077) directory = server_info_path() hostname = machine_info["vm_hostname"] json_file = directory / f"{hostname}.json"