Strapi security hardening

A self-hosted Strapi exposes an admin panel and public APIs that need separate controls. This page covers what to lock down, in what order, and how to verify it.

On this page

Why Strapi security hardening goes beyond the default install

A Strapi project that already runs on your own infrastructure still needs a security review before go-live or a compliance assessment, because a working install and a hardened one are different things. Strapi exposes two attack surfaces that need separate treatment. The first is the admin panel, used by editors, developers and administrators. The second is the REST or GraphQL API, which serves public visitors, front-end applications and any end users who authenticate through the Users and Permissions plugin. Each surface has its own roles, permissions and tokens, and a setting that looks harmless in one can expose content or write access in the other. Treat the admin panel and the API as two separate reviews, not one checklist.

Hardening also reaches beyond the application. The database account, the hosting layer (reverse proxy, TLS, network reachability of the admin panel and the database port), the secrets and environment files, and the dependency chain of Strapi and its plugins all carry risk. Confirm with your team which of these your organization is responsible for, because the controls available differ by plan. The Community Edition is free under the MIT Expat license, while audit logs and review workflows are Enterprise features and SSO for the admin panel is an add-on on Growth or included in Enterprise, according to Strapi's self-hosted pricing page. If your compliance evidence depends on audit logging or centralized admin sign-in, ask for those features in your plan quote before the design is fixed, since adding them later changes the architecture and the evidence you can produce.

Which Strapi settings and extension points carry the risk

Most Strapi exposure comes from a few places: what anonymous and signed-in end users can reach, what each API token may do, who can sign in to the admin panel, and how configuration and secrets are loaded. Work through these in order, because a permissive public role or a broad token can undo protections set elsewhere.

Users and Permissions roles

The Users and Permissions plugin defines the Public role for anonymous requests and an Authenticated role for logged-in end users. Check every content type and action under each role, including find, findOne, create, update and delete, and confirm that the Public role grants only the read endpoints the front end truly needs. Also review custom routes, since a route can be exposed without the default permission pattern you expect.

Strapi SSO docs

API token scope

API tokens carry their own permissions, separate from end-user roles. Confirm that each token is read only where possible, that full-access tokens are not used by front ends, and that tokens are scoped to the content types they serve. Record who owns each token, where it is stored, and how it is rotated when a developer or integration changes.

Admin panel roles and access

Administrator accounts control content types, plugins, and permissions, so they carry the highest privilege in the system. Review which roles can change content type schemas and users, remove stale administrator accounts, and confirm that admin login uses your identity provider where the plan supports it. Decide whether the admin panel is reachable from the public internet or only from a controlled network.

Server, admin, middleware and database config

The files config/server.js, config/admin.js, config/middlewares.js and config/database.js set the host, the admin URL, the middleware stack and the database connection. Check that production settings do not inherit development defaults, that the admin path and session settings match your policy, and that the database user has only the privileges the application needs. Treat changes to these files as reviewed code changes.

Secrets in environment variables

Keys such as the app keys, the admin JWT secret, the API token salt and the database password belong in environment variables or a secrets manager, not in committed files. Confirm that every instance has unique values, that no default placeholder survives into production, and that rotating a secret has a documented procedure and a test on a staging copy first.

CORS and rate limiting in the middleware stack

CORS and rate limiting are set in the middleware stack, so their order and configuration decide which requests are checked. Restrict CORS origins to the exact front-end domains, avoid wildcards on authenticated routes, and confirm that rate limits apply to login, password reset and public query endpoints. Test each rule with requests from an unlisted origin and with bursts, because a misplaced middleware can silently allow traffic.

Decisions to make before hardening: admin login, token model and hosting layer

This table compares the three decisions that shape a Strapi hardening plan: how administrators log in, how API tokens are scoped, and where rate limiting and request controls live. Read each row as a fork: the right side depends on who needs access, how many people administer the panel, and what evidence your assessors will ask for. Most teams should settle these choices before changing any permissions, because each one changes the work that follows.

