@codacy/tools-checkov-3 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Codacy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # @codacy/tools-checkov-3
2
+
3
+ ## Table of Contents
4
+ - [Overview](#overview)
5
+ - [Updating patterns](#updating-patterns)
6
+ - [Updating the Checkov version](#updating-the-checkov-version)
7
+ - [Development](#development)
8
+ - [Notes for maintainers](#notes-for-maintainers)
9
+
10
+ ---
11
+
12
+ ## Overview
13
+
14
+ Infrastructure-as-Code security scanner using the [Checkov](https://www.checkov.io/) binary. Scans Terraform, CloudFormation, Kubernetes, Dockerfile, and many other IaC frameworks for security misconfigurations. Uses the CLI execution strategy with Python/pip installation into an isolated virtual environment.
15
+
16
+ | Property | Value |
17
+ |----------|-------|
18
+ | Tool ID | `Checkov` |
19
+ | Codacy UUID | `13af9d89-1ce5-4fec-a168-765c3e7b26b3` |
20
+ | Strategy | CLI |
21
+ | Languages | JSON, YAML, Terraform |
22
+ | Binary | `checkov` (Python package) |
23
+ | File patterns | `**/*.tf`, `**/*.yaml`, `**/*.yml`, `**/*.json`, `**/Dockerfile` |
24
+ | Pattern count | ~1,358 |
25
+ | Pattern ID format | `Checkov_{check_id}` (e.g. `Checkov_CKV_AWS_41`) |
26
+
27
+ ## Updating patterns
28
+
29
+ ```bash
30
+ # Re-fetch pattern metadata from the Codacy API
31
+ pnpm prefetch
32
+
33
+ # Commit the result
34
+ git add src/patterns.json
35
+ ```
36
+
37
+ ## Updating the Checkov version
38
+
39
+ 1. Update `preferredVersion` in `src/adapter.ts`
40
+ 2. Update the `PIP_PACKAGE` constant in `src/adapter.ts` (e.g. `checkov==3.2.510`)
41
+ 3. Run `pnpm prefetch` to refresh patterns (new versions may add checks)
42
+ 4. Run `pnpm test` to verify compatibility
43
+ 5. Consider creating a new package (`checkov-4/`) if the major version changes
44
+
45
+ ## Development
46
+
47
+ ```bash
48
+ # Install checkov locally (requires Python 3.9+)
49
+ pip install checkov==3.2.508
50
+
51
+ # Build with tsup
52
+ pnpm build
53
+
54
+ # Run tests (skips binary-dependent tests if checkov is not installed)
55
+ pnpm test
56
+ ```
57
+
58
+ ## Notes for maintainers
59
+
60
+ - **Large pip install**: Checkov has ~200 transitive dependencies (pydantic, boto3 stubs, networkx, etc.). First install into the venv can take several minutes. Subsequent runs use the cached venv.
61
+ - **Per-tool venv isolation**: The adapter installs Checkov into `~/.codacy/runtimes/Checkov/venv/` to avoid dependency conflicts with other Python-based tools.
62
+ - **Multi-framework JSON output**: Checkov can emit a single JSON object or an array of objects (one per framework). The adapter normalizes both to an array before parsing.
63
+ - **Path normalization**: `repo_file_path` from Checkov always has a leading `/` which must be stripped.
64
+ - **No column information**: Checkov does not provide column numbers. All issues use `column: 1`.
65
+ - **Exit codes**: Exit code 0 = no issues, 1 = issues found (normal), >1 = genuine error.
66
+ - **Container mode network blocking**: In container mode (`ctx.runner === "container"`), the adapter sets proxy env vars and `RENDER_EDGES_DUPLICATE_ITER_COUNT=50` to block Bridgecrew API calls and tune performance.
67
+ - **Pattern filtering**: Uses `--check CKV_xxx,CKV_yyy,...` to run only specific checks. The `Checkov_` prefix is stripped from pattern IDs to get the raw check ID.
68
+ - **Config files**: Looks for `.checkov.yaml` or `.checkov.yml`. When local config is active, passes `--config-file <path>`.
69
+ - **Parsing errors**: Checkov reports `parsing_errors` in its JSON output, which are surfaced as `AnalysisError` objects with `kind: "ParsingError"`.
@@ -0,0 +1,5 @@
1
+ import * as _codacy_tooling from '@codacy/tooling';
2
+
3
+ declare const _default: Readonly<_codacy_tooling.ToolAdapter>;
4
+
5
+ export { _default as default };