Tls Approved + Istio Collector
Enforce Tls Approved using data collected by Istio Collector. Automatically check deployment and infrastructure standards on every PR.
How Istio Collector Powers This Guardrail
The Istio Collector gathers metadata from your security, orchestration systems. This data flows into Lunar's Component JSON, where the Tls Approved guardrail evaluates it against your standards.
When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.
Quick Start Configuration
Add both the collector and policy to your lunar-config.yml to enable this guardrail.
# Step 1: Enable the Istio Collector
collectors:
- uses: github://earthly/lunar-lib/collectors/istio@v1.0.5
# with: ...
# Step 2: Enable the Istio Guardrails
policies:
- uses: github://earthly/lunar-lib/policies/istio@v1.0.5
include: [tls-approved]
# with: ...
What Istio Collector Collects
This collector gathers the following data that the Tls Approved guardrail evaluates.
istio
Parses all Istio custom resources in the repository and collects:
- mTLS posture from PeerAuthentication (STRICT / PERMISSIVE / DISABLE, and scope)
- AuthorizationPolicy actions and whether any rule grants blanket access
- RequestAuthentication (JWT) issuers
- Traffic management: VirtualService, DestinationRule, Gateway, ServiceEntry, Sidecar, EnvoyFilter
- Telemetry resources (tracing / metrics / access logging)
- Install profile from IstioOperator
- TLS protocol versions and cipher suites on Gateway servers, and the mesh-wide TLS settings (meshMTLS, tlsDefaults) of each declared MeshConfig (IstioOperator or the istiod ConfigMap)
- Sidecar injection: namespace labels (istio-injection / istio.io/rev) and
per-workload sidecar.istio.io/inject overrides
Each resource is validated with
istioctl analyze(offline, no cluster required).
cicd
Records every istioctl command executed in CI pipelines along with the istioctl client version. Writes command strings and version info to .mesh.cicd for audit trails and deployment traceability (istioctl install, istioctl analyze, istioctl upgrade, etc.).
Example Data Flow
Here's an example of the data that Istio Collector writes to the Component JSON, which Tls Approved then evaluates.
{
"mesh": {
"source": {
"tool": "istio",
"version": "1.22.0",
"integration": "code"
},
"provider": "istio",
"resources": [
{"kind": "VirtualService", "name": "reviews", "namespace": "bookinfo", "path": "istio/reviews-vs.yaml", "valid": true},
{"kind": "PeerAuthentication", "name": "default", "namespace": "istio-system", "path": "istio/mtls.yaml", "valid": true}
],
"peer_authentications": [
{"name": "default", "namespace": "istio-system", "scope": "mesh", "mode": "STRICT", "path": "istio/mtls.yaml"}
],
"authorization_policies": [
{"name": "require-jwt", "namespace": "bookinfo", "action": "ALLOW", "rule_count": 1, "allows_all": false, "path": "istio/authz.yaml"}
],
"request_authentications": [
{"name": "jwt-example", "namespace": "bookinfo", "issuers": ["https://accounts.example.com"], "path": "istio/reqauth.yaml"}
],
"virtual_services": [
{"name": "reviews", "namespace": "bookinfo", "hosts": ["reviews"], "gateways": ["mesh"], "has_timeout": true, "has_retries": true, "has_fault_injection": false, "path": "istio/reviews-vs.yaml"}
],
"destination_rules": [
{"name": "reviews", "namespace": "bookinfo", "host": "reviews", "tls_mode": "ISTIO_MUTUAL", "has_outlier_detection": true, "has_connection_pool": true, "subsets": ["v1", "v2"], "path": "istio/reviews-dr.yaml"}
],
"gateways": [
{
"name": "bookinfo-gateway",
"namespace": "istio-system",
"servers": [
{"port": 443, "protocol": "HTTPS", "tls_mode": "SIMPLE", "https_redirect": false,
"min_protocol_version": "TLSV1_2", "max_protocol_version": null,
"cipher_suites": ["ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384"]},
{"port": 80, "protocol": "HTTP", "tls_mode": null, "https_redirect": true,
"min_protocol_version": null, "max_protocol_version": null, "cipher_suites": null}
],
"path": "istio/gateway.yaml"
}
],
"service_entries": [
{"name": "external-api", "namespace": "bookinfo", "hosts": ["api.example.com"], "location": "MESH_EXTERNAL", "resolution": "DNS", "path": "istio/service-entry.yaml"}
],
"sidecars": [
{"name": "default", "namespace": "bookinfo", "restricts_egress": true, "egress_hosts": ["./*", "istio-system/*"], "path": "istio/sidecar.yaml"}
],
"envoy_filters": [
{"name": "custom-lua", "namespace": "bookinfo", "path": "istio/envoyfilter.yaml"}
],
"telemetry": [
{"name": "mesh-default", "namespace": "istio-system", "has_tracing": true, "has_metrics": true, "has_access_logging": true, "path": "istio/telemetry.yaml"}
],
"install": [
{"kind": "IstioOperator", "name": "control-plane", "namespace": "istio-system", "profile": "default", "path": "istio/istiooperator.yaml"}
],
"mesh_configs": [
{
"kind": "IstioOperator", "name": "control-plane", "namespace": "istio-system", "path": "istio/istiooperator.yaml",
"mesh_mtls": {"min_protocol_version": "TLSV1_3", "cipher_suites": null},
"tls_defaults": {"min_protocol_version": "TLSV1_2", "cipher_suites": ["ECDHE-ECDSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-GCM-SHA384"]}
}
],
"injection": {
"namespaces": [
{"name": "bookinfo", "enabled": true, "revision": null, "path": "istio/ns-bookinfo.yaml"}
],
"workload_overrides": [
{"kind": "Deployment", "name": "legacy-batch", "namespace": "bookinfo", "inject": false, "path": "deploy/legacy.yaml"}
]
},
"cicd": {
"cmds": [
{"cmd": "istioctl install -y", "version": "1.22.0"},
{"cmd": "istioctl analyze ./istio", "version": "1.22.0"}
],
"source": {"tool": "istioctl", "integration": "ci"}
},
"summary": {
"mtls_default_mode": "STRICT",
"mtls_strict": true,
"has_authorization_policies": true,
"all_gateways_tls": true,
"injection_enabled": true,
"uses_envoy_filters": true
}
}
}
Configuration Options
Istio Collector Inputs
| Input | Required | Default | Description |
|---|---|---|---|
find_command |
Optional |
find . -type f \( -name '*.yaml' -o -name '*.yml' \)
|
Command to find Istio manifest files (must output one file path per line) |
Istio Guardrails Inputs
| Input | Required | Default | Description |
|---|---|---|---|
required_mtls_mode |
Optional |
STRICT
|
Required mesh-wide mTLS mode for the mtls-strict check (STRICT or PERMISSIVE) |
approved_tls_versions |
Required | — | Comma-separated TLS protocol versions, by Istio name (TLSV1_0, TLSV1_1, TLSV1_2, TLSV1_3), that tls-approved accepts. Every version a server or the mesh can negotiate must be listed. Empty (the default) skips the version half of the check. |
approved_cipher_suites |
Required | — | Comma-separated cipher suites that tls-approved accepts (e.g. ECDHE-ECDSA-AES256-GCM-SHA384). Not required where the minimum version is TLS 1.3. Empty (the default) skips the cipher half of the check. |
Ready to Automate Your Standards?
See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 300+ built-in guardrails.