diff --git a/docs/scanning.md b/docs/scanning.md index d5326819..abbd089c 100644 --- a/docs/scanning.md +++ b/docs/scanning.md @@ -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 | diff --git a/src/openultrasast/push/advisory-scope.json b/src/openultrasast/push/advisory-scope.json index 63657d30..eb6977dc 100644 --- a/src/openultrasast/push/advisory-scope.json +++ b/src/openultrasast/push/advisory-scope.json @@ -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." } ] } diff --git a/src/openultrasast/push/report.py b/src/openultrasast/push/report.py index fb6b474b..ff28a148 100644 --- a/src/openultrasast/push/report.py +++ b/src/openultrasast/push/report.py @@ -94,8 +94,12 @@ 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): - raise ValueError("report requires a loaded advisory scope") + _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") @dataclass(frozen=True) diff --git a/tests/test_push_advisory_scope.py b/tests/test_push_advisory_scope.py index 1c517963..4863781b 100644 --- a/tests/test_push_advisory_scope.py +++ b/tests/test_push_advisory_scope.py @@ -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()