|
1 |
| -# Package Security |
| 1 | +# Package security |
2 | 2 |
|
3 |
| -CodeGate's package security system helps protect your codebase from malicious or vulnerable dependencies. |
| 3 | +## What's the risk? |
4 | 4 |
|
5 |
| -## Features |
| 5 | +The large language models (LLMs) that drive AI coding assistants are trained at |
| 6 | +a point in time – often months before you use them. But the open source software |
| 7 | +ecosystem moves quickly, and so do malicious actors seeking to exploit the |
| 8 | +software supply chain. LLMs often suggest outdated, vulnerable, or nonexistent |
| 9 | +packages, exposing you and your users to security and privacy risks. |
6 | 10 |
|
7 |
| -- Automatic package scanning |
8 |
| -- Vulnerability detection |
9 |
| -- License compliance checking |
10 |
| -- Supply chain attack prevention |
11 |
| -- Version pinning recommendations |
| 11 | +## How CodeGate helps |
12 | 12 |
|
13 |
| -## How It Works |
| 13 | +CodeGate's package security system helps protect your codebase from malicious or |
| 14 | +vulnerable dependencies. It identifies potentially risky packages and suggests |
| 15 | +fixed versions or alternative packages to consider. |
14 | 16 |
|
15 |
| -The package security system scans: |
| 17 | +These insights are powered by [Trusty](https://www.trustypkg.dev), the open |
| 18 | +source dependency intelligence service from Stacklok. |
16 | 19 |
|
17 |
| -- Direct dependencies |
18 |
| -- Transitive dependencies |
19 |
| -- Development dependencies |
20 |
| -- Package lockfiles |
21 |
| -- Installation scripts |
| 20 | +## How it works |
22 | 21 |
|
23 |
| -## Configuration |
| 22 | +CodeGate scans direct, transitive, and development dependencies from package |
| 23 | +definition files and installation scripts in your project. |
24 | 24 |
|
25 |
| -Enable and configure package security in your `codegate.yaml`: |
| 25 | +To invoke this scan, include your dependencies file (`package-lock.json`, |
| 26 | +`requirements.txt`, `go.mod`, etc.) as context, or mention a package in your |
| 27 | +prompt, and request a dependency security scan using a prompt similar to this: |
26 | 28 |
|
27 |
| -```yaml |
28 |
| -security: |
29 |
| - package_scanning: |
30 |
| - enabled: true |
31 |
| - scan_depth: full # or 'direct' for only direct dependencies |
32 |
| - block_high_severity: true |
33 |
| - licenses: |
34 |
| - allowed: ["MIT", "Apache-2.0", "BSD-3-Clause"] |
35 |
| - blocked: ["GPL-3.0"] |
| 29 | +```plain |
| 30 | +codegate, please scan my dependencies for security risks |
36 | 31 | ```
|
37 | 32 |
|
38 |
| -## Vulnerability Detection |
39 |
| -
|
40 |
| -CodeGate checks for: |
41 |
| -
|
42 |
| -- Known vulnerabilities (CVEs) |
43 |
| -- Malicious code patterns |
44 |
| -- Suspicious installation scripts |
45 |
| -- Outdated dependencies |
46 |
| -- Supply chain risks |
47 |
| -
|
48 |
| -## Best Practices |
49 |
| -
|
50 |
| -1. Enable automatic scanning |
51 |
| -2. Configure severity thresholds |
52 |
| -3. Maintain an allowed license list |
53 |
| -4. Regular dependency updates |
54 |
| -5. Monitor security advisories |
55 |
| -
|
56 |
| -## Example Usage |
57 |
| -
|
58 |
| -### Package Installation |
59 |
| -
|
60 |
| -```bash |
61 |
| -# CodeGate will scan before installation |
62 |
| -npm install express |
63 |
| - |
64 |
| -# Override for testing |
65 |
| -npm install express --no-codegate |
66 |
| -``` |
67 |
| - |
68 |
| -### CI/CD Integration |
69 |
| - |
70 |
| -```yaml |
71 |
| -# GitHub Actions example |
72 |
| -steps: |
73 |
| - - uses: actions/checkout@v2 |
74 |
| - - name: Setup CodeGate |
75 |
| - uses: codegate/setup-action@v1 |
76 |
| - - name: Install dependencies |
77 |
| - run: npm install |
78 |
| -``` |
79 |
| -
|
80 |
| -## Security Recommendations |
81 |
| -
|
82 |
| -1. Use lockfiles |
83 |
| -2. Pin dependency versions |
84 |
| -3. Regular security audits |
85 |
| -4. Monitor dependency updates |
86 |
| -5. Review installation scripts |
87 |
| -
|
88 |
| -## Related Topics |
89 |
| -
|
90 |
| -- [Secret Filtering](/docs/features/secret-filtering) |
91 |
| -- [Basic Configuration](/docs/configuration/basic) |
92 |
| -- [Advanced Options](/docs/configuration/advanced) |
| 33 | +CodeGate responds with analysis, insights, and recommendations about your |
| 34 | +package dependencies. |
0 commit comments