Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ All notable changes to SkillEvaluator are documented in this file.

### Fixed

- The managed Tier 1 runtime and CI image now pin SkillSpector 2.13.6,
which fixes false incomplete-analysis findings on valid JSON hook
`timeout` fields.
- Tier 1 accepts a verified, non-executable PNG that SkillSpector excludes
from text-pattern coverage when the remaining coverage and the full YARA
and artifact-integrity counts agree.
Expand Down
2 changes: 1 addition & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ license is retained at `/usr/local/share/licenses/gitleaks/LICENSE`.
| Tool | Pinned source | License |
| --- | --- | --- |
| Semgrep | [v1.182.0](https://github.com/semgrep/semgrep/tree/v1.182.0) | LGPL-2.1 |
| SkillSpector | [5482446](https://github.com/NVIDIA/SkillSpector/tree/54824463814a0be01360792523ec7245a69190fc) | Apache-2.0 |
| SkillSpector | [e2674da](https://github.com/NVIDIA/SkillSpector/tree/e2674da339b0bddc6e565d059c0577c6d9cd25da) | Apache-2.0 |
| Gitleaks | [v8.30.0](https://github.com/gitleaks/gitleaks/tree/v8.30.0) | MIT |

## Unicode security data
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements/skillspector.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
skillspector @ https://github.com/NVIDIA/SkillSpector/archive/54824463814a0be01360792523ec7245a69190fc.tar.gz
skillspector @ https://github.com/NVIDIA/SkillSpector/archive/e2674da339b0bddc6e565d059c0577c6d9cd25da.tar.gz
hatchling==1.31.0
177 changes: 175 additions & 2 deletions ci/requirements/skillspector.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/ci-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Install external Python scanners
run: |
uv tool install semgrep
uv tool install git+https://github.com/NVIDIA/SkillSpector.git@54824463814a0be01360792523ec7245a69190fc # v2.13.4
uv tool install --python 3.13 git+https://github.com/NVIDIA/SkillSpector.git@e2674da339b0bddc6e565d059c0577c6d9cd25da # v2.13.6

- name: Install Gitleaks
run: |
Expand Down
13 changes: 8 additions & 5 deletions docs/installation-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,21 @@ Missing required scanner evidence is reported as `INCOMPLETE`.

<Accordion title="Preinstall or troubleshoot security scanners">
Tier 1 verifies the SHA-256 checksums of its downloaded scanners. PyPI 0.9.0
pins SkillSpector 2.13.3; 1.0.1 pins 2.13.4. Both pin Gitleaks 8.30.0.
pins SkillSpector 2.13.3, and SkillEvaluator 1.0.1 pins 2.13.4. The current
GitHub source pins SkillSpector 2.13.6. All three pin Gitleaks 8.30.0.
In 1.0.1, uv is installed with SkillEvaluator as a base dependency
and runs SkillSpector in its own environment. PyPI 0.9.0 needs uv installed
separately, as shown above. An existing uv on PATH is used first.

SkillEvaluator 1.0.1 accepts an automatically discovered SkillSpector only when it
matches the pinned version; otherwise it provisions the pinned release.
Explicit scanner path overrides are checked separately. To manage the tools yourself:
SkillEvaluator 1.0.1 and the current GitHub source use an automatically discovered
SkillSpector when it matches the pinned version. Otherwise they provision the
pinned release. Explicit scanner path overrides are checked separately.
To preinstall the scanners for a GitHub source install, run the following commands.
For a published SkillEvaluator release, use its corresponding SkillSpector version above.

```bash title="Optional scanner installation"
uv tool install semgrep
uv tool install git+https://github.com/NVIDIA/SkillSpector.git@v2.13.4
uv tool install --python 3.13 git+https://github.com/NVIDIA/SkillSpector.git@v2.13.6
brew install gitleaks
```

Expand Down
4 changes: 2 additions & 2 deletions src/skillevaluator/utils/scanner_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
from pathlib import Path
from types import MappingProxyType

SKILLSPECTOR_VERSION = "2.13.4"
SKILLSPECTOR_VERSION = "2.13.6"
SKILLSPECTOR_WHEEL = f"skillspector-{SKILLSPECTOR_VERSION}-py3-none-any.whl"
SKILLSPECTOR_WHEEL_URL = (
f"https://github.com/NVIDIA/SkillSpector/releases/download/v{SKILLSPECTOR_VERSION}/{SKILLSPECTOR_WHEEL}"
)
SKILLSPECTOR_WHEEL_SHA256 = "c5e7f290897c65018013a6e37022fabdd2ba1aeeb4994b65df2de8b0d536bea0"
SKILLSPECTOR_WHEEL_SHA256 = "e7b46c55e726405b2a068d375d1ee8e799e15d86f3fc05f84feb5ba962198b15"
# SkillSpector needs Python 3.12+, and its yara-python dependency publishes wheels only
# through CPython 3.13. Left unpinned, uv picks its newest Python and has to compile
# yara-python, which fails on hosts without a C toolchain such as a default Windows install.
Expand Down
8 changes: 4 additions & 4 deletions tests/test_doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ def test_tier1_reports_managed_provisioning_without_naming_an_override(scanners,
monkeypatch.setattr(gitleaks, "_ensure", None)
monkeypatch.setattr(Tools, "skillspector", skillspector)
monkeypatch.setattr(Tools, "gitleaks", gitleaks)
scanners.output["uv"] = "SkillSpector v2.13.4\n"
scanners.output["uv"] = "SkillSpector v2.13.6\n"

rows = _rows(tier="1", checks="security,code")

assert rows["SkillSpector"] == ("pass", "2.13.4 at /env/bin/uv (uv tool run)")
assert rows["SkillSpector"] == ("pass", "2.13.6 at /env/bin/uv (uv tool run)")
assert rows["Gitleaks"] == ("pass", f"8.21.2 at {gitleaks.path} (managed)")
assert scanners.calls[0][0][:3] == ["/env/bin/uv", "tool", "run"]
assert scanners.calls[0][0][-2:] == ["skillspector", "--version"]
Expand All @@ -165,13 +165,13 @@ def test_tier1_reports_source_selected_during_probe(scanners, monkeypatch) -> No
def run(*args, **kwargs):
tool._path = "/doctor-tools/uv"
tool.resolution_source = "uv tool run"
return tool_runner.ToolResult(True, "SkillSpector v2.13.4", "", 0)
return tool_runner.ToolResult(True, "SkillSpector v2.13.6", "", 0)

monkeypatch.setattr(tool, "run", run)

assert _rows(tier="1", checks="security")["SkillSpector"] == (
"pass",
"2.13.4 at /doctor-tools/uv (uv tool run)",
"2.13.6 at /doctor-tools/uv (uv tool run)",
)


Expand Down
4 changes: 2 additions & 2 deletions tests/test_oss_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,10 +952,10 @@ def test_launch_docs_address_scanner_and_naming_ambiguities() -> None:
assert "are not interchangeable" in environment


SKILLSPECTOR_RELEASE = "v2.13.4"
SKILLSPECTOR_RELEASE = "v2.13.6"
# Tag commit of SKILLSPECTOR_RELEASE. The Tier 1 CI image installs this commit's
# source archive, so it must move together with the install instructions.
SKILLSPECTOR_RELEASE_COMMIT = "54824463814a0be01360792523ec7245a69190fc"
SKILLSPECTOR_RELEASE_COMMIT = "e2674da339b0bddc6e565d059c0577c6d9cd25da"


def test_skillspector_install_instructions_pin_one_release() -> None:
Expand Down
6 changes: 3 additions & 3 deletions tests/utils/test_scanner_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_prepare_downloads_wheel_and_builds_uv_environment(self, monkeypatch):
monkeypatch.setattr(scanner_install, "SKILLSPECTOR_WHEEL_SHA256", hashlib.sha256(payload).hexdigest())
with (
patch("urllib.request.urlopen", return_value=io.BytesIO(payload)),
patch("subprocess.run", return_value=CompletedProcess([], 0, "SkillSpector v2.13.4", "")) as run,
patch("subprocess.run", return_value=CompletedProcess([], 0, "SkillSpector v2.13.6", "")) as run,
):
assert scanner_install.prepare_skillspector("/opt/uv") is None
wheel = scanner_install.managed_skillspector_wheel()
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_checksum_mismatch_never_runs(self):
patch("subprocess.run") as run,
):
result = tool.run(["scan", "x"])
assert result.error_message == "SkillSpector 2.13.4 download failed checksum verification"
assert result.error_message == "SkillSpector 2.13.6 download failed checksum verification"
run.assert_not_called()

def test_pinned_wheel_url_matches_version(self):
Expand All @@ -116,7 +116,7 @@ def test_installed_scanner_wins_over_fallback(self):
found = {"uv": "/opt/uv", "skillspector": "/usr/bin/skillspector"}
with patch.object(tool_runner, "resolve_tool_path", _resolver(found)):
tool = ExternalTool("skillspector", "skillspector", managed=True)
with patch("subprocess.run", return_value=CompletedProcess([], 0, "SkillSpector v2.13.4", "")) as run:
with patch("subprocess.run", return_value=CompletedProcess([], 0, "SkillSpector v2.13.6", "")) as run:
tool.run(["--version"])
assert run.call_args.args[0] == ["/usr/bin/skillspector", "--version"]

Expand Down
35 changes: 18 additions & 17 deletions tests/utils/test_tool_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def test_skillspector_install_hint_uses_release_wheel(self):

assert (
tool.get_install_hint() == "Install with: uv tool install "
"https://github.com/NVIDIA/SkillSpector/releases/download/v2.13.4/skillspector-2.13.4-py3-none-any.whl"
"https://github.com/NVIDIA/SkillSpector/releases/download/v2.13.6/skillspector-2.13.6-py3-none-any.whl"
)
assert "[security]" not in tool.get_install_hint()

Expand Down Expand Up @@ -496,13 +496,14 @@ def _scanner(bindir, version_output, version_exit=0):
("version_output", "version_exit"),
[
("SkillSpector v2.11.2", 0),
("SkillSpector v2.13.4", 0),
("SkillSpector v2.14.0", 0),
("version unavailable", 0),
("SkillSpector v2.13.4", 2),
("SkillSpector v2.13.4rc1", 0),
("SkillSpector v2.13.4_rc1", 0),
("Dependency foo 2.13.4 initialized; scanner version unavailable", 0),
("SkillSpector v2.13.4\nSkillSpector v2.11.2", 0),
("SkillSpector v2.13.6", 2),
("SkillSpector v2.13.6rc1", 0),
("SkillSpector v2.13.6_rc1", 0),
("Dependency foo 2.13.6 initialized; scanner version unavailable", 0),
("SkillSpector v2.13.6\nSkillSpector v2.11.2", 0),
],
)
def test_mismatched_or_unverified_version_runs_pinned_wheel(
Expand All @@ -521,19 +522,19 @@ def test_mismatched_or_unverified_version_runs_pinned_wheel(
"run",
"--quiet",
"--from",
str(scanner_bin.parent / "runtime/skillspector/2.13.4/skillspector-2.13.4-py3-none-any.whl"),
str(scanner_bin.parent / "runtime/skillspector/2.13.6/skillspector-2.13.6-py3-none-any.whl"),
"skillspector",
"scan",
"target",
]
assert tool.path == str(scanner_bin / "uv")
assert tool.version == "2.13.4"
assert tool.version == "2.13.6"
assert tool.resolution_source == "uv tool run"
assert str(scanner) in caplog.text
assert "2.13.4" in caplog.text
assert "2.13.6" in caplog.text

def test_constructor_refresh_and_path_lookup_do_not_launch_scanner(self, scanner_bin):
scanner = self._scanner(scanner_bin, "SkillSpector v2.13.4")
scanner = self._scanner(scanner_bin, "SkillSpector v2.13.6")
marker = scanner_bin / "launched"
scanner.write_text(scanner.read_text().replace("#!/bin/sh\n", f"#!/bin/sh\n: > '{marker}'\n"))

Expand All @@ -547,12 +548,12 @@ def test_constructor_refresh_and_path_lookup_do_not_launch_scanner(self, scanner
assert marker.exists()

def test_fresh_module_import_does_not_launch_scanner(self, scanner_bin, monkeypatch):
self._scanner(scanner_bin, "SkillSpector v2.13.4")
self._scanner(scanner_bin, "SkillSpector v2.13.6")
calls = []

def run(argv, **kwargs):
calls.append(argv)
return CompletedProcess(argv, 0, "SkillSpector v2.13.4", "")
return CompletedProcess(argv, 0, "SkillSpector v2.13.6", "")

monkeypatch.setattr(tool_runner.subprocess, "run", run)
name = "skillevaluator.utils._tool_runner_import_test"
Expand All @@ -566,7 +567,7 @@ def run(argv, **kwargs):
assert calls == []

def test_lazy_probe_uses_sanitized_environment_and_caller_timeout(self, scanner_bin, monkeypatch):
self._scanner(scanner_bin, "SkillSpector v2.13.4")
self._scanner(scanner_bin, "SkillSpector v2.13.6")
monkeypatch.setenv("NVIDIA_API_KEY", "ambient-secret")
real_run = tool_runner.subprocess.run
calls = []
Expand All @@ -592,13 +593,13 @@ def run(argv, **kwargs):
assert calls[-1][1]["env"]["NVIDIA_API_KEY"] == "requested-scan-secret"

def test_matching_pinned_version_uses_installed_scanner(self, scanner_bin):
scanner = self._scanner(scanner_bin, "SkillSpector v2.13.4")
scanner = self._scanner(scanner_bin, "SkillSpector v2.13.6")

tool = ExternalTool("SkillSpector", "skillspector", managed=True)

assert tool.run(["scan", "target"], log_command=False).stdout == "direct scanner\n"
assert tool.path == str(scanner)
assert tool.version == "2.13.4"
assert tool.version == "2.13.6"
assert tool.resolution_source == "automatic"

def test_stale_scanner_falls_back_to_packaged_uv(self, scanner_bin, monkeypatch):
Expand All @@ -613,7 +614,7 @@ def test_stale_scanner_falls_back_to_packaged_uv(self, scanner_bin, monkeypatch)
assert result.success
assert result.exit_code == 0
assert result.stdout.splitlines()[:4] == ["tool", "run", "--quiet", "--from"]
assert result.stdout.splitlines()[4].endswith("/2.13.4/skillspector-2.13.4-py3-none-any.whl")
assert result.stdout.splitlines()[4].endswith("/2.13.6/skillspector-2.13.6-py3-none-any.whl")
assert tool.path == str(packaged_uv)
assert tool.resolution_source == "uv tool run"

Expand Down Expand Up @@ -653,7 +654,7 @@ def test_mismatched_version_cannot_run_when_managed_runtime_unavailable(
assert result.error_message == tool.configuration_error
assert str(scanner) in tool.configuration_error
assert "2.11.2" in tool.configuration_error
assert "2.13.4" in tool.configuration_error
assert "2.13.6" in tool.configuration_error
assert "uv" in tool.get_install_hint()
assert "SKILLEVALUATOR_SKILLSPECTOR_PATH" in tool.get_install_hint()

Expand Down
Loading