lab7: исправления по прогону своих тестов (таймаут Valkey с TLS 1,0 с, проверки по alias, GET вместо EXISTS), черновик REPORT, сборщик доказательств
This commit is contained in:
@@ -120,7 +120,8 @@ def test_secrets_are_not_stored_in_plain_text(api):
|
||||
hashed = "session:" + hashlib.sha256(actor["token"].encode()).hexdigest()
|
||||
script = ('read -r REDISCLI_AUTH; export REDISCLI_AUTH; read -r k1; read -r k2; '
|
||||
'c="valkey-cli --tls --cacert /run/secrets/internal-ca.crt -h localhost --user api --no-auth-warning"; '
|
||||
'$c exists "$k1"; $c exists "$k2"')
|
||||
# GET, not EXISTS: the ACL of `api` allows only the commands the API uses
|
||||
'for k in "$k1" "$k2"; do [ -n "$($c get "$k")" ] && echo 1 || echo 0; done')
|
||||
pw = (ROOT / "secrets" / "valkey_api_password").read_text(encoding="utf-8").strip()
|
||||
out = subprocess.run(["docker", "compose", "exec", "-T", "valkey", "sh", "-c", script], cwd=ROOT, capture_output=True,
|
||||
input=f"{pw}\n{hashed}\nsession:{actor['token']}\n".encode()).stdout.decode().split()
|
||||
|
||||
Reference in New Issue
Block a user