DecisionOptionWhen it fits and what it costs operationally
Admin panel loginLocal administrator accounts onlyFits small administrator groups with few changes in staff. No SSO add-on cost, but you manage passwords, offboarding and any MFA policy inside Strapi. Confirm your MFA approach with Strapi before relying on it.
Admin panel loginAdmin SSO on the Growth add-on or Enterprise planFits organizations that centralize identity in an identity provider. SSO is an add-on for Growth and included in Enterprise, so it adds a recurring license cost. Offboarding and role mapping become identity provider tasks, which must be tested.
Admin panel loginSSO with local login locked outFits teams that want one login path for administrators. Confirm the lock-out and break-glass procedure before enabling it, or an identity provider outage can block all administration.
API token modelRead-only tokens for front-end and build consumersFits public content delivery, static builds and preview readers. Lowest blast radius, but every consumer needs its own token so revocation stays targeted.
API token modelFull-access tokens for write integrationsFits sync jobs or import tools that create or update entries. Each token needs a named owner, a rotation date and a documented purpose, because a leaked full-access token can alter content.
Rate limiting and request controlsReverse proxy or API gatewayFits teams that already run a gateway or load balancer and want limits, CORS rules and logging in one place. Adds an infrastructure component to configure, monitor and patch.
Rate limiting and request controlsApplication middleware inside StrapiFits single-instance deployments with few network layers. Keeps configuration with the code, but limits are tied to Strapi releases and may not see traffic that a proxy already absorbs.
Audit loggingCommunity Edition with proxy and database logsFits teams with modest traceability needs who can prove access through infrastructure logs. Confirm with your auditor whether application-level records of administrator actions are required.
Audit loggingEnterprise plan with audit logsFits regulated environments that must show who changed content, roles or settings inside Strapi. Audit logs are an Enterprise feature, so the plan cost should be compared against the evidence gap it closes.

Hardening sequence from admin exposure to dependency patching

This sequence moves from the least exposed surfaces to the most routine work: first map what is reachable, then close the admin panel, public permissions, tokens, secrets, browser access, rate limits, runtime support and patching. Each step ends with a check the team can repeat after every release.

  1. Inventory roles and public endpoints

    Start by listing every content type, every role (including the Public role and any authenticated end-user role), every custom route or controller, and every plugin that exposes an API. Your team or your partner should record which endpoints answer without a token, which ones write data, and which ones return draft or private fields. Keep this list in version control so later steps can be checked against it. Done means you can state, for each endpoint, who can call it and with which method. Check: send an unauthenticated request to each listed endpoint from outside your network and confirm the response matches the inventory.

  2. Lock the admin panel to trusted paths

    Decide where administrators reach the admin panel, then restrict it. Common options are a private network, a VPN, or a reverse proxy that allows only known addresses and terminates TLS. Confirm the admin login path is not reachable from the open internet unless your policy explicitly allows it, and that the proxy sets allowed origins for the admin host. If you use administrator single sign-on, confirm local login lock-out is configured as your policy requires; Strapi's SSO documentation describes that option, and the SSO plan requirement is covered in the SSO topic. Check: from an unapproved network, the admin URL should fail to load or be refused at the proxy, and from an approved network, login should succeed.

  3. Review public role permissions per field

    Go through the Public role and each authenticated role content type by content type and action by action. Remove find or findOne access that is not needed for the front end, disable create, update and delete for anonymous users, and check whether sensitive fields such as internal notes, author emails or unpublished relations are returned. Strapi's permission screens and your custom controllers both affect what is returned, so test the live response rather than trusting the settings page alone. Check: for each public endpoint, compare the raw JSON response with the field list your front end needs, and confirm no unexpected fields or write methods are open to anonymous calls.

  4. Scope API tokens to the minimum

    Review every API token in the admin panel. Remove tokens that no system uses, give each remaining token the smallest type and scope that its integration requires, and set expiry or rotation according to your policy. Prefer separate tokens per integration so one leak does not expose every consumer. Record the owner and purpose of each token. Check: list all tokens, confirm each one maps to a named integration, and run a test call with each token to verify it can perform only the actions its scope allows.

  5. Move secrets into environment variables and a secret store

    Find secrets in configuration files, repositories, container images and build logs. Strapi reads keys such as the app keys, JWT secrets and database credentials from configuration that should come from environment variables, so move each of them out of source files and into your deployment platform or secret manager. Generate new values for any secret that has ever been committed or shared, and restrict who can read the store. Check: search the repository and built images for known secret values and confirm none are found, and confirm the running process receives the values from the environment at startup.

  6. Set CORS to explicit origins

    Replace any wildcard or broad origin list with the exact front-end origins that must call the API, including staging and preview domains only when they are needed. Keep credentials disabled unless a documented flow requires them. Remember that CORS controls browser access only, so it does not replace token checks or permissions. Check: send a request with an origin that is not on the list and confirm the browser-facing response does not grant it, then send one from an approved origin and confirm it is allowed.

  7. Add rate limits at the edge and in the application

    Apply request limits at the reverse proxy or load balancer for public routes, especially authentication, search and any endpoint that is expensive to answer. Add application-level limits where your deployment or Strapi middleware supports them, and confirm the limits reflect the traffic your front end generates. Your team should decide the thresholds from its own traffic data, since no thresholds are set here. Check: send a burst of requests above the chosen threshold from one address and confirm the proxy returns a rate-limited response and logs the event.

  8. Confirm supported Node.js and database versions

    Check the Node.js version against the Strapi 5 installation requirements, which state that Strapi runs only on Active or Maintenance LTS Node.js versions. Confirm the database is PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later, or SQLite 3, because Strapi 5 does not support MongoDB or other NoSQL databases. Plan upgrades of the runtime and database on a schedule that your platform team owns. Check: run the version commands on the production host and in the container image, and confirm both match the supported ranges listed in the installation documentation.

  9. Set a patching routine

    Define who watches Strapi release notes, npm advisories and plugin updates, how often they review them, and how a security fix moves to staging and then production. Strapi 5 minor releases have shipped frequently, so a routine that tests each update in a staging copy of the application and database is more practical than ad hoc updates. Include Node.js security releases and the database engine in the same routine. Check: run a dependency audit against the lock file, record the result with a date and owner, and confirm a test deployment of the latest patch in staging passes your permission and token checks from the earlier steps.

