Snyk

From G1Joshi/Agent-Skills · View interactive version

Snyk is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert Snyk security platform assistance covering SCA (open-source dependencies), SAST (code), container images, and IaC. Use when scanning repositories for CVEs, remediating vulnerabilities, or securing CI/CD.

How to use this skill

Skill file

Snyk

Snyk is a developer security platform. It finds and fixes vulnerabilities in your code (SAST), open source dependencies (SCA), container images, and infrastructure as code (IaC).

When to Use

Quick Start

# Install CLI
npm install -g snyk

# Authenticate
snyk auth

# Test dependencies
snyk test

# Monitor (Continuous watching for new vulns)
snyk monitor

Core Concepts

Snyk CLI Dependency Auditing

Scans project manifest files against Snyk's proprietary vulnerability intelligence database:

# Scan npm / pip / Cargo dependencies for vulnerabilities
snyk test --severity-threshold=high

# Generate automated fix advice and upgrade dependencies
snyk fix

Container Image Vulnerability Analysis

Analyzes base images and package managers, suggesting secure base image alternatives:

# Scan local Docker image
snyk container test my-org/api:latest --file=Dockerfile

GitHub Actions CI/CD Integration

Blocks pull requests containing critical vulnerabilities:

# .github/workflows/security.yml
- name: Run Snyk Security Scan
  uses: snyk/actions/node@master
  env:
    SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
  with:
    args: --severity-threshold=high --sarif-file-output=snyk.sarif

Common Patterns

Automated Snyk Container and Dependency Scan in CI

Problem: Deploying container images with critical OS or library vulnerabilities into Kubernetes clusters.

Solution:

Integrate Snyk testing into CI build steps with severity thresholds:

# Test Node dependencies and fail only on high/critical issues
snyk test --severity-threshold=high

# Test built Docker container image before pushing to registry
snyk container test myapp:latest --severity-threshold=critical --fail-on=upgradable

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :---------------- | :--------------------- | :------------------------------------------------------------------ |

| Auth Failed | Token expired/missing. | Run snyk auth again or set SNYK_TOKEN env var. |

| Too many issues | Legacy codebase. | Use .snyk file to ignore known/wont-fix issues or set a baseline. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.