Guide

Penetration testing in Spain's ENS

The ENS (Esquema Nacional de Seguridad, Royal Decree 311/2022) is the security framework for Spain's public sector and the companies that supply it. It does mention penetration tests, but only in a few measures and categories. Here's exactly where.

Updated 11 November 2026 · By the Closeout team

Does the ENS require a penetration test?

It depends on the system's category (BÁSICA, MEDIA or ALTA). For ALTA systems, penetration tests are part of the security inspections in measure op.mon.3. For cloud services from third parties, pentest audits appear in op.nub.1 at every category. For MEDIA systems there is no explicit pentest, but web applications need black-box security audits or vulnerability detection tools (mp.s.2). The ENS applies to public bodies and to private companies that provide them services or solutions.

The measures that mention testing (Annex II)

MeasureWhat it saysCategories
op.mon.3 R6, security inspectionsPeriodic inspections, and after incidents that reveal new vulnerabilities: configuration checks, vulnerability analysis and penetration testsALTA
op.nub.1, cloud servicesThird-party cloud services must comply with the ENS or meet a CCN-STIC guide that includes penetration testing auditsBÁSICA, MEDIA, ALTA
mp.s.2, web applicationsR1: continuous black-box security audits during development. R2: defined methodologies and automatic vulnerability detection tools in the auditsMEDIA (R1 or R2), ALTA (R2 and R3)
mp.sw.2, acceptanceBefore going live, check that security acceptance criteria are met, in an isolated pre-production environment from MEDIA upBÁSICA, MEDIA, ALTA

The ENS audit (Article 31 and Annex III)

Systems are audited at least every two years, and also after substantial changes. BÁSICA systems only need a self-assessment by their own staff; MEDIA and ALTA systems need a formal audit, which is what certification is based on. A recent pentest with a documented remediation is strong evidence for that audit, even where the measure doesn't name it.

Evidence to keep

  • The report, with scope, dates, methodology, who tested and every finding with its severity.
  • The remediation record: owner, due date and status of each finding, with dates.
  • The retest, which proves each fix works, not just that someone marked it done. See our guide to pentest retesting.
  • Accepted risks, in writing, by someone with the authority, with a reason and a review date.
  • An attestation letter if the client must show the result to third parties without sharing the full report. You can make one with the attestation letter generator.
Closeout keeps that record for you: it delivers the report in a branded portal, tracks each finding against its deadline, verifies fixes with a retest and issues the attestation letter that cites the report by its SHA-256 hash.

Sources

Official texts, checked in November 2026. This is a practical guide, not legal or audit advice.

Frequently asked questions

Is a pentest mandatory for ENS certification?

Explicitly only in some cases: penetration tests are part of op.mon.3 inspections for ALTA systems and of op.nub.1 for third-party cloud services. MEDIA systems need web application security audits under mp.s.2.

How often is the ENS audited?

At least every two years, and after substantial changes to the systems (Article 31 of Royal Decree 311/2022).

Does the ENS apply to private companies?

Yes, when they provide services or solutions to Spanish public-sector bodies.