Join our Newsletter — 33% off our NHI Course
Home FAQ Cyber Security What should organisations do first when they suspect…
Cyber Security

What should organisations do first when they suspect a malicious package could be executed in CI/CD?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated September 17, 2026 Domain: Cyber Security

The first priority is to reduce the blast radius of the pipeline. Use scoped credentials, validate artifacts, pin exact dependency versions, and enforce lockfiles and audit checks before execution. Then inspect the job for unexpected network calls, secret exposure, and drift in build behaviour. A pipeline should be treated as an attack surface, not just an automation layer.

Reduce the blast radius before you execute anything

When a package looks suspicious in CI/CD, the first move is containment, not curiosity. Treat the pipeline as a live attack surface and assume the package may try to read secrets, reach external services, or alter build outputs. Reduce what the job can touch, then decide whether you need deeper inspection or a full stop.

That means narrowing credentials to the minimum scope needed for the job, verifying the exact artifact you intend to run, pinning dependency versions, and enforcing lockfiles so the build cannot drift. If the package is meant to be deterministic, any unexpected change in dependency resolution or execution path is a warning signal in itself.

A useful reference point is SLSA, which centres build integrity and provenance, and OpenSSF, which collects supply-chain hardening guidance for secure software delivery. Both support the same practical judgment: trust the build less until you can prove what actually ran.

NHIMG’s CI/CD pipeline exploitation case study shows why this matters, especially when pipeline secrets and repository state are mismanaged. If the job can see more than it needs, a malicious package does not need to “break out” in an exotic way, it only needs to use the permissions already granted.

What to inspect once the job is constrained

After blast radius is reduced, inspect the run for behaviours that do not match the normal build pattern. The most important signs are unexpected network calls, new outbound destinations, unusual child processes, altered file writes, and access to environment variables or mounted secrets that the package should never need.

Do not limit the review to a single execution log. Compare the current run with a known-good baseline for the same pipeline, branch type, and dependency set. In CI/CD, drift often shows up as a small behavioural change first, long before it becomes an obvious compromise.

For incident handling, the key question is whether the package merely looked risky or actually had an opportunity to exfiltrate material secrets or modify trusted build outputs. If you find evidence of secret exposure, suspicious network traffic, or tampered artifacts, treat that as a pipeline security event and escalate accordingly.

Supply-chain compromise is often about abusing the trust boundary around build tooling, which is why references such as Shai Hulud npm malware campaign and Reviewdog GitHub Action supply chain attack are useful comparators. They illustrate the same failure mode: malicious code in the delivery path using pipeline trust to reach secrets and repositories.

Practitioner judgment that prevents the next compromise

What to prioritise: First decide whether the package can affect production trust, then decide whether it should be analysed further. If execution is not strictly required, quarantine the dependency and fail closed rather than letting the pipeline continue on partial trust.

What to verify: Confirm that credentials used in the job are scoped to the task, expire when the run ends, and cannot be reused outside the intended repository or environment. If the build relies on long-lived tokens, the issue is larger than one suspicious package because the pipeline already has an overly durable access path.

What good looks like: A suspicious package can be fetched, inspected, and rejected without exposing secrets, mutating artifacts, or reaching anything outside the approved build boundaries. The investigation outcome should be evidence-driven, but the control decision should be made before the package gets broad execution authority.

Practitioner takeaway: Suspicious packages are safest to handle as trust problems, not malware puzzles, because the most important control is whether the pipeline can be harmed while you are still trying to understand it.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
CIS Controls v8CIS 6 — Access Control ManagementCI/CD suspicion calls for tightening job access and scoped credentials.
CIS 8 — Audit Log ManagementInspecting suspicious pipeline behaviour depends on logs and execution evidence.
CIS 12 — Network Infrastructure ManagementUnexpected outbound calls from a package are a key indicator in CI/CD compromise.
Recommendation — Restrict pipeline credentials to the minimum access needed for the build. Collect and review pipeline logs for unexpected execution, network, and secret-access activity. Constrain build-network egress so untrusted jobs cannot freely contact external services.
NIST CSF 2.0DE.CM — Continuous MonitoringSuspicious package execution requires monitoring for anomalous build behaviour and exposure.
PR.AC — Access ControlReducing blast radius in CI/CD depends on limiting what the job can reach.
PR.DS — Data SecurityThe main risk is secret exposure and artifact integrity during package execution.
Recommendation — Monitor CI/CD runs for abnormal process, network, and artifact activity. Apply least-privilege access to pipeline identities, secrets, and deployment targets. Protect secrets and build artifacts from unauthorized disclosure or modification.
OWASP Non-Human Identity Top 10NHI-01 — Secret Sprawl and ExposureCI/CD pipelines commonly expose secrets to malicious packages if scope is too broad.
NHI-02 — Overprivileged Non-Human IdentitiesPipeline jobs often fail by granting more access than the build needs.
NHI-08 — Credential Lifecycle and RotationSuspicious execution warrants checking whether pipeline secrets are long-lived or reusable.
Recommendation — Eliminate exposed secrets in build environments and keep them out of untrusted execution paths. Reduce pipeline identity privileges to the smallest set required for each job. Rotate any pipeline credentials that may have been exposed or reused outside intent.

Deepen Your Knowledge

Sign up to our weekly newsletter — get 33% off our NHI Foundation Level Course

    NHIMG Editorial Note
    Reviewed and updated by the NHIMG editorial team on September 17, 2026.
    NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org