
Summary
Key points of this document
- Where are the design challenges?
- How to define the boundaries
- Details that matter in implementation
Overview
When placing an admin site on the internet, it's insufficient for it to be accessible only to those who know the URL. You need to create a boundary using Google authentication, etc., allowing only authorized users to enter. For the defense of a private admin site, you must consider not just adding a login screen, but also multi-layered aspects like entry points, sessions, permissions, and auditing.
Where are the design challenges?
For small admin sites, it's often assumed that as long as the public URL isn't shared, everything will be fine. However, URLs can leak even if they don't appear in search results. An admin screen without authentication poses a risk of information exposure.
When delivering as a static site, there might not be a server-side mechanism to authenticate each request. Data requiring authentication must be protected on the API side, and the design should ensure that static HTML does not contain sensitive information.
Unlike publicly accessible pages, the very existence of certain features on an admin site can be confidential information. The design must consider not only preventing login but also how much information to return when unauthenticated, and what to display on error screens.
How to define the boundaries
Identity is verified with Google authentication, and the application side checks for authorized users or domains. The management API validates authentication tokens and does not return data to unauthorized users. The UI switches its display based on the login status.
In the design, we separate hosting entry points, authentication, internal permissions, and API access. Authentication is done with Firebase or Google OAuth, and the application side separately determines if a user is authorized and what operations they can perform.
Details that matter in implementation
Even when using Firebase Authentication or OAuth integration, token validation is performed on the API side. The list of authorized users is managed in settings or a database, allowing for immediate invalidation upon resignation or change of responsibility.
On the React side, the authentication state is restored on initial load, displaying unverified, not logged in, unauthorized, and available as separate states. The API side validates ID tokens and sessions, checking administrator privileges every time.
- Not only frontend route guards, but also always perform permission checks on the API side.
- Log login attempts by unauthorized users to the audit log.
- Do not expose unnecessary information in the admin site's robots, cache, or error messages.
Observing how it breaks
During verification, we check for unlogged-in users, unauthorized users, expired tokens, direct URL access, and direct API calls. We also check build artifacts to ensure no sensitive data is embedded in static files.
During verification, we check for unlogged-in users, unauthorized accounts, suspended permissions, expired tokens, and direct API access. We test that the API is rejecting access, not just that the screen is hidden.
Discarded options and trade-offs
For admin screens requiring strong protection, a configuration with server-side authentication is more suitable than just static delivery. For lighter admin sites, a combination of an authenticated API and a static UI can be a practical solution.
Relying on Google authentication simplifies operations but depends on external account management. Having internal allow lists and roles makes it easier to adapt to operational changes, but also requires managing the admin screen itself.
Decision criteria to leave for the team
Private admin sites are protected by authentication and permissions, not by hiding URLs. Even when using static delivery, it's crucial to design with a focus on validation on the API side that returns data.
A private admin site isn't secure just by adding authentication. By passing the same permission judgment from the entry point to the API, it becomes a quiet yet robust admin screen.


