You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 810b403
Browse filesBrowse the repository at this point in the historyBrowse files
|`ghsa`|`GHSA-xxxx-xxxx-xxxx` for GHSA-backed rules |
33
+
|`advisory-id`| non-GHSA source identifier, or the GHSA ID normalized by the compiler |
34
+
|`advisory-url`| durable URL to the advisory, report, review record, or source context |
35
+
|`detector-bucket`|`precise`|
36
+
|`source-rule-id`| the original source rule id |
37
+
|`source-file`| optional source YAML file used during compilation |
37
38
38
39
## Recompiling
39
40
@@ -47,13 +48,14 @@ The script:
47
48
48
49
1. Recursively walks every `.yml` / `.yaml` file under `--rules-dir`
49
50
2. Reads top-level `rules` arrays from those source files
50
-
3. Requires each source rule to provide `metadata.ghsa`
51
-
4. Rewrites ids and injects metadata as above
52
-
5. Appends only new precise rule ids to the existing `precise.yml` by default; pass `--replace-precise` to rebuild it from just the supplied source folder
53
-
6. Runs `opengrep scan --no-strict` against an empty target to identify schema-invalid or parser-invalid rules and drops mapped bad rules so the published super-config loads cleanly
54
-
7. Writes `precise.yml` and `<rules-dir>/compile-manifest.json`
55
-
56
-
Anything skipped (YAML parse error, duplicate compiled rule id, or schema/parser-invalid) is recorded under `preciseInvalid` / `preciseDuplicateSkipped` in the source-folder `compile-manifest.json` for follow-up.
51
+
3. Requires each source rule to provide `metadata.ghsa` or `metadata.advisory-id`
52
+
4. Requires `metadata.advisory-url` for non-GHSA source identifiers
53
+
5. Rewrites ids and injects metadata as above
54
+
6. Appends only new precise rule ids to the existing `precise.yml` by default; pass `--replace-precise` to rebuild it from just the supplied source folder
55
+
7. Runs `opengrep scan --no-strict` against an empty target to identify schema-invalid or parser-invalid rules and drops mapped bad rules so the published super-config loads cleanly
56
+
8. Writes `precise.yml`
57
+
58
+
Skipped, duplicate, or invalid rules are summarized on stdout/stderr for follow-up.
"ghsa-1234-abcd-5678.source-rule: metadata.ghsa (GHSA-9999-ABCD-5678) must match GHSA component in id (ghsa-1234-abcd-5678)",
66
+
"ghsa-1234-abcd-5678.source-rule: source id in metadata (GHSA-9999-ABCD-5678) must match source id in rule id (ghsa-1234-abcd-5678)",
51
67
"ghsa-1234-abcd-5678.source-rule: metadata.advisory-url must be https://github.com/openclaw/openclaw/security/advisories/GHSA-9999-ABCD-5678",
0 commit comments