# goriparthivamsi/certagility architecture

> Architecture diagram of the GitHub repository goriparthivamsi/certagility, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goriparthivamsi/certagility
- Repository: https://github.com/goriparthivamsi/certagility

## Overview

certagility is a command-line and exporter service that inventories certificates from network, file, Kubernetes, and AWS sources; analyzes lifecycle and cryptographic readiness; and emits human-readable or machine-readable reports. The graph follows the documented scan path and the sampled calls. The README documents exporter endpoints and report capabilities; unsampled implementation details are represented only where paths are supported, and no unverified source-call links are inferred.

Main entry points: [`internal/scan/scan.go`](https://github.com/goriparthivamsi/certagility/blob/main/internal/scan/scan.go) (Scan orchestration), [`cmd/certagility/main.go`](https://github.com/goriparthivamsi/certagility/blob/main/cmd/certagility/main.go) (Exporter HTTP service), [`internal/source/x509.go`](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/x509.go) (X.509 normalization), [`internal/report/report.go`](https://github.com/goriparthivamsi/certagility/blob/main/internal/report/report.go) (Format selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command runtime"]
  node_commands["CLI commands<br/>[main.go]"]
  node_exporter["Exporter HTTP service<br/>[main.go]"]
end

subgraph group_sources["Certificate discovery"]
  node_scanner["Scan orchestration<br/>[scan.go]"]
  node_endpoint["TLS endpoint scan<br/>[endpoint.go]"]
  node_file_scan["Certificate file scan<br/>[files.go]"]
  node_kube_scan["Kubernetes Secrets<br/>[kubernetes.go]"]
  node_acm_scan["AWS ACM scan<br/>[acm.go]"]
  node_cert_parse["X.509 normalization<br/>[x509.go]"]
  node_oid_helpers["OID helpers<br/>[oid.go]"]
end

subgraph group_assessment["Inventory assessment"]
  node_inventory["Inventory data model<br/>[model.go]"]
  node_analyzer["Readiness analysis<br/>[analyze.go]"]
end

subgraph group_outputs["Reporting and export"]
  node_report_router["Format selection<br/>[report.go]"]
  node_table_report["Table and summary<br/>[report.go]"]
  node_cbom["CycloneDX CBOM<br/>[cbom.go]"]
  node_prometheus["Prometheus metrics<br/>[prometheus.go]"]
end

node_operator(("Operator"))
node_endpoint_service(("TLS endpoints"))
node_kubernetes_cluster[("Kubernetes cluster")]
node_aws_acm[("AWS Certificate Manager")]
node_prometheus_consumer(("Prometheus consumer"))
node_cbom_consumer(("CBOM consumer"))

node_operator -->|"invokes"| node_commands
node_commands -->|"runs scan"| node_scanner
node_commands -->|"writes report"| node_report_router
node_commands -->|"starts service"| node_exporter
node_scanner -->|"scans targets"| node_endpoint
node_scanner -->|"scans paths"| node_file_scan
node_scanner -->|"scans Secrets"| node_kube_scan
node_scanner -->|"scans certificates"| node_acm_scan
node_endpoint -->|"connects TLS"| node_endpoint_service
node_kube_scan -->|"lists Secrets"| node_kubernetes_cluster
node_acm_scan -->|"lists and retrieves"| node_aws_acm
node_endpoint -->|"normalizes chain"| node_cert_parse
node_file_scan -->|"parses certificates"| node_cert_parse
node_kube_scan -->|"parses certificate data"| node_cert_parse
node_acm_scan -->|"parses certificate bundle"| node_cert_parse
node_cert_parse -->|"uses OID helpers"| node_oid_helpers
node_scanner -->|"builds inventory"| node_inventory
node_scanner -->|"analyzes records"| node_analyzer
node_scanner -->|"collects records"| node_cert_parse
node_analyzer -->|"updates findings"| node_inventory
node_report_router -->|"renders table"| node_table_report
node_report_router -->|"renders CBOM"| node_cbom
node_report_router -->|"renders metrics"| node_prometheus
node_exporter -->|"rescans periodically"| node_scanner
node_exporter -->|"serves metrics"| node_prometheus
node_exporter -->|"serves CBOM"| node_cbom
node_prometheus_consumer -.->|"requests metrics"| node_exporter
node_cbom_consumer -.->|"requests CBOM"| node_exporter

click node_commands "https://github.com/goriparthivamsi/certagility/blob/main/cmd/certagility/main.go"
click node_scanner "https://github.com/goriparthivamsi/certagility/blob/main/internal/scan/scan.go"
click node_endpoint "https://github.com/goriparthivamsi/certagility/blob/main/internal/source/endpoint.go"
click node_file_scan "https://github.com/goriparthivamsi/certagility/blob/main/internal/source/files.go"
click node_kube_scan "https://github.com/goriparthivamsi/certagility/blob/main/internal/source/kubernetes.go"
click node_acm_scan "https://github.com/goriparthivamsi/certagility/blob/main/internal/source/acm.go"
click node_cert_parse "https://github.com/goriparthivamsi/certagility/blob/main/internal/source/x509.go"
click node_oid_helpers "https://github.com/goriparthivamsi/certagility/blob/main/internal/source/oid.go"
click node_inventory "https://github.com/goriparthivamsi/certagility/blob/main/internal/model/model.go"
click node_analyzer "https://github.com/goriparthivamsi/certagility/blob/main/internal/analyze/analyze.go"
click node_report_router "https://github.com/goriparthivamsi/certagility/blob/main/internal/report/report.go"
click node_table_report "https://github.com/goriparthivamsi/certagility/blob/main/internal/report/report.go"
click node_cbom "https://github.com/goriparthivamsi/certagility/blob/main/internal/report/cbom.go"
click node_prometheus "https://github.com/goriparthivamsi/certagility/blob/main/internal/report/prometheus.go"
click node_exporter "https://github.com/goriparthivamsi/certagility/blob/main/cmd/certagility/main.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_exporter toneBlue
class node_scanner,node_endpoint,node_file_scan,node_kube_scan,node_acm_scan,node_cert_parse,node_oid_helpers,node_kubernetes_cluster,node_aws_acm toneAmber
class node_inventory,node_analyzer toneMint
class node_report_router,node_table_report,node_cbom,node_prometheus toneRose
class node_operator,node_endpoint_service,node_prometheus_consumer,node_cbom_consumer toneIndigo
```

## Components

### Command runtime

- [CLI commands](https://github.com/goriparthivamsi/certagility/blob/main/cmd/certagility/main.go): `cmd/certagility/main.go`
- [Exporter HTTP service](https://github.com/goriparthivamsi/certagility/blob/main/cmd/certagility/main.go): `cmd/certagility/main.go`

### Certificate discovery

- [Scan orchestration](https://github.com/goriparthivamsi/certagility/blob/main/internal/scan/scan.go): `internal/scan/scan.go`
- [TLS endpoint scan](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/endpoint.go): `internal/source/endpoint.go`
- [Certificate file scan](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/files.go): `internal/source/files.go`
- [Kubernetes Secrets](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/kubernetes.go): `internal/source/kubernetes.go`
- [AWS ACM scan](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/acm.go): `internal/source/acm.go`
- [X.509 normalization](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/x509.go): `internal/source/x509.go`
- [OID helpers](https://github.com/goriparthivamsi/certagility/blob/main/internal/source/oid.go): `internal/source/oid.go`

### Inventory assessment

- [Inventory data model](https://github.com/goriparthivamsi/certagility/blob/main/internal/model/model.go): `internal/model/model.go`
- [Readiness analysis](https://github.com/goriparthivamsi/certagility/blob/main/internal/analyze/analyze.go): `internal/analyze/analyze.go`

### Reporting and export

- [Format selection](https://github.com/goriparthivamsi/certagility/blob/main/internal/report/report.go): `internal/report/report.go`
- [Table and summary](https://github.com/goriparthivamsi/certagility/blob/main/internal/report/report.go): `internal/report/report.go`
- [CycloneDX CBOM](https://github.com/goriparthivamsi/certagility/blob/main/internal/report/cbom.go): `internal/report/cbom.go`
- [Prometheus metrics](https://github.com/goriparthivamsi/certagility/blob/main/internal/report/prometheus.go): `internal/report/prometheus.go`

### Other components

- **Operator**
- **TLS endpoints**
- **Kubernetes cluster**
- **AWS Certificate Manager**
- **Prometheus consumer**
- **CBOM consumer**

## Connections

- Operator → CLI commands: invokes (evidence: `cmd/certagility/main.go`)
- CLI commands → Scan orchestration: runs scan (evidence: `cmd/certagility/main.go`)
- CLI commands → Format selection: writes report (evidence: `cmd/certagility/main.go`)
- CLI commands → Exporter HTTP service: starts service (evidence: `cmd/certagility/main.go`)
- Scan orchestration → TLS endpoint scan: scans targets (evidence: `internal/scan/scan.go`)
- Scan orchestration → Certificate file scan: scans paths (evidence: `internal/scan/scan.go`)
- Scan orchestration → Kubernetes Secrets: scans Secrets (evidence: `internal/scan/scan.go`)
- Scan orchestration → AWS ACM scan: scans certificates (evidence: `internal/scan/scan.go`)
- TLS endpoint scan → TLS endpoints: connects TLS (evidence: `internal/source/endpoint.go`)
- Kubernetes Secrets → Kubernetes cluster: lists Secrets (evidence: `internal/source/kubernetes.go`)
- AWS ACM scan → AWS Certificate Manager: lists and retrieves (evidence: `internal/source/acm.go`)
- TLS endpoint scan → X.509 normalization: normalizes chain (evidence: `internal/source/endpoint.go`)
- Certificate file scan → X.509 normalization: parses certificates (evidence: `internal/source/files.go`)
- Kubernetes Secrets → X.509 normalization: parses certificate data (evidence: `internal/source/kubernetes.go`)
- AWS ACM scan → X.509 normalization: parses certificate bundle (evidence: `internal/source/acm.go`)
- X.509 normalization → OID helpers: uses OID helpers (evidence: `internal/source/x509.go`)
- Scan orchestration → Inventory data model: builds inventory (evidence: `internal/scan/scan.go`)
- Scan orchestration → Readiness analysis: analyzes records (evidence: `internal/scan/scan.go`)
- Scan orchestration → X.509 normalization: collects records (evidence: `internal/scan/scan.go`)
- Readiness analysis → Inventory data model: updates findings (evidence: `internal/analyze/analyze.go`)
- Format selection → Table and summary: renders table (evidence: `internal/report/report.go`)
- Format selection → CycloneDX CBOM: renders CBOM (evidence: `internal/report/report.go`)
- Format selection → Prometheus metrics: renders metrics (evidence: `internal/report/report.go`)
- Exporter HTTP service → Scan orchestration: rescans periodically (evidence: `cmd/certagility/main.go`)
- Exporter HTTP service → Prometheus metrics: serves metrics (evidence: `cmd/certagility/main.go`)
- Exporter HTTP service → CycloneDX CBOM: serves CBOM (evidence: `cmd/certagility/main.go`)
- Prometheus consumer → Exporter HTTP service: requests metrics (evidence: `README.md`)
- CBOM consumer → Exporter HTTP service: requests CBOM (evidence: `README.md`)
