Supply Chain Attack Analyst Skill
Configuration
$SIEM_PLATFORM - Target SIEM for detection output: splunk, sentinel, elastic, sigma
$SECURITY_CONTENT_PATH - Path to detection content repository
Overview
Software supply chain attacks compromise the tools, dependencies, and pipelines that developers trust. This skill covers analysis and detection across the major attack surfaces: package registries, CI/CD systems, container images, and code repositories.
Attack Surface Taxonomy
1. Package Registry Attacks
| Vector |
Description |
Examples |
| Typosquatting |
Packages with names similar to popular ones |
colourama vs colorama, noblox.js-proxy |
| Dependency confusion |
Public package name matches private internal name |
Alex Birsan's 2021 research |
| Account takeover |
Compromised maintainer credentials |
ua-parser-js, coa, rc (2021) |
| Malicious update |
Legitimate package ships malicious version |
event-stream (2018), colors.js (2022) |
| Install script abuse |
preinstall/postinstall hooks run arbitrary code |
Common npm attack vector |
| Starjacking |
Fake GitHub stars/URLs to build false trust |
Ongoing across npm/PyPI |
2. CI/CD Pipeline Attacks
| Vector |
Description |
Examples |
| Poisoned GitHub Action |
Malicious or compromised Action in workflow |
tj-actions/changed-files (2025) |
| Workflow injection |
Untrusted input in run: blocks |
${{ github.event.issue.title }} |
| Secret exfiltration |
CI job leaks secrets to attacker |
Via compromised deps or Actions |
| Build artifact tampering |
Modify artifacts between build and publish |
SolarWinds SUNBURST pattern |
| Self-hosted runner abuse |
Compromise persistent CI runners |
Shared runners, credential theft |
3. Container & Image Attacks
| Vector |
Description |
Examples |
| Malicious base image |
Trojanized images on Docker Hub |
Cryptomining images |
| Image tag mutation |
Tag latest or v1 points to new malicious image |
Tag vs digest trust |
| Build layer injection |
Malicious layer added during multi-stage build |
Dockerfile manipulation |
| Registry compromise |
Container registry itself is compromised |
CodeCov breach (2021) |
Real-World Campaign Analysis Framework
When analyzing a supply chain incident, follow this structure:
Phase 1: Initial Triage
- What was compromised? — Package name, version range, registry
- What was the payload? — Data exfiltration, backdoor, cryptominer, ransomware
- What was the delivery mechanism? — Install script, import hook, build step
- What was the blast radius? — Download count, dependent packages, time window
Phase 2: Technical Analysis
- Payload extraction — Deobfuscate and analyze malicious code
- C2 identification — Network indicators (domains, IPs, protocols)
- Persistence mechanisms — Does the payload survive package removal?
- Lateral movement — Does it spread to other packages, repos, or systems?
Phase 3: Detection Opportunities
Map findings to detectable behaviors:
| Behavior |
Data Source |
Detection Approach |
| Unexpected network calls from package install |
DNS / proxy logs |
Alert on install-time DNS to uncommon domains |
| Environment variable harvesting |
Process telemetry |
Monitor env / printenv in CI context |
| File writes outside package directory |
File integrity monitoring |
Sysmon EventID 11 / auditd |
| Encoded/obfuscated payloads |
Static analysis |
Entropy analysis, known obfuscation patterns |
| Git credential access |
Audit logs |
Monitor .git-credentials, ~/.ssh/ access |
Detection Engineering Framework
npm / Node.js
Install script monitoring:
title: Suspicious npm Install Script Execution
logsource:
category: process_creation
product: linux
detection:
selection:
ParentCommandLine|contains:
- 'npm install'
- 'npm ci'
- 'yarn install'
CommandLine|contains:
- 'curl '
- 'wget '
- '/dev/tcp/'
- 'base64 -d'
- 'python -c'
condition: selection
level: high
Key indicators:
preinstall / postinstall scripts spawning network tools
eval() or Function() constructors in package code
- Dynamic
require() with encoded strings
- Access to
process.env collecting CI secrets
- DNS lookups during
npm install to non-registry domains
PyPI / Python
Key indicators:
setup.py with cmdclass overrides executing code at install time
__init__.py with obfuscated imports
- Use of
exec(), eval(), compile() with encoded payloads
subprocess.Popen or os.system calls in library code
- Typosquat names close to popular packages (e.g.,
reqeusts)
Detection approach:
title: Suspicious Python Package Install Behavior
logsource:
category: process_creation
product: linux
detection:
selection:
ParentCommandLine|contains:
- 'pip install'
- 'pip3 install'
- 'python setup.py'
CommandLine|contains:
- 'curl '
- 'wget '
- '/bin/sh -c'
- 'base64'
condition: selection
level: high
GitHub Actions
Workflow injection detection:
Look for untrusted input flowing into run: blocks:
# VULNERABLE — attacker-controlled title goes into shell
- run: echo "Issue: ${{ github.event.issue.title }}"
# SAFE — use environment variable
- run: echo "Issue: $ISSUE_TITLE"
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
Key indicators:
- Actions using
actions/checkout with persist-credentials: true on PRs from forks
- Workflow triggers on
pull_request_target with code checkout
GITHUB_TOKEN with write permissions in fork-triggered workflows
- Third-party Actions pinned to branch (
@main) instead of SHA (@a1b2c3d)
- Self-hosted runners used for public repo workflows
Container Supply Chain
Key indicators:
- Images pulled by tag instead of digest (
nginx:latest vs nginx@sha256:abc...)
- Multi-stage builds with unpinned base images
RUN curl ... | sh patterns in Dockerfiles
- Images from unofficial registries or unverified publishers
MITRE ATT&CK Mappings
| Technique |
Supply Chain Relevance |
| T1195.001 |
Supply Chain Compromise: Compromised Software Dependencies |
| T1195.002 |
Supply Chain Compromise: Compromised Software Supply Chain |
| T1059.006 |
Command and Scripting: Python (PyPI attacks) |
| T1059.007 |
Command and Scripting: JavaScript (npm attacks) |
| T1204.002 |
User Execution: Malicious File |
| T1036.005 |
Masquerading: Match Legitimate Name (typosquatting) |
| T1588.001 |
Obtain Capabilities: Malware (repackaged legit tools) |
Investigation Checklist
When a suspected supply chain compromise is reported:
Prevention Recommendations
| Control |
Implementation |
| Lockfiles |
Always commit package-lock.json / poetry.lock / Gemfile.lock |
| Pin Actions by SHA |
uses: actions/checkout@a1b2c3d not @v4 |
| Pin images by digest |
FROM nginx@sha256:abc123 not FROM nginx:latest |
| Scope npm tokens |
Use granular, read-only tokens; enable 2FA for publish |
| Private registry proxy |
Artifactory/Nexus as intermediary; block direct public access |
| SLSA/Sigstore |
Verify build provenance and artifact signatures |
| Dependency review |
GitHub Dependency Review Action, Socket.dev, Snyk |
| Minimal CI permissions |
permissions: read-all default; grant write explicitly |
Adapting Detections to Your SIEM
The Sigma rules above are platform-agnostic. Convert to your target SIEM:
# Splunk
sigma convert -t splunk -p sysmon rule.yml
# Sentinel / KQL
sigma convert -t microsoft365defender rule.yml
# Elastic
sigma convert -t elasticsearch rule.yml
For SIEM-native rules, adapt the detection logic using the appropriate field schema:
- Splunk CIM:
process_name, parent_process_name, process
- Elastic ECS:
process.name, process.parent.name, process.command_line
- Sentinel MDE:
FileName, InitiatingProcessFileName, ProcessCommandLine
Resources
1---2name: supply-chain-attack-analyst3description: Analyze software supply chain attacks across package registries (npm, PyPI, RubyGems), CI/CD pipelines (GitHub Actions, GitLab CI), and container ecosystems. Includes detection engineering patterns for Splunk, Sentinel, Elastic, and Sigma.4---56# Supply Chain Attack Analyst Skill78## Configuration910- `$SIEM_PLATFORM` - Target SIEM for detection output: `splunk`, `sentinel`, `elastic`, `sigma`11- `$SECURITY_CONTENT_PATH` - Path to detection content repository1213## Overview1415Software supply chain attacks compromise the tools, dependencies, and pipelines that developers trust. This skill covers analysis and detection across the major attack surfaces: package registries, CI/CD systems, container images, and code repositories.1617## Attack Surface Taxonomy1819### 1. Package Registry Attacks2021| Vector | Description | Examples |22|--------|-------------|---------|23| **Typosquatting** | Packages with names similar to popular ones | `colourama` vs `colorama`, `noblox.js-proxy` |24| **Dependency confusion** | Public package name matches private internal name | Alex Birsan's 2021 research |25| **Account takeover** | Compromised maintainer credentials | `ua-parser-js`, `coa`, `rc` (2021) |26| **Malicious update** | Legitimate package ships malicious version | `event-stream` (2018), `colors.js` (2022) |27| **Install script abuse** | `preinstall`/`postinstall` hooks run arbitrary code | Common npm attack vector |28| **Starjacking** | Fake GitHub stars/URLs to build false trust | Ongoing across npm/PyPI |2930### 2. CI/CD Pipeline Attacks3132| Vector | Description | Examples |33|--------|-------------|---------|34| **Poisoned GitHub Action** | Malicious or compromised Action in workflow | `tj-actions/changed-files` (2025) |35| **Workflow injection** | Untrusted input in `run:` blocks | `${{ github.event.issue.title }}` |36| **Secret exfiltration** | CI job leaks secrets to attacker | Via compromised deps or Actions |37| **Build artifact tampering** | Modify artifacts between build and publish | SolarWinds SUNBURST pattern |38| **Self-hosted runner abuse** | Compromise persistent CI runners | Shared runners, credential theft |3940### 3. Container & Image Attacks4142| Vector | Description | Examples |43|--------|-------------|---------|44| **Malicious base image** | Trojanized images on Docker Hub | Cryptomining images |45| **Image tag mutation** | Tag `latest` or `v1` points to new malicious image | Tag vs digest trust |46| **Build layer injection** | Malicious layer added during multi-stage build | Dockerfile manipulation |47| **Registry compromise** | Container registry itself is compromised | CodeCov breach (2021) |4849## Real-World Campaign Analysis Framework5051When analyzing a supply chain incident, follow this structure:5253### Phase 1: Initial Triage54551. **What was compromised?** — Package name, version range, registry562. **What was the payload?** — Data exfiltration, backdoor, cryptominer, ransomware573. **What was the delivery mechanism?** — Install script, import hook, build step584. **What was the blast radius?** — Download count, dependent packages, time window5960### Phase 2: Technical Analysis61621. **Payload extraction** — Deobfuscate and analyze malicious code632. **C2 identification** — Network indicators (domains, IPs, protocols)643. **Persistence mechanisms** — Does the payload survive package removal?654. **Lateral movement** — Does it spread to other packages, repos, or systems?6667### Phase 3: Detection Opportunities6869Map findings to detectable behaviors:7071| Behavior | Data Source | Detection Approach |72|----------|------------|-------------------|73| Unexpected network calls from package install | DNS / proxy logs | Alert on install-time DNS to uncommon domains |74| Environment variable harvesting | Process telemetry | Monitor `env` / `printenv` in CI context |75| File writes outside package directory | File integrity monitoring | Sysmon EventID 11 / auditd |76| Encoded/obfuscated payloads | Static analysis | Entropy analysis, known obfuscation patterns |77| Git credential access | Audit logs | Monitor `.git-credentials`, `~/.ssh/` access |7879## Detection Engineering Framework8081### npm / Node.js8283**Install script monitoring:**8485```sigma86title: Suspicious npm Install Script Execution87logsource:88 category: process_creation89 product: linux90detection:91 selection:92 ParentCommandLine|contains:93 - 'npm install'94 - 'npm ci'95 - 'yarn install'96 CommandLine|contains:97 - 'curl '98 - 'wget '99 - '/dev/tcp/'100 - 'base64 -d'101 - 'python -c'102 condition: selection103level: high104```105106**Key indicators:**107- `preinstall` / `postinstall` scripts spawning network tools108- `eval()` or `Function()` constructors in package code109- Dynamic `require()` with encoded strings110- Access to `process.env` collecting CI secrets111- DNS lookups during `npm install` to non-registry domains112113### PyPI / Python114115**Key indicators:**116- `setup.py` with `cmdclass` overrides executing code at install time117- `__init__.py` with obfuscated imports118- Use of `exec()`, `eval()`, `compile()` with encoded payloads119- `subprocess.Popen` or `os.system` calls in library code120- Typosquat names close to popular packages (e.g., `reqeusts`)121122**Detection approach:**123124```sigma125title: Suspicious Python Package Install Behavior126logsource:127 category: process_creation128 product: linux129detection:130 selection:131 ParentCommandLine|contains:132 - 'pip install'133 - 'pip3 install'134 - 'python setup.py'135 CommandLine|contains:136 - 'curl '137 - 'wget '138 - '/bin/sh -c'139 - 'base64'140 condition: selection141level: high142```143144### GitHub Actions145146**Workflow injection detection:**147148Look for untrusted input flowing into `run:` blocks:149150```yaml151# VULNERABLE — attacker-controlled title goes into shell152- run: echo "Issue: ${{ github.event.issue.title }}"153154# SAFE — use environment variable155- run: echo "Issue: $ISSUE_TITLE"156 env:157 ISSUE_TITLE: ${{ github.event.issue.title }}158```159160**Key indicators:**161- Actions using `actions/checkout` with `persist-credentials: true` on PRs from forks162- Workflow triggers on `pull_request_target` with code checkout163- `GITHUB_TOKEN` with write permissions in fork-triggered workflows164- Third-party Actions pinned to branch (`@main`) instead of SHA (`@a1b2c3d`)165- Self-hosted runners used for public repo workflows166167### Container Supply Chain168169**Key indicators:**170- Images pulled by tag instead of digest (`nginx:latest` vs `nginx@sha256:abc...`)171- Multi-stage builds with unpinned base images172- `RUN curl ... | sh` patterns in Dockerfiles173- Images from unofficial registries or unverified publishers174175## MITRE ATT&CK Mappings176177| Technique | Supply Chain Relevance |178|-----------|----------------------|179| T1195.001 | Supply Chain Compromise: Compromised Software Dependencies |180| T1195.002 | Supply Chain Compromise: Compromised Software Supply Chain |181| T1059.006 | Command and Scripting: Python (PyPI attacks) |182| T1059.007 | Command and Scripting: JavaScript (npm attacks) |183| T1204.002 | User Execution: Malicious File |184| T1036.005 | Masquerading: Match Legitimate Name (typosquatting) |185| T1588.001 | Obtain Capabilities: Malware (repackaged legit tools) |186187## Investigation Checklist188189When a suspected supply chain compromise is reported:190191- [ ] Identify affected package name, version(s), and registry192- [ ] Determine download count / install window193- [ ] Extract and deobfuscate payload194- [ ] Identify C2 infrastructure (domains, IPs)195- [ ] Check if payload persists after package removal196- [ ] Enumerate dependent packages (transitive dependencies)197- [ ] Search for similar typosquat variants still active198- [ ] Check if maintainer account was compromised vs new account199- [ ] File registry takedown request (npm: `npm unpublish`, PyPI: admin report)200- [ ] Create IOC-based detections for immediate response201- [ ] Create behavioral detections for long-term coverage202- [ ] Update package lockfiles across affected projects203- [ ] Audit CI/CD pipelines for exposed secrets during compromise window204205## Prevention Recommendations206207| Control | Implementation |208|---------|---------------|209| **Lockfiles** | Always commit `package-lock.json` / `poetry.lock` / `Gemfile.lock` |210| **Pin Actions by SHA** | `uses: actions/checkout@a1b2c3d` not `@v4` |211| **Pin images by digest** | `FROM nginx@sha256:abc123` not `FROM nginx:latest` |212| **Scope npm tokens** | Use granular, read-only tokens; enable 2FA for publish |213| **Private registry proxy** | Artifactory/Nexus as intermediary; block direct public access |214| **SLSA/Sigstore** | Verify build provenance and artifact signatures |215| **Dependency review** | GitHub Dependency Review Action, Socket.dev, Snyk |216| **Minimal CI permissions** | `permissions: read-all` default; grant write explicitly |217218## Adapting Detections to Your SIEM219220The Sigma rules above are platform-agnostic. Convert to your target SIEM:221222```bash223# Splunk224sigma convert -t splunk -p sysmon rule.yml225226# Sentinel / KQL227sigma convert -t microsoft365defender rule.yml228229# Elastic230sigma convert -t elasticsearch rule.yml231```232233For SIEM-native rules, adapt the detection logic using the appropriate field schema:234- **Splunk CIM:** `process_name`, `parent_process_name`, `process`235- **Elastic ECS:** `process.name`, `process.parent.name`, `process.command_line`236- **Sentinel MDE:** `FileName`, `InitiatingProcessFileName`, `ProcessCommandLine`237238## Resources239240- [SLSA Framework](https://slsa.dev/) — Supply chain Levels for Software Artifacts241- [OpenSSF Scorecard](https://securityscorecards.dev/) — Automated security health checks for OSS242- [Socket.dev](https://socket.dev/) — Package supply chain security243- [Sigstore](https://sigstore.dev/) — Keyless signing and verification244- [CISA Supply Chain Security](https://www.cisa.gov/supply-chain) — Government guidance