Add security warning
This commit is contained in:
parent
e388438e05
commit
f92eaf99ba
@ -30,6 +30,9 @@ class __SecretManager(ABC):
|
|||||||
@abstractmethod
|
@abstractmethod
|
||||||
def load(self, namespace: str, key: str) -> Optional[str]: ...
|
def load(self, namespace: str, key: str) -> Optional[str]: ...
|
||||||
|
|
||||||
|
def is_secure(self) -> bool:
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class GnomeKeyringSM(__SecretManager):
|
class GnomeKeyringSM(__SecretManager):
|
||||||
|
|
||||||
@ -117,6 +120,8 @@ class FilesystemSM(__SecretManager):
|
|||||||
return result[0]
|
return result[0]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def is_secure(self) -> bool:
|
||||||
|
return False
|
||||||
|
|
||||||
class EwpSecrets:
|
class EwpSecrets:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -165,6 +170,8 @@ def main() -> int:
|
|||||||
|
|
||||||
# Perform the requested action
|
# Perform the requested action
|
||||||
if args.action == "store":
|
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: ")
|
secret = input("Enter the secret: ")
|
||||||
secrets.store(args.namespace, args.key, secret)
|
secrets.store(args.namespace, args.key, secret)
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user