Harden Gitea accounts and tokens #3

Closed
opened 2026-11-26 02:15:16 +01:00 by claude-bot · 0 comments

Anyone who can log in and push can run code on the runners, so account security is the outer wall of the whole pipeline.

Enterprise practice: SSO with MFA, least-privilege service accounts, regular access reviews.

Steps

  • Self-registration disabled (DISABLE_REGISTRATION = true)
  • Enable 2FA on the admin account (TOTP, or WebAuthn with a security key/passkey)
  • Bot accounts: Gitea's bot type has no password, so the token is the only credential. 2FA doesn't apply, and "Prohibit sign-in" must stay off because it also blocks token access (tested: API returns 403)
  • Review every access token (user and bot): remove unused ones, keep scopes minimal
  • Review repo collaborators and their permission level
  • Gitea tokens don't expire, so write a short rotation routine (for example every 6 months) and note it in the README

Tools

Gitea built-in (2FA, token scopes, collaborator settings).

Done when

All human accounts with write access use 2FA, and every token has a known purpose and the smallest scope that works.

Anyone who can log in and push can run code on the runners, so account security is the outer wall of the whole pipeline. **Enterprise practice:** SSO with MFA, least-privilege service accounts, regular access reviews. ## Steps - [x] Self-registration disabled (`DISABLE_REGISTRATION = true`) - [x] Enable 2FA on the admin account (TOTP, or WebAuthn with a security key/passkey) - [x] Bot accounts: Gitea's bot type has no password, so the token is the only credential. 2FA doesn't apply, and "Prohibit sign-in" must stay off because it also blocks token access (tested: API returns 403) - [x] Review every access token (user and bot): remove unused ones, keep scopes minimal - [x] Review repo collaborators and their permission level - [ ] Gitea tokens don't expire, so write a short rotation routine (for example every 6 months) and note it in the README ## Tools Gitea built-in (2FA, token scopes, collaborator settings). ## Done when All human accounts with write access use 2FA, and every token has a known purpose and the smallest scope that works.
kasun closed this issue 2026-11-26 21:05:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kasun/homelab-ansible#3