Skip to content

Security Check

Flagged

๐Ÿ”’ Pre-installation security verification for external code and dependencies. Automated risk analysis for GitHub repos, npm packages, PyPI libraries, and she...

59 downloads
$ Add to .claude/skills/

About This Skill

# 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 <url>` โ€” GitHub/GitLab repositories
  • `pip install <package>` โ€” Python packages
  • `npm install <package>` โ€” Node packages
  • `curl <url> | bash` โ€” Shell scripts
  • Downloading any external code for execution

How It Works

1. Detect Source Type

  • Identify what's being installed:
  • GitHub URL โ†’ Repository check
  • PyPI package name โ†’ Package check
  • npm package name โ†’ Package check
  • Direct URL โ†’ Script/file check

2. Gather Security Metrics

Based on source type, collect:

  • For GitHub repos:
  • Stars, forks, watchers
  • Last commit date
  • Open issues (especially `security` labels)
  • Contributors count
  • License type
  • Code of Conduct presence
  • For PyPI packages:
  • Downloads per month
  • Release frequency
  • Maintainer info
  • Known CVEs (via safety DB)
  • Dependencies count
  • For npm packages:
  • Weekly downloads
  • Dependencies count (fewer is better)
  • Link to source code
  • License
  • Known vulnerabilities (Snyk)

3. Calculate Risk Score

Use threshold-based scoring (inspired by Skantek):

``` Risk Score = 0

  • # Positive 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: <package/repo>

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:
  • โœ… Safe โ†’ Inform user, proceed automatically (unless user explicitly wants review)
  • โš ๏ธ Review โ†’ Show summary, ask confirmation
  • โŒ Dangerous โ†’ Strong warning, require explicit approval

Implementation Pattern

  1. ```python
  2. # Before: git clone https://github.com/user/repo
  3. # After:
  4. Detect: GitHub repo
  5. Fetch metrics via GitHub API
  6. Calculate risk score
  7. Show summary
  8. Ask confirmation if needed
  9. Proceed or abort
  10. ```

Integration Points

GitHub API ```bash curl -s "https://api.github.com/repos/{owner}/{repo}" ```

Returns: stars, forks, updated_at, open_issues_count, license

PyPI JSON API ```bash curl -s "https://pypi.org/pypi/{package}/json" ```

Returns: downloads, releases, maintainers

npm Registry ```bash curl -s "https://registry.npmjs.org/{package}" ```

Returns: downloads (via npm-stat), dependencies, license

Vulnerability Databases - **Snyk** (npm): https://security.snyk.io - **Safety DB** (Python): https://github.com/pyupio/safety-db - **GitHub Advisory**: https://github.com/advisories

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

  • Never bypass without user knowledge โ€” Always inform about security checks
  • Never auto-install flagged packages โ€” Require manual approval for high-risk
  • Log all decisions โ€” Track what was installed and why
  • Rate limit API calls โ€” GitHub/npm/PyPI have rate limits

Example Workflows

Example 1: Safe Package

``` User: pip install requests

Security 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/tool

Security 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-pad

Security Check: โš ๏ธ REVIEW: [email protected] - 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:
  • See `references/skantek-approach.md` โ€” Adyen's methodology
  • See `references/vulnerability-databases.md` โ€” How to query CVE databases

Use Cases

  • Scan code for security vulnerabilities including SQL injection, XSS, and hardcoded secrets
  • Review source code for insecure patterns and suggest remediation
  • Generate security audit reports organized by severity level for team review
  • Identify and prioritize security risks before production deployment

Pros & Cons

Pros

  • +Security verified with no dangerous patterns detected in content analysis
  • +Clean CLI interface integrates well with automation pipelines and AI agents
  • +Structured security analysis helps prioritize remediation efforts
  • +Systematic approach ensures consistent coverage of common vulnerability patterns

Cons

  • -Requires installing external dependencies before use
  • -Static analysis only โ€” does not replace runtime security testing or penetration testing
  • -May produce false positives that require manual verification

FAQ

What does Security Check do?
๐Ÿ”’ Pre-installation security verification for external code and dependencies. Automated risk analysis for GitHub repos, npm packages, PyPI libraries, and she...
What platforms support Security Check?
Security Check is available on Claude Code, OpenClaw.
What are the use cases for Security Check?
Scan code for security vulnerabilities including SQL injection, XSS, and hardcoded secrets. Review source code for insecure patterns and suggest remediation. Generate security audit reports organized by severity level for team review.

100+ free AI tools

Writing, PDF, image, and developer tools โ€” all in your browser.

Next Step

Use the skill detail page to evaluate fit and install steps. For a direct browser workflow, move into a focused tool route instead of staying in broader support surfaces.