Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions templates/dependency-risk-analyzer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<a href="https://studio.lamatic.ai/template/dependency-risk-analyzer" target="_blank" style="text-decoration:none;">
<div align="right">
<span style="display:inline-block;background:#e63946;color:#fff;border-radius:6px;padding:10px 22px;font-size:16px;font-weight:bold;letter-spacing:0.5px;text-align:center;transition:background 0.2s;box-shadow:0 2px 8px 0 #0001;">Deploy on Lamatic</span>
</div>
</a>

# Dependency Risk Analyzer

## About This Flow

**Paste a `package.json` or `requirements.txt` β†’ Get instant security analysis!**

This flow provides comprehensive dependency risk analysis for npm (Node.js) and Python projects. It automatically detects:
- 🏚️ **Abandoned packages** (last updated > 365 days)
- πŸ”“ **Known CVEs** (from OSV.dev vulnerability database)
- βš–οΈ **License risks** (GPL, AGPL detection)
- πŸ‘€ **Bus factor** (single-maintainer packages)

**Why use this?**
- βœ… **Free** (unlike Snyk)
- βœ… **Comprehensive** (more than Dependabot's version-only checks)
- βœ… **Multi-ecosystem** (npm + Python support)
- βœ… **AI-powered** (generates human-readable markdown reports)

This flow uses **18 nodes** working together to analyze dependencies, check vulnerabilities, calculate risk scores, and generate professional security reports.

## Flow Architecture

### 11-Node Pipeline Design

1. **API Request (Trigger)** β†’ Entry point accepting dependency file content
2. **Classifier Node** β†’ Detects npm vs Python and routes accordingly
3. **Parser Code Nodes (2x)** β†’ Extracts package names and versions
4. **Loop Node** β†’ Iterates over each package
5. **Registry API Nodes (npm/PyPI)** β†’ Fetches package metadata
6. **OSV.dev CVE API Nodes** β†’ Checks vulnerability database
7. **Risk Scoring Code Nodes** β†’ Calculates 0-100 risk scores
8. **Loop End Node** β†’ Collects all risk analysis results
9. **Generate Text Nodes (LLM, 2x)** β†’ Creates markdown security reports
10. **Merge Code Node** β†’ Combines npm/Python branch outputs
11. **API Response Node** β†’ Returns final report

### Risk Scoring System

Each package receives a risk score based on:

| Risk Signal | Detection Method | Points |
|------------|------------------|--------|
| 🏚️ Abandonment | Last updated > 365 days | +30 |
| πŸ‘€ Bus Factor | Only 1 maintainer | +20 |
| πŸ”“ CVEs | Known vulnerabilities | +15 per CVE |
| βš–οΈ Risky License | GPL, AGPL detected | +20 |

**Risk Levels:**
- 🟒 **LOW (0-19):** Safe to use
- 🟑 **MEDIUM (20-39):** Monitor closely
- 🟠 **HIGH (40-69):** Review urgently
- πŸ”΄ **CRITICAL (70-100):** Immediate action required

## Flow Components

This workflow includes the following node types:
- API Request
- Classifier
- Code
- Loop
- API
- Loop End
- Generate Text
- API Response

## Configuration Requirements

This flow requires configuration for **3 node(s)** with private inputs:
- LLM API keys for report generation
- OSV.dev API access (free, no key required)
- npm/PyPI registry access (public APIs)

All required configurations are documented in the `inputs.json` file.

## Example Usage

### Input (npm - package.json):
```json
{
"dependencies": {
"express": "^4.18.2",
"lodash": "^4.17.11",
"react": "^18.2.0"
}
}
```

### Input (Python - requirements.txt):
```
flask==2.3.2
requests==2.31.0
django==4.2.0
```

### Output:
A professional markdown security report containing:
- Executive summary of risks found
- Per-package risk scores and levels
- CVE details with severity ratings
- Actionable recommendations
- Links to vulnerability databases

## Use Cases

- πŸ”’ **Security Audits** β€” Regular dependency risk assessments
- πŸ“Š **CI/CD Integration** β€” Automated security checks in pipelines
- 🎯 **Compliance** β€” License risk detection for legal requirements
- πŸ›‘οΈ **Maintenance Planning** β€” Identify abandoned packages before issues arise

## Files Included

- **config.json** - Complete flow structure with 18 nodes and connections
- **inputs.json** - LLM and API configurations
- **meta.json** - Flow metadata and information
- **README.md** - This documentation

## How to Use

1. **Import into Lamatic Studio**
- Click the "Deploy on Lamatic" button above
- Or manually import via Templates β†’ Import

2. **Configure Providers**
- Add your LLM API key (OpenAI, Anthropic, etc.)
- No configuration needed for OSV.dev or package registries

3. **Test the Flow**
- Paste a `package.json` or `requirements.txt` content
- Hit "Test" to see the security report

4. **Deploy & Use**
- Deploy the flow to get an API endpoint
- Integrate into your CI/CD pipeline
- Or use manually for security audits

## Tags

Security, DevOps, Automation, Analysis, npm, Python, CVE, Vulnerability Scanning

---
*Exported from Lamatic Flow Editor*
*Generated on 03/04/2026*
*Flow ID: dependency-risk-analyzer*
Loading
Loading