What drives hardening effort and how to keep it down

This table lists the factors that expand or shrink a Strapi hardening engagement and the levers that keep each one manageable. Read each row as a question to answer about your own project before requesting a quote. The main takeaway is that most effort comes from breadth of public exposure, so narrowing endpoints and reusing a small role model usually reduces work more than any single tool choice.

DriverWhy it changes effortHow to keep it down
Content types and endpointsEach content type generates REST and GraphQL read and write paths that need a permission decision and a test case.Expose only the content types front ends need, and disable unused GraphQL operations and public create or update actions.
Roles and custom controllersEvery role and every custom controller or route needs its own permission review, and custom code bypasses default checks.Reuse one small role model across content types, and document which custom routes are public and why.
Front ends and integrations calling the APIEach consumer adds a token or public access path, CORS origin and rate profile to review.Use one read-only public token per front end where possible, and list every allowed origin explicitly.
Custom pluginsPlugin code runs inside the Strapi process, so reviewers must read its routes, services and lifecycle hooks for input handling and data exposure.Limit the number of custom plugins, keep them small, and confirm each one follows the Strapi plugin permission model.
Number of environmentsDevelopment, staging and production each carry separate secrets, admin accounts, database access and network rules to verify.Keep configuration in environment variables, generate distinct secrets per environment, and use the same config template everywhere.
Admin panel and identity exposureAdmin access paths, SSO settings and local login fallback each need separate checks, and SSO is a paid add-on or Enterprise feature.Restrict admin network access where your model allows, and confirm the SSO and local login lock-out settings before go-live.
Compliance evidence requirementsAssessors often ask for role matrices, change records, dependency reports and log samples, which must be produced and kept current.Agree the evidence list at the start, generate role and permission exports on a schedule, and retain logs in your own systems.

How hardening differs for single node, load-balanced and air-gapped deployments

A single Strapi server behind a reverse proxy is the simplest model to reason about. One process holds the admin panel, the REST and GraphQL APIs and the database connection, so most hardening decisions sit in one place: the proxy configuration, the environment file and the host firewall. Rate limiting and session state are local to the process, which keeps them easy to test but also means a single misconfiguration affects the whole service.

  • Proxy as the only public entry point: Bind the Strapi process to a private interface and let the reverse proxy terminate TLS and forward only the paths you intend to expose.
  • Admin panel path: Decide whether the admin panel is reachable from the internet at all, or only from a management network or VPN.
  • Rate limits at the edge: Enforce request limits in the proxy as well as in Strapi, so floods are dropped before they reach the application.
  • Local secrets and config: Keep the environment file readable only by the service account and confirm that no secret is committed to the application repository.
  • Patch path on one host: Plan a maintenance window for dependency updates, since a single node has no peer to take traffic during a restart.

Confirm with your platform team which proxy settings are actually in force, which host firewall rules apply, and who owns the restart procedure for the node.

Access control and secrets controls that matter most

Most Strapi exposure comes from a small set of settings: who can reach the admin panel, what anonymous visitors can call, which tokens exist, and where secrets live. Each card below names one control, what to check, and how to confirm it in your own environment before an assessor or attacker does.

Admin panel isolation

