perspectivegraph

by luiacuaniello

Helm chartv1.40.0App 1.40.0Apache-2.0Verified publisher

Attack-path analysis in the pull request: from internet exposure, through too much privilege, to a sensitive asset.

About this chart

PerspectiveGraph

PerspectiveGraph connects what the scanners you already run have found (Trivy, Semgrep, Cloud Custodian, Falco, plus Kubernetes, IAM and cloud network data) into one graph of your environment, and looks for the routes that matter: from the internet, through too much privilege, to something valuable. It flags a route in the pull request that opens it, and can open a second pull request with the fix.

Want to look around before installing? There is a read-only live demo with sample data, no signup needed: demo.a3thinker.it.

This chart installs the whole thing: the Go backend (GraphQL API and ingest endpoint), the dashboard behind nginx and, unless you bring your own, PostgreSQL with Apache AGE and a NATS broker.

Install

helm install perspectivegraph oci://ghcr.io/luiacuaniello/charts/perspectivegraph \
  --namespace perspectivegraph --create-namespace \
  --set secrets.generate=true

A default install runs the production profile: the API and the ingest endpoint are authenticated, and only the backend may reach the bundled database and broker. So the chart won't render until you say where the credentials come from, and there are three answers:

  • secrets.generate=true, as above: the chart generates an admin token, the ingest secret and the encryption keys, and keeps them across upgrades. The install notes print how to read the token back. It works with helm install and helm upgrade, not with helm template (Argo CD, Flux), which would draw new ones on every render.
  • secrets.existingSecret: a Secret you manage, with the keys values-production.yaml lists. This is the way that works under Argo CD and Flux.
  • auth.apiTokens (or auth.oidc.*) together with ingest.hmacSecret, set as values.

For a trial in a cluster you trust, --set backend.env=demo installs it unauthenticated instead: anyone who can reach the service can read your attack paths.

The chart and the images are signed with cosign. To check the chart's signature before installing:

cosign verify ghcr.io/luiacuaniello/charts/perspectivegraph:<version> \
  --certificate-identity-regexp 'https://github.com/luiacuaniello/perspectivegraph/.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Then open the dashboard at http://localhost:8080:

kubectl -n perspectivegraph port-forward \
  svc/$(kubectl -n perspectivegraph get svc -l app.kubernetes.io/component=frontend \
        -o jsonpath='{.items[0].metadata.name}') 8080:80

The service name depends on the release name, which is why the command looks it up.

A new install starts empty: the graph fills up as scanner output reaches the ingest endpoint. The manual shows what to send, and in which order.

Requirements

Kubernetes 1.21 or newer, and a default StorageClass, because the bundled database keeps its data on a 5 GiB volume. That's all. The backend creates and upgrades its own database schema when it starts, so moving between versions needs no migration step.

On every change, CI installs the chart with its default values on kind, with Kubernetes 1.33 and 1.36. Older versions down to 1.21 should work, since the chart only uses APIs that have been stable for years, but they aren't tested.

Trying it out, or running it for real

The default values are there to try it out: everything runs inside the cluster and there's no authentication. That's fine on a laptop or in a test cluster, not with real data.

