mirror of
https://github.com/narrrl/narl-workspace.git
synced 2026-11-04 00:47:01 +01:00
login: guessing from elsewhere no longer slows a browser already in use
The login throttle was one counter for everyone, so a stranger failing on purpose every thirty seconds kept the owner on 429s too. A browser that logs in now gets a signed diary_device cookie (__Host- over HTTPS, SameSite=Strict, 400 days), and a login carrying a valid one is slowed only by its own throttle. Everything else shares the anonymous one, as before. At most 64 known browsers are tracked; the least recently used is forgotten first. The failed-login mail says which kind of browser the failures came from.
This commit is contained in:
1 parent
165561f6a2
commit
fe1b12042d
6 files changed
+190
-23
No files matched your search
@@ -604,6 +604,14 @@ runtime dependencies, no build tools on the host. The server will not start
|
||||
while `WORKSPACE_SECRET` or `WORKSPACE_PASSWORD` is still the example from
|
||||
`.env.example`: with the example secret anyone could sign themselves a session.
|
||||
|
||||
Wrong passwords are answered more and more slowly — free for three, then 1 s,
|
||||
2 s, 4 s… up to 30 s. A browser that has logged in before keeps a signed
|
||||
`diary_device` cookie (`__Host-diary_device` over HTTPS) and is slowed only by
|
||||
its own mistakes, so someone guessing at the login from elsewhere cannot keep
|
||||
you out of a browser you already use. A browser that has never logged in waits
|
||||
in the same line as the guesses. The cookie opens nothing and survives
|
||||
logging out.
|
||||
|
||||
With `WORKSPACE_SECURE_COOKIE=1` the session cookie is `Secure` and named
|
||||
`__Host-diary_session`, so the browser keeps it to this host and HTTPS, and every
|
||||
response carries `Strict-Transport-Security` for a year. Turning it on logs
|
||||
|
||||
Reference in new issue
Block a user