From f92eaf99bacf80a09c6f78901ed6ed617006c4af Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 26 Mar 2024 10:58:25 -0400 Subject: [PATCH] Add security warning --- scripts/ewp-secrets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/ewp-secrets b/scripts/ewp-secrets index 82002af..de85477 100755 --- a/scripts/ewp-secrets +++ b/scripts/ewp-secrets @@ -29,6 +29,9 @@ class __SecretManager(ABC): @abstractmethod def load(self, namespace: str, key: str) -> Optional[str]: ... + + def is_secure(self) -> bool: + return True class GnomeKeyringSM(__SecretManager): @@ -117,6 +120,8 @@ class FilesystemSM(__SecretManager): return result[0] return None + def is_secure(self) -> bool: + return False class EwpSecrets: def __init__(self): @@ -165,6 +170,8 @@ def main() -> int: # Perform the requested action if args.action == "store": + if not secrets.secret_managers[0].is_secure(): + print("Warning: This system does not have a secure way to store secrets", file=sys.stderr) secret = input("Enter the secret: ") secrets.store(args.namespace, args.key, secret) return 0