Schedule icon
Download icon
Script icon
Docker icon
Queries icon
If icon
SlackIncomingWebhook icon
Log icon
Assert icon

Audit HTTP Cookie Domain Isolation with the Mozilla Public Suffix List in DuckDB

Audit web cookies against the Mozilla Public Suffix List in DuckDB, detect RFC 6265 supercookie leaks, and export Parquet compliance reports in Kestra.

Categories
Infrastructure

Modern web architectures frequently serve multiple tenant environments, APIs, and portals under shared parent domains or cloud provider platform endpoints like github.io, azurewebsites.net, or country-code TLDs like co.uk. If an application scopes an authentication session cookie to a public suffix (for instance, setting domain=.co.uk or domain=.github.io), that cookie transforms into an RFC 6265 supercookie. Any other tenant sharing that public suffix can read, hijack, or overwrite user sessions across organizational boundaries.

This blueprint orchestrates an automated security boundary audit. It downloads Mozilla's authoritative Public Suffix List (PSL), caches the catalog with a 24-hour TTL to respect upstream bandwidth, probes live web endpoints to extract HTTP response cookies and security flags, and uses DuckDB to cross-reference every domain scope against 10,000+ ICANN and private suffix rules including wildcard and exception directives. Discovered violations are exported into compressed Parquet audit files, alerted via Slack, and blocked using an execution assertion gate.

How it works

  1. download_mozilla_psl (io.kestra.plugin.core.http.Download) fetches https://publicsuffix.org/list/public_suffix_list.dat. It enables taskCache with a 24-hour duration (PT24H) so subsequent daily runs reuse the local copy rather than repeatedly hammering Mozilla's public servers.
  2. probe_cookie_endpoints (io.kestra.plugin.scripts.python.Script) executes a Docker container (python:3.11-slim) that iterates through inputs.target_endpoints via the Python standard library (urllib.request and http.cookies.SimpleCookie). It extracts every Set-Cookie header, resolves effective domain scopes, parses Secure, HttpOnly, and SameSite attributes, and writes the structured records to observed_cookies.csv.
  3. duckdb_psl_analysis (io.kestra.plugin.jdbc.duckdb.Queries) mounts both the cached PSL dat file and the extracted CSV. It normalizes wildcard (*.) and exception (!) directives, joins observed cookie scopes using rule-priority ranking, classifies vulnerabilities (CRITICAL_SUPERCOOKIE, HIGH_INSECURE_TRANSPORT, MEDIUM_MISSING_HTTPONLY, MEDIUM_SAMESITE_CROSS_SITE), writes cookie_isolation_audit.parquet to internal storage, and aggregates compliance metrics with fetchType: FETCH_ONE.
  4. check_security_violations (io.kestra.plugin.core.flow.If) evaluates the query aggregation. If any critical supercookie leaks or insecure transport cookies are detected, it dispatches an alert payload to Slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) and logs incident details. If no violations exist, it logs a clean audit pass.
  5. enforce_isolation_gate (io.kestra.plugin.core.execution.Assert) validates conditions ensuring outputs.duckdb_psl_analysis.outputs[0].row.critical_supercookies == 0. When dry_run is false and fail_on_supercookie is enabled, this halts the pipeline with an explicit RFC 6265 violation error to prevent deployment into production.

What you get

  • Automated verification against the official, live Mozilla Public Suffix List with built-in 24-hour caching.
  • Zero external Python package dependencies, leveraging the Python standard library for robust HTTP header extraction.
  • DuckDB in-memory analytical SQL processing 10,000+ suffix rules in sub-second execution time.
  • Audit-ready compressed Parquet output files stored in Kestra for security compliance records and historical tracking.
  • Configurable assertion gates that prevent deploying services with cross-origin session leaks.

Who it's for

  • Application Security (AppSec) engineers validating cookie scoping across microservices and public portals.
  • DevOps and Platform teams enforcing RFC 6265 and OWASP security baselines in CI/CD deployment pipelines.
  • Compliance officers auditing cloud infrastructure against multi-tenant credential isolation requirements.

Why orchestrate this with Kestra

Conducting ad-hoc cookie audits through manual browser DevTools checks misses regressions introduced during microservice deployments or API gateway configuration updates. Running standalone scripts leaves security findings buried in transient terminal output without audit trails. Kestra provides scheduled orchestration with automatic task caching, combines Python HTTP probing with DuckDB SQL analytics, publishes queryable Parquet compliance artifacts, and gates production rollouts when tenant isolation is violated.

Pitfalls

  • Private vs ICANN Suffixes: Suffixes like github.io and s3.amazonaws.com are listed in the PRIVATE DOMAINS section of the PSL rather than ICANN top-level domains. Cookies scoped to these private suffixes create cross-customer session leaks even though they are technically third-level domains. DuckDB must segment and audit both sections.
  • Empty Cookie Headers: Endpoints that redirect or require session establishment may omit Set-Cookie headers on initial GET requests. The Python probe script is configured with error trapping to ensure observed_cookies.csv maintains valid headers even when an endpoint returns zero cookies.
  • Upstream Rate Limiting: Fetching public_suffix_list.dat on every pipeline run can lead to upstream rate limiting from public suffix mirrors. Enabling taskCache with PT24H ensures Kestra only downloads the catalog once per day.

Prerequisites

  • Docker daemon accessible to Kestra for running the containerized Python probe task (python:3.11-slim).
  • An incoming webhook URL stored in Kestra secrets as SLACK_WEBHOOK_URL for alert delivery.
  • Outbound internet access to https://publicsuffix.org and target application URLs.

Quick start

  1. Import this blueprint into your Kestra instance.
  2. Add your Slack incoming webhook secret under the key SLACK_WEBHOOK_URL in your namespace settings.
  3. Set inputs.target_endpoints to your organization's web application and API gateway URLs.
  4. Run an initial test execution with dry_run: true to review the generated Parquet audit artifact in the Kestra UI.
  5. Toggle fail_on_supercookie: true and dry_run: false to enforce cookie isolation in pre-production staging gates.

How to extend

  • Gateway Ingress Ingestion: Extend the Python probe task to parse Kubernetes Ingress manifests or AWS ALB listener rule definitions directly from Git repositories.
  • Automated Ticket Creation: Replace or augment the Slack notification task with Jira or ServiceNow plugins to automatically file vulnerability tickets for flagged domains.
  • Historical Drift Tracking: Persist the Parquet audit outputs into an Amazon S3 or Google Cloud Storage bucket partitioned by execution date to track compliance drift over time.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.