Security Check
by @gawezepobi09-debug
π Pre-installation security verification for external code and dependencies. Automated risk analysis for GitHub repos, npm packages, PyPI libraries, and she...
clawhub install pre-install-security-checkπ About This Skill
name: security-check description: π Pre-installation security verification for external code and dependencies. Automated risk analysis for GitHub repos, npm packages, PyPI libraries, and shell scripts. Integrates CVE databases (Snyk, Safety DB) to detect vulnerabilities before you install. Shows risk level (β safe / β οΈ review / β dangerous) with actionable recommendations. First comprehensive security skill for OpenClaw β protect your system before downloading untrusted code. tags: security, dependencies, vulnerability, safety, audit, npm, pypi, github, cve, snyk, supply-chain, pre-install license: MIT
Security Check
Pre-installation security verification for external code and dependencies.
Core Principle
Always verify before you download. External code (GitHub repos, npm packages, PyPI libraries, scripts) can contain malicious code, vulnerabilities, or supply chain attacks. This skill automates security checks before executing potentially dangerous commands.
When to Use
Automatically trigger security check before:
git clone β GitHub/GitLab repositoriespip install β Python packagesnpm install β Node packagescurl | bash β Shell scriptsHow It Works
1. Detect Source Type
Identify what's being installed:
2. Gather Security Metrics
Based on source type, collect:
For GitHub repos:
security labels)For PyPI packages:
For npm packages:
3. Calculate Risk Score
Use threshold-based scoring (inspired by Skantek):
Risk Score = 0Positive signals (reduce risk):
High stars/downloads: -10
Recent activity (< 30 days): -5
Well-known maintainer: -5
Clear license: -3
Few dependencies: -5 Negative signals (increase risk):
No activity (> 1 year): +15
No license: +10
Many dependencies: +5 per 10 deps
Known CVEs: +20 per CVE
Suspicious patterns: +25
Risk Levels:
Score < 0 β β
Safe (proceed automatically)0 <= Score < 15 β β οΈ Review (show summary, ask confirmation)Score >= 15 β β Dangerous (strong warning, manual approval required)4. Show Summary
Present findings:
π Security Check: Risk Level: β οΈ REVIEW
Metrics:
β
Stars: 15.2k | Forks: 3.1k
β οΈ Last commit: 8 months ago
β
License: MIT
β οΈ Open security issues: 2
β
Dependencies: 5
Known Issues:
- CVE-2024-12345 (Medium severity, patched in v1.2.3)
Recommendation: Update to v1.2.3+ before installing.
Proceed? [Y/n]
5. Request Confirmation
Based on risk level:
Implementation Pattern
# Before: git clone https://github.com/user/repo
After:
1. Detect: GitHub repo
2. Fetch metrics via GitHub API
3. Calculate risk score
4. Show summary
5. Ask confirmation if needed
6. Proceed or abort
Integration Points
GitHub API
curl -s "https://api.github.com/repos/{owner}/{repo}"
Returns: stars, forks, updated_at, open_issues_count, license
PyPI JSON API
curl -s "https://pypi.org/pypi/{package}/json"
Returns: downloads, releases, maintainers
npm Registry
curl -s "https://registry.npmjs.org/{package}"
Returns: downloads (via npm-stat), dependencies, license
Vulnerability Databases
Best Practices from Research
Based on Adyen's Skantek and GitHub's Dependabot:
1. Use fewer dependencies β Each dependency multiplies risk 2. Regular rescanning β Zero-day exploits need monitoring 3. Private registry β For approved packages (optional) 4. Threshold-based β Not binary safe/unsafe, but risk spectrum 5. Compatibility scores β Check if update breaks CI tests
Guardrails
Example Workflows
Example 1: Safe Package
User: pip install requestsSecurity Check:
β
SAFE: requests (PyPI)
- Downloads: 50M/month
- Last release: 2 weeks ago
- License: Apache 2.0
- Dependencies: 5
- Known CVEs: 0
Proceeding with installation...
Example 2: Risky Repo
User: git clone https://github.com/suspicious/toolSecurity Check:
β DANGEROUS: suspicious/tool
- Stars: 12
- Last commit: 3 years ago
- Open issues: 45 (3 security labels)
- No license
- Risk score: 35
β οΈ This repository shows multiple red flags.
Consider alternatives or manual code review.
Proceed anyway? [y/N]
Example 3: Update Needed
User: npm install left-padSecurity Check:
β οΈ REVIEW: left-pad@1.0.0
- Downloads: 2M/week
- CVE-2024-xxxxx: Prototype pollution (High)
- Fixed in: v1.0.1
Recommendation: Install v1.0.1 instead.
Use latest version? [Y/n]
Future Enhancements
When skill matures:
1. Local cache β Cache risk scores for 24h to reduce API calls 2. Pattern detection β Scan code for suspicious patterns (eval, exec, shell commands) 3. CI/CD integration β Block deployments with vulnerable dependencies 4. Custom rules β User-defined thresholds and blocklists 5. Reports β Generate security audit logs
References
For detailed implementation guidance:
references/skantek-approach.md β Adyen's methodologyreferences/vulnerability-databases.md β How to query CVE databases