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.4metadata:5 source: https://skillmd.com/skills/mhaggis/supply-chain-attack-analyst6---78# Supply Chain Attack Analyst Skill910## Configuration1112- `$SIEM_PLATFORM` - Target SIEM for detection output: `splunk`, `sentinel`, `elastic`, `sigma`13- `$SECURITY_CONTENT_PATH` - Path to detection content repository1415## Overview1617Software 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.1819## Attack Surface Taxonomy2021### 1. Package Registry Attacks2223| Vector | Description | Examples |24|--------|-------------|---------|25| **Typosquatting** | Packages with names similar to popular ones | `colourama` vs `colorama`, `noblox.js-proxy` |26| **Dependency confusion** | Public package name matches private internal name | Alex Birsan's 2021 research |27| **Account takeover** | Compromised maintainer credentials | `ua-parser-js`, `coa`, `rc` (2021) |28| **Malicious update** | Legitimate package ships malicious version | `event-stream` (2018), `colors.js` (2022) |29| **Install script abuse** | `preinstall`/`postinstall` hooks run arbitrary code | Common npm attack vector |30| **Starjacking** | Fake GitHub stars/URLs to build false trust | Ongoing across npm/PyPI |3132### 2. CI/CD Pipeline Attacks3334| Vector | Description | Examples |35|--------|-------------|---------|36| **Poisoned GitHub Action** | Malicious or compromised Action in workflow | `tj-actions/changed-files` (2025) |37| **Workflow injection** | Untrusted input in `run:` blocks | `${{ github.event.issue.title }}` |38| **Secret exfiltration** | CI job leaks secrets to attacker | Via compromised deps or Actions |39| **Build artifact tampering** | Modify artifacts between build and publish | SolarWinds SUNBURST pattern |40| **Self-hosted runner abuse** | Compromise persistent CI runners | Shared runners, credential theft |4142### 3. Container & Image Attacks4344| Vector | Description | Examples |45|--------|-------------|---------|46| **Malicious base image** | Trojanized images on Docker Hub | Cryptomining images |47| **Image tag mutation** | Tag `latest` or `v1` points to new malicious image | Tag vs digest trust |48| **Build layer injection** | Malicious layer added during multi-stage build | Dockerfile manipulation |49| **Registry compromise** | Container registry itself is compromised | CodeCov breach (2021) |5051## Real-World Campaign Analysis Framework5253When analyzing a supply chain incident, follow this structure:5455### Phase 1: Initial Triage56571. **What was compromised?** — Package name, version range, registry582. **What was the payload?** — Data exfiltration, backdoor, cryptominer, ransomware593. **What was the delivery mechanism?** — Install script, import hook, build step604. **What was the blast radius?** — Download count, dependent packages, time window6162### Phase 2: Technical Analysis63641. **Payload extraction** — Deobfuscate and analyze malicious code652. **C2 identification** — Network indicators (domains, IPs, protocols)663. **Persistence mechanisms** — Does the payload survive package removal?674. **Lateral movement** — Does it spread to other packages, repos, or systems?6869### Phase 3: Detection Opportunities7071Map findings to detectable behaviors:7273| Behavior | Data Source | Detection Approach |74|----------|------------|-------------------|75| Unexpected network calls from package install | DNS / proxy logs | Alert on install-time DNS to uncommon domains |76| Environment variable harvesting | Process telemetry | Monitor `env` / `printenv` in CI context |77| File writes outside package directory | File integrity monitoring | Sysmon EventID 11 / auditd |78| Encoded/obfuscated payloads | Static analysis | Entropy analysis, known obfuscation patterns |79| Git credential access | Audit logs | Monitor `.git-credentials`, `~/.ssh/` access |8081## Detection Engineering Framework8283### npm / Node.js8485**Install script monitoring:**8687```sigma88title: Suspicious npm Install Script Execution89logsource:90 category: process_creation91 product: linux92detection:93 selection:94 ParentCommandLine|contains:95 - 'npm install'96 - 'npm ci'97 - 'yarn install'98 CommandLine|contains:99 - 'curl '100 - 'wget '101 - '/dev/tcp/'102 - 'base64 -d'103 - 'python -c'104 condition: selection105level: high106```107108**Key indicators:**109- `preinstall` / `postinstall` scripts spawning network tools110- `eval()` or `Function()` constructors in package code111- Dynamic `require()` with encoded strings112- Access to `process.env` collecting CI secrets113- DNS lookups during `npm install` to non-registry domains114115### PyPI / Python116117**Key indicators:**118- `setup.py` with `cmdclass` overrides executing code at install time119- `__init__.py` with obfuscated imports120- Use of `exec()`, `eval()`, `compile()` with encoded payloads121- `subprocess.Popen` or `os.system` calls in library code122- Typosquat names close to popular packages (e.g., `reqeusts`)123124**Detection approach:**125126```sigma127title: Suspicious Python Package Install Behavior128logsource:129 category: process_creation130 product: linux131detection:132 selection:133 ParentCommandLine|contains:134 - 'pip install'135 - 'pip3 install'136 - 'python setup.py'137 CommandLine|contains:138 - 'curl '139 - 'wget '140 - '/bin/sh -c'141 - 'base64'142 condition: selection143level: high144```145146### GitHub Actions147148**Workflow injection detection:**149150Look for untrusted input flowing into `run:` blocks:151152```yaml153# VULNERABLE — attacker-controlled title goes into shell154- run: echo "Issue: ${{ github.event.issue.title }}"155156# SAFE — use environment variable157- run: echo "Issue: $ISSUE_TITLE"158 env:159 ISSUE_TITLE: ${{ github.event.issue.title }}160```161162**Key indicators:**163- Actions using `actions/checkout` with `persist-credentials: true` on PRs from forks164- Workflow triggers on `pull_request_target` with code checkout165- `GITHUB_TOKEN` with write permissions in fork-triggered workflows166- Third-party Actions pinned to branch (`@main`) instead of SHA (`@a1b2c3d`)167- Self-hosted runners used for public repo workflows168169### Container Supply Chain170171**Key indicators:**172- Images pulled by tag instead of digest (`nginx:latest` vs `nginx@sha256:abc...`)173- Multi-stage builds with unpinned base images174- `RUN curl ... | sh` patterns in Dockerfiles175- Images from unofficial registries or unverified publishers176177## MITRE ATT&CK Mappings178179| Technique | Supply Chain Relevance |180|-----------|----------------------|181| T1195.001 | Supply Chain Compromise: Compromised Software Dependencies |182| T1195.002 | Supply Chain Compromise: Compromised Software Supply Chain |183| T1059.006 | Command and Scripting: Python (PyPI attacks) |184| T1059.007 | Command and Scripting: JavaScript (npm attacks) |185| T1204.002 | User Execution: Malicious File |186| T1036.005 | Masquerading: Match Legitimate Name (typosquatting) |187| T1588.001 | Obtain Capabilities: Malware (repackaged legit tools) |188189## Investigation Checklist190191When a suspected supply chain compromise is reported:192193- [ ] Identify affected package name, version(s), and registry194- [ ] Determine download count / install window195- [ ] Extract and deobfuscate payload196- [ ] Identify C2 infrastructure (domains, IPs)197- [ ] Check if payload persists after package removal198- [ ] Enumerate dependent packages (transitive dependencies)199- [ ] Search for similar typosquat variants still active200- [ ] Check if maintainer account was compromised vs new account201- [ ] File registry takedown request (npm: `npm unpublish`, PyPI: admin report)202- [ ] Create IOC-based detections for immediate response203- [ ] Create behavioral detections for long-term coverage204- [ ] Update package lockfiles across affected projects205- [ ] Audit CI/CD pipelines for exposed secrets during compromise window206207## Prevention Recommendations208209| Control | Implementation |210|---------|---------------|211| **Lockfiles** | Always commit `package-lock.json` / `poetry.lock` / `Gemfile.lock` |212| **Pin Actions by SHA** | `uses: actions/checkout@a1b2c3d` not `@v4` |213| **Pin images by digest** | `FROM nginx@sha256:abc123` not `FROM nginx:latest` |214| **Scope npm tokens** | Use granular, read-only tokens; enable 2FA for publish |215| **Private registry proxy** | Artifactory/Nexus as intermediary; block direct public access |216| **SLSA/Sigstore** | Verify build provenance and artifact signatures |217| **Dependency review** | GitHub Dependency Review Action, Socket.dev, Snyk |218| **Minimal CI permissions** | `permissions: read-all` default; grant write explicitly |219220## Adapting Detections to Your SIEM221222The Sigma rules above are platform-agnostic. Convert to your target SIEM:223224```bash225# Splunk226sigma convert -t splunk -p sysmon rule.yml227228# Sentinel / KQL229sigma convert -t microsoft365defender rule.yml230231# Elastic232sigma convert -t elasticsearch rule.yml233```234235For SIEM-native rules, adapt the detection logic using the appropriate field schema:236- **Splunk CIM:** `process_name`, `parent_process_name`, `process`237- **Elastic ECS:** `process.name`, `process.parent.name`, `process.command_line`238- **Sentinel MDE:** `FileName`, `InitiatingProcessFileName`, `ProcessCommandLine`239240## Resources241242- [SLSA Framework](https://slsa.dev/) — Supply chain Levels for Software Artifacts243- [OpenSSF Scorecard](https://securityscorecards.dev/) — Automated security health checks for OSS244- [Socket.dev](https://socket.dev/) — Package supply chain security245- [Sigstore](https://sigstore.dev/) — Keyless signing and verification246- [CISA Supply Chain Security](https://www.cisa.gov/supply-chain) — Government guidance