@codacy/tools-opengrep-1 0.21.0 → 0.23.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 CHANGED
@@ -156,7 +156,7 @@ curl -fsSL https://raw.githubusercontent.com/opengrep/opengrep/main/install.sh |
156
156
  - **Config file search**: `.semgrep.yaml`, `.opengrep.yaml`, `.semgrep.yml`, `.opengrep.yml` (in that order).
157
157
  - **Opengrep errors**: Parse errors (syntax errors, partial parsing) from Opengrep's JSON `errors` array are converted to structured `AnalysisError` objects with `filePath`. Stderr (scan status table) is logged at debug level only.
158
158
  - **Rule ID format**: Semgrep-rules use `{dir}.{filename}.{ruleId}` (dots), GitLab rules use `{dir}_{filename}` (underscores), Codacy custom rules keep their original IDs.
159
- - **Install / binary download**: `install()` downloads the bare per-platform binary from `https://github.com/opengrep/opengrep/releases/download/v{version}/{asset}` and `chmod +x`es it into `~/.codacy/tools/`. The release tag carries a `v` prefix (`v1.16.4`) even though `preferredVersion` does not. On Linux the libc flavour is detected with an `ldd /bin/sh` probe (`musl` → musllinux, else manylinux); detection failures fall back to glibc/manylinux. Unlike install.sh, the Codacy-managed install does **not** verify the cosign `.cert`/`.sig` signatures — if signature verification becomes a requirement, fetch those sibling assets and validate before chmod.
159
+ - **Install / binary download**: `install()` downloads the bare per-platform binary from `https://github.com/opengrep/opengrep/releases/download/v{version}/{asset}` and `chmod +x`es it into `~/.codacy/tools/`. The release tag carries a `v` prefix (`v1.26.0`) even though `preferredVersion` does not. On Linux the libc flavour is detected with an `ldd /bin/sh` probe (`musl` → musllinux, else manylinux); detection failures fall back to glibc/manylinux. Unlike install.sh, the Codacy-managed install does **not** verify the cosign `.cert`/`.sig` signatures — if signature verification becomes a requirement, fetch those sibling assets and validate before chmod.
160
160
  - **Argv-size chunking (no directory walk)**: The adapter always passes Opengrep an **explicit file list** — the runner's already git-ignored, exclude-filtered target set — so Opengrep never walks the repository tree itself. `chunkFilesByArgvBudget()` splits that list into the **fewest, largest** chunks that each fit `ARGV_BYTE_BUDGET` (200 KB, well under `ARG_MAX`), and each chunk is scanned in its own `opengrep scan` invocation; findings and errors are merged across chunks. Chunk by **size, not count**: every invocation re-compiles `rules.yaml`, so fewer/larger chunks amortize that fixed cost. The earlier directory/“root” fallback was removed because on huge repos (a single tracked file at the repo root collapsed the minimal-cover dirs to `.`) it made Opengrep walk the entire tree — re-scanning excluded/generated/vendored files and timing out at the runner's 10-minute limit.
161
161
  - **File-size cap**: invocations pass `--max-target-bytes 1000000` (~1 MB). This restores Opengrep's default size cap — the adapter previously passed `0`, which **disables** the cap, so giant generated/minified bundles were scanned and dominated runtime. The cap applies to explicitly-listed files (verified on v1.16.4). Note: `--exclude-minified-files` is **not** used — that flag is rejected by the bundled binary unless `--experimental` (a different engine) is also passed, so we rely on the size cap instead. (The runner also enforces a tighter 150 KB per-file limit centrally before files reach the adapter, so this `--max-target-bytes` is now a secondary defense.)
