@codacy/tools-checkov-3 0.18.0 → 0.20.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/README.md +14 -7
- package/dist/index.js +53 -10
- package/dist/metadata.js +52 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Infrastructure-as-Code security scanner using the [Checkov](https://www.checkov.
|
|
|
19
19
|
| Tool ID | `Checkov` |
|
|
20
20
|
| Codacy UUID | `13af9d89-1ce5-4fec-a168-765c3e7b26b3` |
|
|
21
21
|
| Strategy | CLI |
|
|
22
|
-
| Languages | JSON, YAML, Terraform
|
|
22
|
+
| Languages | JSON, YAML, Terraform, Dockerfile |
|
|
23
23
|
| Binary | `checkov` (Python package) |
|
|
24
24
|
| File patterns | `**/*.tf`, `**/*.yaml`, `**/*.yml`, `**/*.json`, `**/Dockerfile` |
|
|
25
25
|
| Pattern count | ~1,358 |
|
|
@@ -68,9 +68,16 @@ pnpm test
|
|
|
68
68
|
- **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.
|
|
69
69
|
- **Config files**: Looks for `.checkov.yaml` or `.checkov.yml`. When local config is active, passes `--config-file <path>`.
|
|
70
70
|
- **Parsing errors**: Checkov reports `parsing_errors` in its JSON output, which are surfaced as `AnalysisError` objects with `kind: "ParsingError"`.
|
|
71
|
-
- **Preset mappings (`src/pattern-mappings.json`)**: gates
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- `
|
|
75
|
-
- `
|
|
76
|
-
- `
|
|
71
|
+
- **Preset mappings (`src/pattern-mappings.json`)**: gates 1,278 of the 1,358 patterns on a detected IaC framework, so `init --auto` doesn't enable AWS resource policy in a repo with no infrastructure. Measured effect: a repo with only a `package.json` went from 1,225 enabled Checkov patterns to 80.
|
|
72
|
+
|
|
73
|
+
The gate is **per IaC framework, not per cloud**, because a cloud resource can be declared several ways — the same bucket is an `aws_s3_bucket` in Terraform, an `AWS::S3::Bucket` in CloudFormation and a `resources:` block under Serverless. `filterAutoPatterns` enables a framework pattern when **any** of its keys was detected, so the same prefix is listed under several keys to mean "AWS resources, however they are declared". That OR is what makes gating safe here; an earlier revision left all ~1,091 cloud-provider checks universal precisely because gating them on `.tf` alone would have dropped every cloud check for a CloudFormation-only repo.
|
|
74
|
+
- `"lang:Terraform"` maps `CKV_TF_` plus every cloud-provider family (`CKV_AWS_`, `CKV_AZURE_`, `CKV_GCP_`, and the 10 smaller clouds). No file signal is needed: `.tf` **is** the `Terraform` language, so `lang:Terraform` already means "this repo has Terraform".
|
|
75
|
+
- `cloudformation` and `serverless-framework` also claim `CKV_AWS_`/`CKV2_AWS_`; `bicep` also claims `CKV_AZURE_`/`CKV2_AZURE_`. Detected by file signal (`samconfig.*`, a root `template.yaml`, a `cloudformation/` directory, `serverless.yml`, `*.bicep`).
|
|
76
|
+
- `kubernetes` and `helm` both claim `CKV_K8S_`/`CKV2_K8S_`/`CKV_ARGO_` — a chart's templates render to manifests, so either is evidence. Detected from `kustomization.yaml` / `Chart.yaml`.
|
|
77
|
+
- `ansible` claims `CKV_ANSIBLE_`/`CKV2_ANSIBLE_`, from `ansible.cfg` or the `roles/<name>/tasks/main.yml` layout.
|
|
78
|
+
- **Still universal (80 patterns), each for a stated reason:**
|
|
79
|
+
- `CKV_SECRET_` (18) and `CKV_BCW_` (1) by design — secret scanning must not be suppressed by any framework gate.
|
|
80
|
+
- `CKV_OPENAPI_` (21) — an OpenAPI/AsyncAPI document identifies itself by its `openapi:`/`swagger:` key, which a path-only signal cannot see. Needs the content probe.
|
|
81
|
+
- The VCS governance families `CKV_GITHUB_` (26), `CKV_GIT_` (7), `CKV_GLB_` (4), `CKV_GITLAB_`, `CKV_BITBUCKET_`, `CKV2_ADO_` (1 each). These are **unresolved, not deferred**: their titles read as platform/API settings (Checkov's `github_configuration` framework, which reads API data and cannot fire on a filesystem scan), while an earlier reading of this file recorded them as governance resources managed through each platform's _Terraform provider_ — in which case they belong under `lang:Terraform`. The two readings imply opposite fixes (prune vs. gate), so they are left untouched until checked against Checkov's own framework declarations.
|
|
82
|
+
- **Known gap:** a bare Kubernetes manifest (`k8s/deployment.yaml`) or a bare CloudFormation template is still not detected — only the conventional shells around them are. Both declare themselves in their content, so closing this needs a bounded content probe (`apiVersion:`, `AWSTemplateFormatVersion`), which is not implemented.
|
|
83
|
+
- **Known gap (upstream):** most patterns carry `languages: ["JSON", "YAML", "Terraform"]`, which is the _tool-level fallback_ Codacy's API returns for a pattern with no per-pattern languages — not a claim about the check. It over-declares (JSON is why Checkov is selected almost everywhere) and under-declares (only 6 of 28 `CKV_DOCKER_` checks list `Dockerfile`, so 22 are dropped by the language filter in a Dockerfile-only repo). The durable fix is in the cloud tool definition; see `todo-checkov-languages.md`.
|
package/dist/index.js
CHANGED
|
@@ -12367,25 +12367,62 @@ var patterns_default = [
|
|
|
12367
12367
|
|
|
12368
12368
|
// src/pattern-mappings.json
|
|
12369
12369
|
var pattern_mappings_default = {
|
|
12370
|
-
Dockerfile: {
|
|
12370
|
+
"lang:Dockerfile": {
|
|
12371
12371
|
prefixes: ["Checkov_CKV_DOCKER_", "Checkov_CKV2_DOCKER_"]
|
|
12372
12372
|
},
|
|
12373
|
-
Terraform: {
|
|
12374
|
-
prefixes: [
|
|
12375
|
-
|
|
12376
|
-
|
|
12373
|
+
"lang:Terraform": {
|
|
12374
|
+
prefixes: [
|
|
12375
|
+
"Checkov_CKV_TF_",
|
|
12376
|
+
"Checkov_CKV_AWS_",
|
|
12377
|
+
"Checkov_CKV2_AWS_",
|
|
12378
|
+
"Checkov_CKV_AZURE_",
|
|
12379
|
+
"Checkov_CKV2_AZURE_",
|
|
12380
|
+
"Checkov_CKV_GCP_",
|
|
12381
|
+
"Checkov_CKV2_GCP_",
|
|
12382
|
+
"Checkov_CKV_ALI_",
|
|
12383
|
+
"Checkov_CKV_OCI_",
|
|
12384
|
+
"Checkov_CKV2_OCI_",
|
|
12385
|
+
"Checkov_CKV2_IBM_",
|
|
12386
|
+
"Checkov_CKV_NCP_",
|
|
12387
|
+
"Checkov_CKV_YC_",
|
|
12388
|
+
"Checkov_CKV_TC_",
|
|
12389
|
+
"Checkov_CKV_PAN_",
|
|
12390
|
+
"Checkov_CKV_LIN_",
|
|
12391
|
+
"Checkov_CKV_DIO_",
|
|
12392
|
+
"Checkov_CKV_OPENSTACK_"
|
|
12393
|
+
]
|
|
12394
|
+
},
|
|
12395
|
+
cloudformation: {
|
|
12396
|
+
prefixes: ["Checkov_CKV_AWS_", "Checkov_CKV2_AWS_"]
|
|
12397
|
+
},
|
|
12398
|
+
"serverless-framework": {
|
|
12399
|
+
prefixes: ["Checkov_CKV_AWS_", "Checkov_CKV2_AWS_"]
|
|
12400
|
+
},
|
|
12401
|
+
bicep: {
|
|
12402
|
+
prefixes: ["Checkov_CKV_AZURE_", "Checkov_CKV2_AZURE_"]
|
|
12403
|
+
},
|
|
12404
|
+
kubernetes: {
|
|
12405
|
+
prefixes: ["Checkov_CKV_K8S_", "Checkov_CKV2_K8S_", "Checkov_CKV_ARGO_"]
|
|
12406
|
+
},
|
|
12407
|
+
helm: {
|
|
12408
|
+
prefixes: ["Checkov_CKV_K8S_", "Checkov_CKV2_K8S_", "Checkov_CKV_ARGO_"]
|
|
12409
|
+
},
|
|
12410
|
+
ansible: {
|
|
12411
|
+
prefixes: ["Checkov_CKV_ANSIBLE_", "Checkov_CKV2_ANSIBLE_"]
|
|
12412
|
+
},
|
|
12413
|
+
"github-actions": {
|
|
12377
12414
|
prefixes: ["Checkov_CKV_GHA_", "Checkov_CKV2_GHA_"]
|
|
12378
12415
|
},
|
|
12379
|
-
|
|
12416
|
+
circleci: {
|
|
12380
12417
|
prefixes: ["Checkov_CKV_CIRCLECIPIPELINES_"]
|
|
12381
12418
|
},
|
|
12382
|
-
"
|
|
12419
|
+
"gitlab-ci": {
|
|
12383
12420
|
prefixes: ["Checkov_CKV_GITLABCI_"]
|
|
12384
12421
|
},
|
|
12385
|
-
"
|
|
12422
|
+
"bitbucket-pipelines": {
|
|
12386
12423
|
prefixes: ["Checkov_CKV_BITBUCKETPIPELINES_"]
|
|
12387
12424
|
},
|
|
12388
|
-
"
|
|
12425
|
+
"azure-pipelines": {
|
|
12389
12426
|
prefixes: ["Checkov_CKV_AZUREPIPELINES_"]
|
|
12390
12427
|
}
|
|
12391
12428
|
};
|
|
@@ -12395,7 +12432,13 @@ var descriptor = {
|
|
|
12395
12432
|
id: "Checkov",
|
|
12396
12433
|
displayName: "Checkov",
|
|
12397
12434
|
preferredVersion: "3.2.508",
|
|
12398
|
-
|
|
12435
|
+
// `Dockerfile` is not in the tool-level language list Codacy's API reports, but
|
|
12436
|
+
// Checkov ships 28 `CKV_DOCKER_` checks and `filePatterns` already routes
|
|
12437
|
+
// Dockerfiles here. Without it, a Dockerfile-only repo detects only the
|
|
12438
|
+
// `Dockerfile` language, the language gate finds no overlap, and Checkov is not
|
|
12439
|
+
// selected at all — so the entire Docker ruleset is dropped from exactly the
|
|
12440
|
+
// repo it was written for.
|
|
12441
|
+
languages: ["JSON", "YAML", "Terraform", "Dockerfile"],
|
|
12399
12442
|
filePatterns: ["**/*.tf", "**/*.yaml", "**/*.yml", "**/*.json", "**/Dockerfile"],
|
|
12400
12443
|
supportedOS: ["linux", "darwin", "win32"],
|
|
12401
12444
|
supportedArch: ["x64", "arm64"],
|
package/dist/metadata.js
CHANGED
|
@@ -26,25 +26,62 @@ module.exports = __toCommonJS(metadata_exports);
|
|
|
26
26
|
|
|
27
27
|
// src/pattern-mappings.json
|
|
28
28
|
var pattern_mappings_default = {
|
|
29
|
-
Dockerfile: {
|
|
29
|
+
"lang:Dockerfile": {
|
|
30
30
|
prefixes: ["Checkov_CKV_DOCKER_", "Checkov_CKV2_DOCKER_"]
|
|
31
31
|
},
|
|
32
|
-
Terraform: {
|
|
33
|
-
prefixes: [
|
|
32
|
+
"lang:Terraform": {
|
|
33
|
+
prefixes: [
|
|
34
|
+
"Checkov_CKV_TF_",
|
|
35
|
+
"Checkov_CKV_AWS_",
|
|
36
|
+
"Checkov_CKV2_AWS_",
|
|
37
|
+
"Checkov_CKV_AZURE_",
|
|
38
|
+
"Checkov_CKV2_AZURE_",
|
|
39
|
+
"Checkov_CKV_GCP_",
|
|
40
|
+
"Checkov_CKV2_GCP_",
|
|
41
|
+
"Checkov_CKV_ALI_",
|
|
42
|
+
"Checkov_CKV_OCI_",
|
|
43
|
+
"Checkov_CKV2_OCI_",
|
|
44
|
+
"Checkov_CKV2_IBM_",
|
|
45
|
+
"Checkov_CKV_NCP_",
|
|
46
|
+
"Checkov_CKV_YC_",
|
|
47
|
+
"Checkov_CKV_TC_",
|
|
48
|
+
"Checkov_CKV_PAN_",
|
|
49
|
+
"Checkov_CKV_LIN_",
|
|
50
|
+
"Checkov_CKV_DIO_",
|
|
51
|
+
"Checkov_CKV_OPENSTACK_"
|
|
52
|
+
]
|
|
34
53
|
},
|
|
35
|
-
|
|
54
|
+
cloudformation: {
|
|
55
|
+
prefixes: ["Checkov_CKV_AWS_", "Checkov_CKV2_AWS_"]
|
|
56
|
+
},
|
|
57
|
+
"serverless-framework": {
|
|
58
|
+
prefixes: ["Checkov_CKV_AWS_", "Checkov_CKV2_AWS_"]
|
|
59
|
+
},
|
|
60
|
+
bicep: {
|
|
61
|
+
prefixes: ["Checkov_CKV_AZURE_", "Checkov_CKV2_AZURE_"]
|
|
62
|
+
},
|
|
63
|
+
kubernetes: {
|
|
64
|
+
prefixes: ["Checkov_CKV_K8S_", "Checkov_CKV2_K8S_", "Checkov_CKV_ARGO_"]
|
|
65
|
+
},
|
|
66
|
+
helm: {
|
|
67
|
+
prefixes: ["Checkov_CKV_K8S_", "Checkov_CKV2_K8S_", "Checkov_CKV_ARGO_"]
|
|
68
|
+
},
|
|
69
|
+
ansible: {
|
|
70
|
+
prefixes: ["Checkov_CKV_ANSIBLE_", "Checkov_CKV2_ANSIBLE_"]
|
|
71
|
+
},
|
|
72
|
+
"github-actions": {
|
|
36
73
|
prefixes: ["Checkov_CKV_GHA_", "Checkov_CKV2_GHA_"]
|
|
37
74
|
},
|
|
38
|
-
|
|
75
|
+
circleci: {
|
|
39
76
|
prefixes: ["Checkov_CKV_CIRCLECIPIPELINES_"]
|
|
40
77
|
},
|
|
41
|
-
"
|
|
78
|
+
"gitlab-ci": {
|
|
42
79
|
prefixes: ["Checkov_CKV_GITLABCI_"]
|
|
43
80
|
},
|
|
44
|
-
"
|
|
81
|
+
"bitbucket-pipelines": {
|
|
45
82
|
prefixes: ["Checkov_CKV_BITBUCKETPIPELINES_"]
|
|
46
83
|
},
|
|
47
|
-
"
|
|
84
|
+
"azure-pipelines": {
|
|
48
85
|
prefixes: ["Checkov_CKV_AZUREPIPELINES_"]
|
|
49
86
|
}
|
|
50
87
|
};
|
|
@@ -54,7 +91,13 @@ var descriptor = {
|
|
|
54
91
|
id: "Checkov",
|
|
55
92
|
displayName: "Checkov",
|
|
56
93
|
preferredVersion: "3.2.508",
|
|
57
|
-
|
|
94
|
+
// `Dockerfile` is not in the tool-level language list Codacy's API reports, but
|
|
95
|
+
// Checkov ships 28 `CKV_DOCKER_` checks and `filePatterns` already routes
|
|
96
|
+
// Dockerfiles here. Without it, a Dockerfile-only repo detects only the
|
|
97
|
+
// `Dockerfile` language, the language gate finds no overlap, and Checkov is not
|
|
98
|
+
// selected at all — so the entire Docker ruleset is dropped from exactly the
|
|
99
|
+
// repo it was written for.
|
|
100
|
+
languages: ["JSON", "YAML", "Terraform", "Dockerfile"],
|
|
58
101
|
filePatterns: ["**/*.tf", "**/*.yaml", "**/*.yml", "**/*.json", "**/Dockerfile"],
|
|
59
102
|
supportedOS: ["linux", "darwin", "win32"],
|
|
60
103
|
supportedArch: ["x64", "arm64"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/tools-checkov-3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Checkov adapter — CLI-mode IaC security scanner",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@codacy/tooling": "0.
|
|
11
|
+
"@codacy/tooling": "0.20.0"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"author": "Codacy <support@codacy.com> (https://www.codacy.com)",
|