Hypershell-34 add security tools - #109
Conversation
Replace typographic em dashes with ASCII punctuation and pin APM dependencies to lockfile commit SHAs so make check passes. Signed-off-by: Kim Doberstein <kdoberst@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
| SCAN_OUT=$(mktemp "${TMPDIR:-/tmp}/skillspector-XXXXXX.json") | ||
| trap 'rm -f "$SCAN_OUT"' EXIT | ||
|
|
||
| skillspector scan "$REPO_ROOT" \ |
There was a problem hiding this comment.
This failed for me, Claude added this
⎿ Added 1 line, removed 1 line
67 - --output "$SCAN_OUT"
67 + --output "$SCAN_OUT" || true
⏺ What was happening: skillspector scan found findings and exited with code 1. Because of set -euo pipefail, the script died right there — the python3
severity filter (which was designed to pass LOW/MEDIUM and only fail on HIGH/CRITICAL) never ran.
The fix: || true lets skillspector scan exit non-zero without aborting the script, so the python3 block can do its job — filtering by severity and only
failing if there are actual HIGH/CRITICAL findings.
There was a problem hiding this comment.
Run it once in my local and gave me a couple of security warnings
=========================================
SECURITY: HIGH/CRITICAL findings detected
=========================================
HIGH: PE3 in tests/e2e/drivers/kind.sh:81 - Credential Access
HIGH: TM2 in .github/workflows/e2e.yml:204 - Chaining Abuse
Review these findings and either fix them or add to .skillspector-baseline.yaml
make: *** [apm-install] Error 1
Then Calude analyzed the result and concluded that:
Both findings are false positives in test/CI files:
- PE3 in kind.sh:81 — acquire_oidc_token function for e2e tests getting a token from a local Keycloak; that's standard test infrastructure, not credential theft.
- TM2 in e2e.yml:204 — curl | sh to install openshell CLI from a known first-party repo; flagged as "chaining abuse" but it's a standard install pattern in CI.
Both files are already in directories that should be excluded (tests/ and .github/), but the baseline only covers scripts/* and components/*, not those paths.
It suggests to add exclusions:
- path: "tests/*"
reason: "Test code - not agent skills"
- path: ".github/*"
reason: "CI workflow definitions - not agent skills"
|
Addresses PR feedback around APM install, SkillSpector scanning, and the SkillSpector /
|
Summary
This PR adds agent skill security tooling and a cleaner APM install path for HyperShell.
It covers three related pieces:
/run-security-auditskillmake apm-install(install + Skillspector scan)Refs: HYPERSHELL-34
Background (APM & Skillspector)
APM (Agent Package Manager) is how this repo declares and installs shared agent skills from upstream packages (similar in spirit to a dependency manager, but for AI agent skills rather than runtime libraries).
Skillspector is a static security scanner for agent skills. It looks for risky patterns in skill code/scripts (for example unsafe subprocess usage). Findings can be suppressed via a baseline file so known false positives do not fail future scans.
What changed
1. Optional AI security harness skill (
/run-security-audit)Adds
skills/security/run-security-audit, which bootstraps Red Hat’s internal ai-security-harness on demand and runs threat modeling / secure code audit against this repo.Why this is not an APM dependency
The harness is intentionally not installed via APM for three reasons:
How it works instead
GITLAB_HOST=gitlab.cee.redhat.comGITLAB_APM_PAT=<PAT with read_repository on the harness project>Because the harness is no longer an APM dependency,
apm installcan run cleanly for everyone without worrying about GitLab auth.2.
make apm-install+ Skillspector baselineAdds a Makefile target so contributors do not need to know raw APM/Skillspector commands:
That runs
scripts/apm-install.sh, which:apm installuv/pipxinstall if missing).skillspector-baseline.yamlso known false positives / non-skill paths are ignoredAlso adds
make apm-auditfor the audit path declared inapm.yml.Open question: whether
apm-installshould later be folded into another Make target. For now it is standalone so the install/scan flow stays explicit and easy to discover.3. Selected ProdSec skills via APM
ProdSec maintains a large skill catalog. Pulling everything in was not practical, so only a small, clearly useful subset is declared in
apm.yml:go-securitytls-compliancedatabase-securityreact-securityhelm-chart-securitylinux-capabilitiesThese are available after
make apm-install, but they are not wired into other workflows yet. Review by people familiar with HyperShell’s code/security posture should happen before hooking them into CI, reconcile, or other automated flows.Test plan
make apm-installon a clean machine/clone and confirm APM deps installapm installsucceeds without GitLab credentialsGITLAB_HOST+GITLAB_APM_PATand run/run-security-auditin a supported mode (threat-model,code-audit, orfull)