The admin panel is a separate attack surface from the public API. Decide whether it should be reachable from the internet at all, or only through a VPN, private network or allowlisted address range at the reverse proxy. Check that the /admin path is blocked for external networks and that administrator accounts use strong authentication. If you use admin SSO, confirm whether local login is locked out.

Strapi SSO docs

Least-privilege public role

The public role applies to anyone who calls the API without a token, so every permission ticked there is open to the internet. Review each content type and each action (find, findOne, create, update, delete), and grant only the reads the front end needs. Test the live API anonymously to confirm that unpublished content, admin-only fields and write actions return the responses you expect.

API token scope and rotation

API tokens are long-lived credentials that carry the permissions of their assigned role. Create one token per consuming service, scope each to read-only or the narrowest write set, and record its owner and purpose. Confirm how tokens are rotated and revoked, and that a removed front end or integration loses access on the same day.

Database and upload credential separation

The database user that Strapi uses should own only the schema it needs, not superuser rights on the database server. Upload provider credentials for S3-compatible storage should be a separate identity with access limited to the media bucket. Confirm that neither credential set is shared with another application, and that rotating one does not require changing the other.

Minimum supported version
PostgreSQL 14
Strapi installation requirements

JWT secret and app keys protection

Strapi signs admin and end-user JWTs and uses app keys for internal encryption, so these values must be unique per environment, long, random and absent from source control. Store them in your secret manager or injected environment variables, and check that a copy from production cannot validate tokens in staging. Rotating these values invalidates active sessions, so plan that change with the team.

TLS termination and dev features off

Terminate TLS at a load balancer or reverse proxy in front of Strapi, redirect plain HTTP, and confirm that Strapi does not trust forwarded headers from untrusted sources. Run production with NODE_ENV set to production so the development admin build and auto-reload are off, and confirm that any debug or seed endpoints you added are removed. Check both with a scan from outside your network.

How requests and trust boundaries fit together in a hardened Strapi

The diagram starts with public clients and staff on the left, and each request crosses a reverse proxy or gateway before reaching Strapi. That proxy is where rate limits and CORS rules should be enforced, so they apply before any application code runs. Inside the boundary, Strapi separates the admin panel, which staff reach through SSO or local login, from the content API, which end users and front ends reach through Users and Permissions and API tokens. Check each hand-off: the database, upload provider and secret store should only be reachable from the Strapi side of the boundary.

Trust boundaries between clients, the edge, Strapi and its private dependencies.

How to test that the permissions hold and fail safely

Test every endpoint from the outside, as each kind of caller, before you call the hardening finished. Build a matrix of the public REST and GraphQL endpoints in your Strapi project, then send each one three requests: unauthenticated, authenticated as the least-privileged end-user role, and with an API token carrying only the scope the consumer needs. Record the status code and the response body for each cell. Anything an unauthenticated caller can read or write that the matrix does not allow is a finding. Repeat the same matrix after every change to content types, roles or the Users and Permissions plugin, because a new field or relation can quietly widen what a role returns. For token scope, confirm that a read-only token cannot create, update or publish entries, and that a token issued to one project cannot reach content it was never given. Check token expiry and revocation the same way, and confirm which of these behaviors your installed version supports before you write them into the test plan.

Check the edges: CORS, rate limits, admin exposure and error output. For CORS, send preflight requests (the OPTIONS method with an Origin and Access-Control-Request-Method header) from origins that should be refused and confirm that the response does not grant them access. Do the same with credentials enabled if your front end uses them. For rate limiting, confirm that the limit applies at the layer you actually deploy, such as a reverse proxy, a gateway or a plugin, by exceeding it from one client and watching for throttled responses. Next, test admin panel reachability from a network outside your office or VPN, and confirm the admin path is not exposed on hosts that should only serve the API. Finally, provoke errors on purpose with malformed JSON, unknown fields and missing records, then review the bodies and server logs for stack traces, file paths, database details or version strings. Production mode should return generic errors. Confirm this on your own build, because error handling depends on configuration.

Decide who runs this and when to retest. You can run the matrix with your own engineers, but a third party often finds what the builders stopped seeing. DeployOpen's security testing covers application and API testing, so a scoped test can cover the endpoint matrix, token behavior, CORS and rate limits, and the exposed error review described here, with a written findings report. Ask any provider to state in the quote which endpoints, roles and environments are in scope, whether testing runs against production or a staging copy with the same configuration, and whether a retest after fixes is included and how it is priced. Keep the matrix as a versioned artifact so the next upgrade or schema change can be checked against the same expectations.

What to monitor, patch and document after hardening

What should I monitor after hardening a self-hosted Strapi?

