π What Is It?
Insufficient Logging and Visibility describes a CI/CD environment that lacks the logging, monitoring, and detection needed to notice an attack in the pipeline. The vulnerability is not a misconfigured switch - it is the absence of telemetry and alerting that would let a defender see tampering, credential abuse, or misuse of the build system while it happens, or reconstruct it afterwards. The danger is not that an attack succeeds (every other CI/CD risk covers a way in) but that it proceeds undetected. Pipeline tampering, secret access, new tokens, and unusual deploys all leave traces; here, nobody collects, correlates, or watches them. It is a force multiplier for every other risk.
β οΈ Common Exploits
- Audit Logging Disabled: Off, too coarse, or gated behind a higher tier
- Logs Not Centralised: Each tool logs to its own console, nobody aggregates
- No Correlation: Can't tie a commit to the build, token, and deploy
- No Alerting: Config changes, secret reads, new tokens fire nothing
- Short / No Retention: Runner logs vanish, CI logs rotate in days
- Mutable Logs: Pipeline identities can edit or delete their own trail
- No Runner Visibility: Exfiltration hides inside an ordinary build
π΄ Attack Flow
β
2. Act: change config, read secrets, mint tokens, deploy
β
3. Blend: each action resembles routine automation
β
4. Persist / exfiltrate from runners, ship a backdoor
β
5. IMPACT: Objective achieved undetected - found later, by an outsider!
β Vulnerable Code
β Secure Code
β Prevention Checklist
- Enable audit logging across SCM, CI, registry, secrets, cloud
- Confirm the audit tier is actually available on your plan
- Centralise every tool's log stream into one SIEM (forward, don't just store)
- Propagate a correlation/trace ID through every pipeline run
- Alert on pipeline-config changes and workflow-file edits
- Alert on secret reads, new tokens/keys/service accounts
- Alert on permission/protection-rule changes
- Alert on off-hours, out-of-band, and fork-PR runs
- Store logs off-host, write-once (WORM), long retention
- Monitor runner processes and network egress; default-deny
- Baseline normal pipeline behaviour to surface anomalies
- Wire pipeline alerts into the incident-response process
π Detection & Tools
Logging & SIEM:
Runner & Anomaly:
How to Test:
- Confirm SCM/CI/registry audit logs stream to a central platform
- Trace one commit β build β secret use β deploy end to end
- Edit a workflow file; confirm an alert fires with the identity
- Read a secret from a job; confirm the read is logged
- Verify logs are off-host, immutable, and long-retained
- Send runner egress to a novel host; confirm it's flagged
π Real-World Incident Classes
- Supply-chain build compromise discovered downstream: An attacker modifies the build process so published artifacts are backdoored while source looks clean; the tampering is frequently discovered not by the origin org's own monitoring but by an external party noticing anomalous behaviour in the shipped product - and insufficient build/runner logging meant the producer could not detect it or reconstruct which builds were affected.
- Stolen CI/CD token used undetected: A leaked long-lived token or deploy key clones private repos and pushes changes; with no token-use monitoring or access baseline, the abuse continues until the attacker acts overtly or a third party reports it.
- Poisoned fork-PR workflow: A fork PR triggers a workflow running attacker-influenced code with secret access; with no fork-run alerting or runner egress monitoring, the malicious job's outbound connection blends into ordinary CI traffic.
Note: these are described as classes of real events, not attributed breaches with invented figures. Across all of them the root cause is the same - too little trustworthy, centralised, correlated telemetry for anyone to notice the attack or reconstruct it.
π Quick Tips
- DO NOT treat build/job logs as an audit trail
- DO NOT leave logs where the pipeline can edit them
- DO NOT collect without correlating and alerting
- DO enable audit logging across the whole toolchain
- DO centralise and correlate by trace ID
- DO monitor runner process and network egress
- DO baseline normal and alert on off-hours activity
π Compliance
Related Standards:
- SOC 2 CC7.2/CC7.3 - Monitoring & detection
- NIST 800-53 AU family - Audit & Accountability
- PCI-DSS Req 10 - Logging & monitoring
- SSDF (SP 800-218) - Provenance & audit
- SLSA Auditable build records