Commit graph

17 commits

Author SHA1 Message Date
12fd2f2e70 fix(security): prevent username enumeration via timing attack
All checks were successful
continuous-integration/drone/push Build is passing
Perform a dummy LDAP bind when SearchDN fails so that the response time
is indistinguishable between unknown users and wrong passwords.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 12:42:41 +07:00
99def55e80 feat: replace Bootstrap with custom CSS and add profile page
All checks were successful
continuous-integration/drone/push Build is passing
- Add self-hosted style.css replacing Bootstrap CDN dependency
- Add profile.html with tabbed view (account info, emails/aliases, API token)
- Refactor login handler to pass structured data to template instead of building HTML strings
- Add brand-name and brand-logo flags/env vars for UI customization
- Update CSP to allow brand logo domain and remove CDN references
- Update all templates to pass template vars to header/footer and use new CSS classes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 11:49:51 +07:00
439dc2cd07 refactor: modernize Go idioms across codebase
Replace map[string]interface{} with map[string]any, ioutil.ReadAll with
io.ReadAll, and simplify redundant fmt.Sprintf/w.Write calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 11:48:34 +07:00
28f55960de feat(security): add altcha proof-of-work CAPTCHA to all sensitive forms
Integrate go-altcha to protect login, change password, lost password,
and reset password forms against automated submissions. Serves the
altcha widget JS from the embedded library, exposes a challenge
endpoint, validates responses server-side with replay prevention, and
updates the CSP to allow self-hosted scripts and WebAssembly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 10:56:16 +07:00
7b568607a6 fix(security): require configurable secret for X-Special-Auth docker registry bypass
Replace hardcoded "docker-registry" check with a configurable secret via
DOCKER_REGISTRY_SECRET env var. When the env var is unset, the anonymous
docker registry bypass is disabled entirely, closing the unauthenticated
access path if the service is accidentally exposed directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
2a9eec233a fix(security): add per-IP rate limiting to all authentication endpoints
Implement sliding window rate limiter to prevent brute-force attacks:
- /auth and /login: 20 requests/minute per IP
- /change: 10 POST requests/minute per IP
- /lost: 5 POST requests/minute per IP (prevents email spam and user enumeration)
- /reset: 10 POST requests/minute per IP
- /api/v1/aliases: 30 requests/minute per IP

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
93673510d8 fix(security): escape LDAP attribute data in HTML output to prevent XSS (CWE-79)
Use html.EscapeString for attribute names and values when building HTML.
Move dynamic data (alias URL, API token) to data-* attributes and use
a self-contained onclick function to read them, eliminating JS string
injection via LDAP-controlled values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 15:30:48 +07:00
ee1f8ce69f Hide krbPrincipalKey 2026-03-06 15:30:48 +07:00
65d0d4a53e Can delete own aliases 2026-03-06 15:30:48 +07:00
e6a4271a75 Add an API compatibly with addy.io to generate aliases
All checks were successful
continuous-integration/drone/push Build is passing
2024-05-31 16:19:53 +02:00
8be6706460 docker-registry: Also need pass to display /, to have a working UI
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-28 16:36:39 +01:00
e5046b108b Allow login of simpleSecurityObjects
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-15 18:25:11 +02:00
5643713c54 /auth: special case for docker-registry 2021-09-15 18:25:11 +02:00
9a7e8be351 Update module gopkg.in/ldap.v2 to v3
Some checks reported errors
continuous-integration/drone/pr Build was killed
continuous-integration/drone/push Build is passing
2021-08-12 03:32:34 +02:00
e9019026ff Include username in response header (for use by nginx auth_request)
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-11 18:33:14 +02:00
0d0438135c Add route for Basic HTTP auth
All checks were successful
continuous-integration/drone/push Build is passing
2020-09-05 12:20:19 +02:00
b99a321ded Initial commit 2018-11-13 01:14:42 +01:00