Monitor failed admin and end-user logins, API token usage, and admin panel actions, and alert on patterns that do not match normal work. Failed login bursts, logins from new locations, tokens used from unexpected hosts, and changes to roles, permissions or API tokens are the events worth reviewing first. Check where your application and database logs land, how long they are kept, and who reviews them. Audit logs are an Enterprise feature in Strapi's self-hosted plans, so confirm what you can capture on your plan and fill gaps with reverse proxy, database and host logs.

Which Strapi admin actions should be logged and reviewed?

Log every change to content types, roles, permissions, API tokens, SSO settings, plugins and environment-level configuration, because these change what the system exposes. Record who made each change, when, and from which account. Review these entries on a fixed schedule your team agrees on, and compare them with approved change requests. If you use an identity provider for admin login, keep its logs alongside Strapi's so an admin session can be traced end to end.

How do I set up a dependency and advisory review routine for Strapi?

Assign a named owner who reviews security advisories for Strapi, its plugins, Node.js and the database driver on a recurring schedule. Subscribe to the Strapi GitHub releases page, track advisories for your Node.js release line, and run a dependency audit as part of each build. Record each advisory, whether it affects your version, the fix chosen and the date it was applied. Keep the schedule in your operations calendar so it survives staff changes.

How often does Strapi release updates, and how should I track them?

Strapi 5 minor releases have shipped roughly weekly, for example v5.56.0 on September 30 and v5.57.0 on October 7, 2026, according to the GitHub releases page. Because the cadence is frequent, do not patch ad hoc. Pick a supported minor line, test each release in staging against your roles, tokens and integrations, and promote it on a routine that your team can sustain. Read release notes for security fixes before each upgrade.

Which Node.js version should a Strapi 5 project run?

Run Strapi 5 only on an Active or Maintenance LTS Node.js version, because Strapi's installation requirements limit support to those releases. Check the Node.js release schedule before each upgrade and plan Node.js moves alongside Strapi moves, since a Strapi release may require a newer Node.js line. Confirm the exact supported range in the installation documentation for the Strapi version you run, and test your build and plugins on the new runtime before production.

How should secrets be rotated in a self-hosted Strapi?

Define a rotation schedule for the app keys, JWT secrets, API tokens, database credentials and upload provider keys, and record the owner and last rotation date for each. Rotate after staff changes, after a suspected exposure, and before major upgrades. Rotation usually requires updating the secret store, restarting instances and revoking the old value, so test the procedure in staging first. Set the actual intervals with your security team based on your policy; this page does not set them for you.

What backups should exist before a Strapi upgrade?

Take a verified database backup and a copy of uploads and configuration before every upgrade. Strapi's v4 to v5 migration documentation says to back up the database first because downgrading is not supported, so the backup is your rollback path. Restore the backup into a separate environment and confirm the application starts and content reads correctly before you rely on it. Record the backup location, timestamp and restore test result with the change record.

How do I keep a Strapi configuration record that survives staff changes?

Keep a versioned configuration record in your source repository or documentation system that lists roles and permissions for public and authenticated access, API token scopes and owners, CORS origins, rate limit settings, environment variable names without values, SSO settings, plugins and their versions, and the Node.js and Strapi versions in use. Update it with every change request, and review it during each release cycle. A new engineer should be able to rebuild the security posture from this record and the secret store alone.

How DeployOpen works on this

DeployOpen is a Chainscore Labs company that plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure. For Strapi, we review the running project against its roles, tokens, admin exposure, secrets, CORS, rate limits and dependencies, then deliver fixes with evidence your security team can check.

How we scope

  • Inventory every public content type, route and role to confirm what anonymous users can read and write.
  • List admin accounts, SSO status, API tokens and the hosting setup that serves the admin panel.
  • Agree the written scope, deliverables and timeline before any configuration change begins.

How we build

  • Tighten Users and Permissions roles and API token scopes, then test each endpoint with restricted and anonymous requests.
  • Move secrets and environment values out of code and repositories, and review CORS origins and rate limiting settings.
  • Patch Strapi and Node.js dependencies to supported versions, and record each change in the hardening log.

How we hand over

  • Deliver a findings report that ties each fix to the configuration it changed and the test that proves it.
  • Document the role matrix, token inventory, environment variables and patch procedure for your own operators.
  • Provide a retest of the agreed items so your team sees which findings are closed and which remain open.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover minor Strapi releases, Node.js LTS changes and dependency security fixes on your schedule.
  • Confirm with us during scoping which items a retainer covers and how change requests are priced and approved.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.