|
| 1 | +# Aikido Safe Chain - Malware Detection for Package Installation |
| 2 | +# |
| 3 | +# This workflow integrates Aikido Safe Chain to protect against malicious packages |
| 4 | +# during dependency installation in CI/CD pipelines. |
| 5 | +# |
| 6 | +# What is Aikido Safe Chain? |
| 7 | +# Aikido Safe Chain is a free security tool that prevents developers from installing |
| 8 | +# malware through package managers (npm, pnpm, yarn, npx, pnpx). It wraps around |
| 9 | +# package manager commands and verifies packages against Aikido Intel - Open Sources |
| 10 | +# Threat Intelligence before installation. When malware is detected, it blocks the |
| 11 | +# installation and alerts the user. |
| 12 | +# |
| 13 | +# Key features: |
| 14 | +# - Free to use, no tokens required |
| 15 | +# - Works with Node.js 18+ |
| 16 | +# - Supports npm, pnpm, yarn, npx, and pnpx |
| 17 | +# - Currently offers limited scanning for pnpm (scans install command arguments) |
| 18 | +# - Full dependency tree scanning support coming soon for pnpm |
| 19 | +# |
| 20 | +# GitHub Repository: https://github.com/AikidoSec/safe-chain |
| 21 | +# Documentation: https://github.com/AikidoSec/safe-chain#usage-in-cicd |
| 22 | + |
| 23 | +name: Safe Chain Security Check |
| 24 | + |
| 25 | +on: |
| 26 | + pull_request: ~ |
| 27 | + push: |
| 28 | + branches: |
| 29 | + - main |
| 30 | + |
| 31 | +jobs: |
| 32 | + safe-chain-check: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Checkout repository |
| 36 | + uses: actions/checkout@v3 |
| 37 | + |
| 38 | + - name: Install pnpm |
| 39 | + uses: pnpm/action-setup@v4 |
| 40 | + with: |
| 41 | + version: 10 |
| 42 | + |
| 43 | + - name: Setup Node.js |
| 44 | + uses: actions/setup-node@v4 |
| 45 | + with: |
| 46 | + node-version: '22' |
| 47 | + cache: 'pnpm' |
| 48 | + |
| 49 | + - name: Install Aikido Safe Chain |
| 50 | + run: | |
| 51 | + npm install -g @aikidosec/safe-chain |
| 52 | + safe-chain setup-ci |
| 53 | + shell: bash |
| 54 | + |
| 55 | + - name: Install dependencies with malware protection |
| 56 | + run: pnpm install |
| 57 | + shell: bash |
| 58 | + |
| 59 | + - name: Verify installation |
| 60 | + run: | |
| 61 | + echo "✅ All dependencies installed successfully with Aikido Safe Chain protection" |
| 62 | + echo "📦 No malicious packages detected" |
0 commit comments