mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 18:28:19 +00:00
feat(pre-push-safety-net): exclude the memory family explicitly and document the scope line
- advisory-scope.json names the taxonomy family memory as excluded, with the registry-grounded reason and what a run does not tell - docs/scanning.md shows the Scope line exactly as the hook prints it - the loaded-scope guard moves into a helper, so __post_init__ keeps its complexity of 14
This commit is contained in:
@@ -204,9 +204,14 @@ Skipped: the changed code has no counterpart in the base revision to compare aga
|
||||
Skipped: engine did not run: the code graph could not be built (is Joern installed? ...)
|
||||
Skipped: no base revision was analysed, so no engine finding can be called new or worsened
|
||||
Notice: Engine checks did not run. Install Joern, or run the hook through ops/ousast-docker. Review the details.
|
||||
Scope: provisional, not yet in effect: no family is qualified for alerts yet. Intended v1 advisory scope: injection, untrusted destination, configuration. Not reported as defects: access control, output encoding, path, prototype, deserialization, memory, or any other family outside the scope. Listing a family does not mean the repository was found free of defects in it.
|
||||
Details: /home/you/.cache/openultrasast/push/push-12345.json
|
||||
```
|
||||
|
||||
The `Scope:` line states which families this tool does not turn into defect alerts while the
|
||||
scope is provisional, and that listing a family is not a claim that the repository is free of
|
||||
defects in it.
|
||||
|
||||
The hook reads these settings from the environment of `git push`:
|
||||
|
||||
| Variable | Default | Effect |
|
||||
|
||||
@@ -49,6 +49,12 @@
|
||||
"label": "deserialization",
|
||||
"reason": "Has not earned a place through evaluation.",
|
||||
"not_told": "No defect is reported for deserialization, so a contributor is not told that a change deserializes untrusted data into objects the process then trusts, even when it does."
|
||||
},
|
||||
{
|
||||
"family": "memory",
|
||||
"label": "memory",
|
||||
"reason": "No memory-safety capability has been evaluated: the only related declaration in the shipped capability registry (eligibility.json) is c/libpng/memory_safety, it is disabled with verdict NO-GO, and its family id memory_safety is not a taxonomy family.",
|
||||
"not_told": "No defect is reported for memory, so a contributor is not told whether a memory-safety defect such as an out-of-bounds access exists in the change, even when it does."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -94,7 +94,11 @@ class PushReport:
|
||||
type(value) not in (int, float) or not math.isfinite(value) or value < 0 for value in self.timings.values()
|
||||
):
|
||||
raise ValueError("report requires finite nonnegative timings including total_seconds")
|
||||
if not isinstance(self.advisory_scope, AdvisoryScope):
|
||||
_require_loaded_scope(self.advisory_scope)
|
||||
|
||||
|
||||
def _require_loaded_scope(scope: object) -> None:
|
||||
if not isinstance(scope, AdvisoryScope):
|
||||
raise ValueError("report requires a loaded advisory scope")
|
||||
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ def test_shipped_record_loads_as_the_declared_provisional_scope():
|
||||
("path", "path"),
|
||||
("prototype", "prototype"),
|
||||
("deserialization", "deserialization"),
|
||||
("memory", "memory"),
|
||||
]
|
||||
assert scope.to_payload() == scope_record()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user