Hash the web password and revoke sessions server-side
Store a scrypt hash (migrating a plaintext password without changing it), sign sessions with a generation that ./password and --revoke-all rotate, make logout a same-origin POST that revokes the token, add sign out everywhere, and close proxied websockets whose session ends. Enforce a strength rule for new passwords, back off logins per client and server-wide, check Origin on login, tighten next, add security headers and a __Host- cookie over https.
This commit is contained in:
@@ -73,9 +73,12 @@ class Uninstall:
|
||||
# A custom credential file must actually be a Pipelines login store.
|
||||
if path.exists():
|
||||
data = json.loads(path.read_text())
|
||||
if not isinstance(data, dict) or not isinstance(data.get("password"), str) or not isinstance(data.get("secret"), str):
|
||||
if not isinstance(data, dict) or not isinstance(data.get("password", data.get("password_hash")), str) \
|
||||
or not isinstance(data.get("secret"), str):
|
||||
raise ValueError("Custom web credentials are not a Pipelines password file")
|
||||
roots.add(path)
|
||||
# The proxy's signed-out session list beside it (web/serve.mjs).
|
||||
roots.add(self.safe(path.with_name(path.name + ".sessions.json")))
|
||||
return {self.safe(path) for path in roots}
|
||||
|
||||
def preflight(self):
|
||||
|
||||
Reference in New Issue
Block a user