Skip to content

Section redaction: redact everything between a start and end regex pattern

Source: 23-section-redaction.phisql

PhiSQL

-- Section redaction: redact everything between a start and end regex pattern.
-- Useful for stripping bounded blocks (signatures, key material, headers).
-- Compiles to 23-section-redaction.json.

POLICY section_redaction;

DEFINE SECTION
  START '-----BEGIN PRIVATE-----'
  END '-----END PRIVATE-----'
  WITH REDACT;

Compiles to

{
  "identifiers": {
    "sections": [
      {
        "startPattern": "-----BEGIN PRIVATE-----",
        "endPattern": "-----END PRIVATE-----",
        "sectionFilterStrategies": [
          { "strategy": "REDACT" }
        ]
      }
    ]
  }
}