162
162
  - **Partial results on timeout**: the per-chunk loop checks `ctx.signal` (the runner's timeout abort) between chunks and passes it to `spawnTool`, so an in-flight scan is killed promptly. On abort the adapter keeps the findings from completed chunks and adds a single `Timeout` error (→ `status: "partial"`) rather than losing everything. This is why chunking matters beyond ARG_MAX: it's the granularity at which a long scan can be stopped with results preserved.
package/dist/index.js CHANGED
@@ -1109,7 +1109,7 @@ var patterns_default = [
1109
1109
  category: "Security",
1110
1110
  severityLevel: "Error",
1111
1111
  title: "Avoid hard-coded passwords",
1112
- enabled: true,
1112
+ enabled: false,
1113
1113
  languages: ["Shell"],
1114
1114
  parameters: [],
1115
1115
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1156,7 +1156,7 @@ var patterns_default = [
1156
1156
  category: "BestPractice",
1157
1157
  severityLevel: "Warning",
1158
1158
  title: "Avoid hardcoded strftime format strings",
1159
- enabled: true,
1159
+ enabled: false,
1160
1160
  languages: ["CPP"],
1161
1161
  parameters: [],
1162
1162
  tags: [
@@ -1190,7 +1190,7 @@ var patterns_default = [
1190
1190
  category: "BestPractice",
1191
1191
  severityLevel: "Warning",
1192
1192
  title: "Avoid misleading exception class names",
1193
- enabled: true,
1193
+ enabled: false,
1194
1194
  languages: ["CSharp"],
1195
1195
  parameters: []
1196
1196
  },
@@ -1199,7 +1199,7 @@ var patterns_default = [
1199
1199
  category: "Security",
1200
1200
  severityLevel: "Error",
1201
1201
  title: "Avoid Hardcoded Passwords",
1202
- enabled: true,
1202
+ enabled: false,
1203
1203
  languages: ["CSharp"],
1204
1204
  parameters: [],
1205
1205
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1238,7 +1238,7 @@ var patterns_default = [
1238
1238
  category: "ErrorProne",
1239
1239
  severityLevel: "Warning",
1240
1240
  title: "Avoid Empty Strings",
1241
- enabled: true,
1241
+ enabled: false,
1242
1242
  languages: ["PLSQL"],
1243
1243
  parameters: []
1244
1244
  },
@@ -1247,7 +1247,7 @@ var patterns_default = [
1247
1247
  category: "Security",
1248
1248
  severityLevel: "Error",
1249
1249
  title: "Avoid Hardcoded Passwords",
1250
- enabled: true,
1250
+ enabled: false,
1251
1251
  languages: ["PLSQL"],
1252
1252
  parameters: [],
1253
1253
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1257,7 +1257,7 @@ var patterns_default = [
1257
1257
  category: "Security",
1258
1258
  severityLevel: "Error",
1259
1259
  title: "Avoid Resource Injection",
1260
- enabled: true,
1260
+ enabled: false,
1261
1261
  languages: ["PLSQL"],
1262
1262
  parameters: [],
1263
1263
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1267,7 +1267,7 @@ var patterns_default = [
1267
1267
  category: "Security",
1268
1268
  severityLevel: "High",
1269
1269
  title: "Detect Invisible Unicode Characters",
1270
- enabled: true,
1270
+ enabled: false,
1271
1271
  languages: ["YAML", "JSON"],
1272
1272
  parameters: [],
1273
1273
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1376,7 +1376,7 @@ var patterns_default = [
1376
1376
  category: "BestPractice",
1377
1377
  severityLevel: "Warning",
1378
1378
  title: "Avoid hardcoded date format",
1379
- enabled: true,
1379
+ enabled: false,
1380
1380
  languages: ["Java"],
1381
1381
  parameters: [],
1382
1382
  tags: [
@@ -1394,7 +1394,7 @@ var patterns_default = [
1394
1394
  category: "Compatibility",
1395
1395
  severityLevel: "Warning",
1396
1396
  title: "Avoid hardcoded decimal format patterns",
1397
- enabled: true,
1397
+ enabled: false,
1398
1398
  languages: ["Java"],
1399
1399
  parameters: [],
1400
1400
  tags: [
@@ -1538,7 +1538,7 @@ var patterns_default = [
1538
1538
  category: "Security",
1539
1539
  severityLevel: "High",
1540
1540
  title: "Avoid Hardcoded Passwords",
1541
- enabled: true,
1541
+ enabled: false,
1542
1542
  languages: ["Javascript", "TypeScript"],
1543
1543
  parameters: [],
1544
1544
  tags: ["security"]
@@ -1557,7 +1557,7 @@ var patterns_default = [
1557
1557
  category: "Security",
1558
1558
  severityLevel: "Error",
1559
1559
  title: "Avoid Hard-Coded Passwords",
1560
- enabled: true,
1560
+ enabled: false,
1561
1561
  languages: ["Java"],
1562
1562
  parameters: []
1563
1563
  },
@@ -1710,7 +1710,7 @@ var patterns_default = [
1710
1710
  category: "Compatibility",
1711
1711
  severityLevel: "High",
1712
1712
  title: "Avoid using IngressClass wired to Ingress NGINX controller",
1713
- enabled: true,
1713
+ enabled: false,
1714
1714
  languages: ["YAML"],
1715
1715
  parameters: [],
1716
1716
  tags: ["plt:kubernetes", "ai-safety", "ai-risk", "ai", "tool:helm"]
@@ -1720,7 +1720,7 @@ var patterns_default = [
1720
1720
  category: "Compatibility",
1721
1721
  severityLevel: "Warning",
1722
1722
  title: "Avoid use of Ingress NGINX (ingress class nginx)",
1723
- enabled: true,
1723
+ enabled: false,
1724
1724
  languages: ["YAML"],
1725
1725
  parameters: [],
1726
1726
  tags: ["plt:kubernetes", "ai-safety", "ai-risk", "ai", "tool:helm"]
@@ -1730,7 +1730,7 @@ var patterns_default = [
1730
1730
  category: "BestPractice",
1731
1731
  severityLevel: "Warning",
1732
1732
  title: "Flag usage of ingress-nginx workload labels",
1733
- enabled: true,
1733
+ enabled: false,
1734
1734
  languages: ["YAML"],
1735
1735
  parameters: [],
1736
1736
  tags: ["plt:kubernetes", "ai-safety", "ai-risk", "ai", "tool:helm"]
@@ -1776,7 +1776,7 @@ var patterns_default = [
1776
1776
  category: "BestPractice",
1777
1777
  severityLevel: "Warning",
1778
1778
  title: "Avoid hardcoded strftime format strings",
1779
- enabled: true,
1779
+ enabled: false,
1780
1780
  languages: ["Python"],
1781
1781
  parameters: [],
1782
1782
  tags: [
@@ -1794,7 +1794,7 @@ var patterns_default = [
1794
1794
  category: "Security",
1795
1795
  severityLevel: "High",
1796
1796
  title: "Require OpenAI SDK usage with Guardrails",
1797
- enabled: true,
1797
+ enabled: false,
1798
1798
  languages: ["Python"],
1799
1799
  parameters: [],
1800
1800
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1804,7 +1804,7 @@ var patterns_default = [
1804
1804
  category: "Security",
1805
1805
  severityLevel: "High",
1806
1806
  title: "Avoid OpenAI client usage without Guardrails",
1807
- enabled: true,
1807
+ enabled: false,
1808
1808
  languages: ["Python"],
1809
1809
  parameters: [],
1810
1810
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -1814,7 +1814,7 @@ var patterns_default = [
1814
1814
  category: "Security",
1815
1815
  severityLevel: "High",
1816
1816
  title: "Avoid direct OpenAI SDK calls (use Guardrails client)",
1817
- enabled: true,
1817
+ enabled: false,
1818
1818
  languages: ["Python"],
1819
1819
  parameters: [],
1820
1820
  tags: ["ai", "ai-risk", "ai-safety"]
@@ -30723,7 +30723,7 @@ var pattern_mappings_default = {
30723
30723
  var descriptor = {
30724
30724
  id: "Semgrep",
30725
30725
  displayName: "Opengrep",
30726
- preferredVersion: "1.16.4",
30726
+ preferredVersion: "1.26.0",
30727
30727
  languages: [
30728
30728
  "Apex",
30729
30729
  "Bash",
package/dist/metadata.js CHANGED
@@ -256,7 +256,7 @@ var pattern_mappings_default = {
256
256
  var descriptor = {
257
257
  id: "Semgrep",
258
258
  displayName: "Opengrep",
259
- preferredVersion: "1.16.4",
259
+ preferredVersion: "1.26.0",
260
260
  languages: [
261
261
  "Apex",
262
262
  "Bash",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-opengrep-1",
3
- "version": "0.21.0",
3
+ "version": "0.23.0",
4
4
  "description": "Opengrep adapter — CLI-mode multi-language SAST scanner",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "yaml": "^2.6.0",
13
- "@codacy/tooling": "0.21.0"
13
+ "@codacy/tooling": "0.23.0"
14
14
  },
15
15
  "license": "MIT",
16
16
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",