Skip to content

Latest commit

 

History

History
87 lines (69 loc) · 4.69 KB

File metadata and controls

87 lines (69 loc) · 4.69 KB
title pg hardstorage repo audit
description CLI reference for the pg hardstorage repo audit command.
tags
cli
reference

pg_hardstorage repo audit

Comprehensive read-only repository state report

Synopsis

repo audit walks every deployment + every visible manifest in the repo and produces a comprehensive state report covering:

  • per-deployment lifecycle (active / tombstoned / held counts, oldest / newest backup, latest backup metadata, encryption posture, KEK refs, schema versions, PG-version spread, timeline spread)
  • fleet-wide rollups (KEK ref → manifest count, schema-version distribution, replica completeness)
  • audit-chain summary (event count, last-anchor age, head-pointer presence)
  • storage usage (objects / bytes per category — same shape as repo usage)
  • approval-request lifecycle counts
  • WORM mode + retention from HSREPO

The report is a snapshot of FACTS, not a verdict — it surfaces the data an operator needs to answer "are all my fleets' backups encrypted under the expected KEK?", "how many manifests are still on the old schema?", "which deployments are missing replica copies?" — without prescribing what's "broken". For operational health checks (something is actively wrong), use pg_hardstorage doctor; for per-backup integrity, use pg_hardstorage verify.

Read-only by construction; safe at any cadence.

Optional opt-outs cut runtime on huge fleets: --no-storage skip the per-category storage walk --no-chain skip the audit-chain summary --no-approvals skip the approval-request lifecycle scan

pg_hardstorage repo audit <url> [flags]

Options

      --deployment string   restrict the per-deployment section to one deployment (fleet rollups still cover all deployments)
  -h, --help                help for audit
      --no-approvals        skip the approval-request lifecycle scan
      --no-chain            skip the audit-chain summary (cheaper on long chains)
      --no-storage          skip the per-category storage usage scan (cheaper on huge repos)
      --repo string         repository URL — must already exist (positional <url> is also accepted)

Options inherited from parent commands

      --airgapped airgapped: strict                                                       refuse outbound endpoints (LLM providers, sinks, OTLP collectors) outside loopback / RFC1918 / explicit airgap.allowlist. Also enabled by PG_HARDSTORAGE_AIRGAPPED=1 or airgapped: strict in the config file.
  -c, --config string                                                                     path to config file (default: XDG/FHS lookup)
      --cpu-profile go tool pprof <path>                                                  write a pprof CPU profile to this path for the duration of the command (go tool pprof <path> to analyse). Off when empty.
      --mem-profile string                                                                write a pprof heap profile to this path at command exit. Off when empty.
      --no-color                                                                          disable ANSI color in text output
      --on-error-llm                                                                      on a structured-error failure, drop into the matching LLM helper skill (auto_on_error trigger). Also enabled by PG_HARDSTORAGE_ON_ERROR_LLM=1.
      --otel-endpoint string                                                              OpenTelemetry OTLP/HTTP endpoint (e.g. http://otel-collector:4318); empty disables tracing
      --otel-stdout                                                                       also export OpenTelemetry traces to stderr (useful for dev)
  -o, --output string                                                                     output format: text|json|ndjson|yaml|template|csv|markdown|html|tap|junit|pdf (default: text on TTY, json off-TTY)
      --profile-port go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30   if non-zero, expose net/http/pprof on 127.0.0.1:<port> for live profiling of long-running commands (e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=30). Off when zero.
  -q, --quiet                                                                             suppress non-essential output
      --template string                                                                   Go text/template applied when --output template (or implied if --template is set without --output)

SEE ALSO