Two more values files come with the chart:

  • values-production.yaml connects to your own PostgreSQL+AGE over a verified TLS connection and requires authentication (the backend won't start without it). It reads secrets from a Secret you manage, keeps the audit log and the triage data on a persistent volume, terminates TLS at the ingress, moves /metrics to a local-only listener and sets resource requests and limits.
  • values-ha.yaml goes on top of the production file: three backend replicas and two dashboard ones spread across nodes, a disruption budget, the audit log and triage data moved into PostgreSQL, and an external NATS.
helm pull oci://ghcr.io/luiacuaniello/charts/perspectivegraph --untar
helm install perspectivegraph ./perspectivegraph \
  -f perspectivegraph/values-production.yaml \
  --set postgres.externalHost=db.internal --set ingress.host=pg.example.com

Create the Secret first: the production file lists the keys it expects. Or let the chart generate them, with --set secrets.existingSecret="" --set secrets.generate=true and the database's own password (postgres.auth.password): it keeps them across upgrades, and the release notes say how to read the admin token back. On AWS or GCP, where no managed PostgreSQL offers AGE, add --set postgres.cloudnativepg.enabled=true instead of postgres.externalHost to have the CloudNativePG operator run the database in the cluster.

The values to read first

KeyDefaultWhat it does
backend.envproductionThe backend refuses to start without an API credential and an ingest secret, and the chart refuses to render without a source for them (see Install). demo runs open - an unauthenticated API and unsigned ingest - for a trial in a cluster you trust.
auth.apiTokens / auth.oidcemptyStatic bearer tokens, or SSO. With ingest.hmacSecret, one of the three ways to give a default install its credentials; under backend.env: demo and left empty, anyone who can reach the service can read your attack paths.
auth.anonymousRoleemptyviewer publishes the install read-only, like the live demo: visitors can look around and every change is refused. Set backend.trustedProxyCidrs to your ingress controller's pod network as well, so rate limits apply to each visitor rather than to all of them at once.
postgres.enabledtrueThe bundled database, meant for trying things out. In production, set it to false and point postgres.externalHost (or postgres.dsn) at your own PostgreSQL+AGE.
postgres.cloudnativepg.enabledfalseHands the database to the CloudNativePG operator, installed beforehand: a primary with replicas and failover, TLS the backend verifies, and continuous backups to object storage when backup.objectStore names a Barman Cloud ObjectStore. The answer on AWS and GCP, where no managed PostgreSQL offers AGE. Replaces the bundled database; see the guide.
secrets.generatefalseThe shortest way to give a default install its credentials. Fills every credential left empty with a generated one, kept across upgrades: an admin API token (unless OIDC is set), the ingest HMAC secret, the encryption and signing keys. With values-production.yaml, add --set secrets.existingSecret="" --set secrets.generate=true to install without preparing a Secret - plus postgres.auth.password, which only your database knows, unless postgres.cloudnativepg.enabled runs it. Not for helm template (Argo CD, Flux), which would draw new values every render.
serviceAccountcreatedThe backend's own service account, with no Kubernetes API token mounted (no pod in the chart mounts one). On EKS, bind the AWS connector's read-only role to it with EKS Pod Identity, or IRSA via serviceAccount.annotations; deploy/aws in the repository has the role.
connectors.enabledemptykubernetes reads the cluster the chart is installed in, on a schedule, instead of waiting for a posted dump; set connectors.kubernetes.clusterName too (on EKS, the EKS name). The backend's service account gets get/list on pods, services, service accounts, nodes, ingresses and RBAC objects, and the aws-auth config map by name - never secrets. aws and azure read cloud accounts.
postgres.auth.passwordgeneratedEmpty gives the bundled database a random password, kept across upgrades; an existing install keeps the one it has. Required for an external database. With helm template (Argo CD, Flux) set it, or use secrets.existingSecret: a render without the cluster cannot keep a generated one.
nats.authon, generatedThe bundled NATS requires nats.auth.user and a password generated into its own Secret (or nats.auth.password / nats.auth.existingSecret), and the backend presents them - without it any pod could publish events past the ingest signature check. An external NATS gets credentials only when you set them.
nats.persistence.enabledtrueA volume for the event stream, so queued events and dead letters survive a NATS restart.
networkPolicy.enabledtrueOnly the backend may reach the bundled NATS and Postgres (postgresFrom adds, say, a backup job). The backend and the dashboard stay open to the cluster, so the ingress controller reaches them; backendFrom limits who may call the backend - typically the ingress controller's namespace. Inert on a CNI that does not enforce NetworkPolicy, which is why NATS authenticates too.
governanceBackendfileWhere triage decisions, tickets, validation verdicts and the audit log are kept. postgres is what makes more than one backend replica possible.
persistence.enabledfalseA volume for the file backend, so that data survives restarts. It supports a single replica, and the chart won't render it with more.
backend.replicas1More than one needs governanceBackend: postgres.
repoAllowlistemptyThe repositories the engine may write to: PR comments, merge-gate statuses and fix PRs. Empty means none.
prAttributiondiffWhich routes the commit status and PR comments count against a commit: diff, those it opened or made likelier (the merge gate's rule); commit, every route through it (before 1.22).
ingress.enabledfalsePublishes the dashboard, the API and the ingest endpoint. The chart won't render it without authentication, unless you set ingress.allowUnauthenticated: true.
ingress.maxBodySize32mThe largest scanner report the ingress passes to /ingest and /gate: the backend's own limit. Rendered as the body-size annotation of ingress-nginx and F5 NGINX, whose 1 MiB default refuses real reports; an annotation you set wins.
service.typeClusterIPLoadBalancer or NodePort expose the backend outside the cluster, with the same authentication check as the ingress.
ai.apiKeyemptyTurns on the AI assistant through Anthropic's API (ai.hf takes an OpenAI-compatible endpoint instead). Once it's on, details of your attack paths are sent to that provider.

helm show values oci://ghcr.io/luiacuaniello/charts/perspectivegraph prints every value, each with a comment explaining it.

Hardening

  • Every pod, init containers included, meets the restricted Pod Security Standard, and CI checks it on every change.
  • The backend and the dashboard run as non-root users on a read-only filesystem, with all Linux capabilities dropped. The backend image is distroless and has no shell.
  • Every release ships with an SPDX SBOM and SLSA build provenance, and the chart and the images are signed.
  • The audit log is a hash chain, so any edit to past records shows.

The threat model explains what isn't covered and what's left to you as the operator.

Documentation

  • Operations runbook: where to get PostgreSQL+AGE, backups and restores, upgrades, the production checklist
  • Documentation: architecture, scoring, what to send and how, with search
  • Scale: measured sizing, and how to measure your own graph
  • Upgrade notes: the releases that need something from you
  • Support policy: which versions get fixes, and how quickly

Apache-2.0. Issues and pull requests are welcome on GitHub.

Deploy perspectivegraph with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has perspectivegraph on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartperspectivegraph is pinned at v1.40.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply