.claude/skills/supply-chain-analyst/SKILL.md
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.
npx skillsauth add mhaggis/security-detections-mcp Supply Chain Attack AnalystInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
$SIEM_PLATFORM - Target SIEM for detection output: splunk, sentinel, elastic, sigma$SECURITY_CONTENT_PATH - Path to detection content repositorySoftware 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.
| 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 |
| 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 |
| 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) |
When analyzing a supply chain incident, follow this structure:
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 |
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 toolseval() or Function() constructors in package coderequire() with encoded stringsprocess.env collecting CI secretsnpm install to non-registry domainsKey indicators:
setup.py with cmdclass overrides executing code at install time__init__.py with obfuscated importsexec(), eval(), compile() with encoded payloadssubprocess.Popen or os.system calls in library codereqeusts)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
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/checkout with persist-credentials: true on PRs from forkspull_request_target with code checkoutGITHUB_TOKEN with write permissions in fork-triggered workflows@main) instead of SHA (@a1b2c3d)Key indicators:
nginx:latest vs nginx@sha256:abc...)RUN curl ... | sh patterns in Dockerfiles| 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) |
When a suspected supply chain compromise is reported:
npm unpublish, PyPI: admin report)| 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 |
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:
process_name, parent_process_name, processprocess.name, process.parent.name, process.command_lineFileName, InitiatingProcessFileName, ProcessCommandLinetesting
Expert at analyzing unstructured threat intelligence reports (CISA alerts, vendor blogs, research papers) and extracting actionable detection logic, TTPs, behavioral indicators, and MITRE ATT&CK mappings. Focuses on behaviors over IOCs. Use when provided with threat reports, security advisories, or campaign documentation.
testing
Optimize detection queries for performance across Splunk (SPL), Microsoft Sentinel (KQL), and Elastic Security (EQL/ES|QL). Covers search pipeline internals, common anti-patterns, and optimization techniques for detection rules on each platform.
tools
Analyze pull requests for detection coverage gaps and recommend additional detections, story alignments, and test coverage to extend PRs before merge.
testing
Expert at creating and validating detection rule files for multiple SIEM platforms. Supports Splunk security_content YAML, Sigma rules, Elastic detection TOML, and KQL analytics. Ensures compliance with repository conventions and optimal query performance. Use when creating or modifying detection rules.