Merge pull request #70 from AikidoSec/non-interactive-terminal-support

Support for CI/CD
This commit is contained in:
Sander Declerck 2025-09-24 15:37:36 +02:00 committed by GitHub
commit cea4507559
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 797 additions and 5 deletions

View file

@ -88,4 +88,60 @@ npm install suspicious-package --safe-chain-malware-action=prompt
# Usage in CI/CD
[Learn more about Safe Chain CI/CD integration in the Aikido docs.](https://help.aikido.dev/code-scanning/aikido-malware-scanning/malware-scanning-with-safe-chain-in-ci-cd-environments)
You can protect your CI/CD pipelines from malicious packages by integrating Aikido Safe Chain into your build process. This ensures that any packages installed during your automated builds are checked for malware before installation.
For optimal protection in CI/CD environments, we recommend using **npm >= 10.4.0** as it provides full dependency tree scanning. Other package managers currently offer limited scanning of install command arguments only.
## Setup
To use Aikido Safe Chain in CI/CD environments, run the following command after installing the package:
```shell
safe-chain setup-ci
```
This automatically configures your CI environment to use Aikido Safe Chain for all package manager commands.
## Supported Platforms
- ✅ **GitHub Actions**
- ✅ **Azure Pipelines**
## GitHub Actions Example
```yaml
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Setup safe-chain
run: |
npm i -g @aikidosec/safe-chain
safe-chain setup-ci
- name: Install dependencies
run: |
npm ci
```
## Azure DevOps Example
```yaml
- task: NodeTool@0
inputs:
versionSpec: "22.x"
displayName: "Install Node.js"
- script: |
npm i -g @aikidosec/safe-chain
safe-chain setup-ci
displayName: "Install safe chain"
- script: |
npm ci
displayName: "npm install and build"
```
After setup, all subsequent package manager commands in your CI pipeline will automatically be protected by Aikido Safe Chain's malware detection.