prod-guard-oss

Back to index

Architecture Overview

This document describes the internal architecture of prod-guard, its core components, execution flow, and design decisions.

The goal of prod-guard’s architecture is to provide:


High-Level Architecture

prod-guard is a startup-time validation framework for Spring Boot applications. All checks are executed once during application startup.

There are no agents, background threads, schedulers, or network calls.


Application Startup
        |
        v
ProdGuardRunner
        |
        +-- License Verification
        |
        +-- Check Discovery
        |
        +-- License Gate (FREE / PREMIUM)
        |
        +-- Check Execution
        |
        +-- Result Aggregation
        |
        +-- Optional Startup Blocking

Core Components

ProdGuardRunner

ProdGuardRunner is the orchestration engine. It is executed during application startup and controls the entire lifecycle.

Responsibilities:


ProdCheck

Each production rule is implemented as a ProdCheck.

A check is:

Each check provides:

Checks are discovered automatically via Spring’s component scanning.


SeverityResolver

The SeverityResolver determines the effective severity of each finding.

Resolution order:

  1. Explicit configuration override (prodguard.severity.*)
  2. Check default severity

This allows teams to:


Licensing Architecture

LicenseVerifier

License validation is handled by the LicenseVerifier abstraction.

Two implementations exist:

Selection is automatic based on configuration.


Signed License Model

prod-guard uses offline cryptographic licenses.

A license contains:


LicenseContext

After verification, a LicenseContext is produced.

It represents the immutable result of license validation:

This context is evaluated exactly once at startup.


LicenseGate

LicenseGate enforces licensing at the check level.

By convention:

If a PREMIUM check is encountered without a valid license:


Execution Flow


1. Application starts
2. ProdGuardRunner invoked
3. Environment & profile detection
4. License verification
5. License expiration diagnostics
6. Check discovery
7. License gate filtering
8. Check execution
9. Result aggregation
10. Optional startup failure

Design Principles

Fail Fast

All validation happens before the application begins serving traffic.

Zero Runtime Cost

No background tasks, no polling, no memory retention after startup.

Offline First

prod-guard never requires network access.

Transparent Enforcement

Every decision is logged explicitly and auditable.

Enterprise-Ready


Execution Model

prod-guard executes validation as part of the startup lifecycle, but not all checks run at the same moment.

To reflect this accurately, prod-guard uses a two-phase execution model.


Phase 1 — Pre-Start Validation (Static Checks)

When it runs

What runs

Examples

Characteristics

This phase applies to both FREE and PREMIUM editions.


Phase 2 — Post-Start Runtime Validation (Effective Checks)

Some production and security guarantees cannot be validated statically.

For example:

These require observing the effective runtime behavior.

When it runs

What runs

Examples

Characteristics

This phase is PREMIUM-only.


Comparison with Traditional Monitoring

Aspect Traditional Monitoring prod-guard
Execution time Runtime Startup only
Purpose Observation Prevention
Failure handling Alerts Startup blocking
Licensing Subscription / SaaS Offline signed license

Next Steps

Back to index