zuke.tools.security
@zuke/security 1.0.1: @zuke/security — typed task wrappers for free, open-source security scanners (zizmor, actionlint, gitleaks, osv-scanner, semgrep, trivy) for Zuke builds.
zuke on PyPI ↗ 9 symbols
Symbols
class ActionlintSettings(ToolSettings) Settings for [actionlint](https://github.com/rhysd/actionlint), a linter for GitHub Actions workflow files (and the shell embedded in run: steps).
-
files(*paths: str) -> SelfAdd an explicit workflow file to lint (positional); repeatable.
-
format(template: str) -> SelfOutput format template (
-format), e.g.'{{json .}}'. -
color() -> SelfForce colored output (
-color). -
no_color() -> SelfDisable colored output (
-no-color).
class GitleaksDetectSettings(ToolSettings) Settings for [gitleaks detect](https://github.com/gitleaks/gitleaks), which scans a directory (and, by default, git history) for committed secrets.
-
source(path: str) -> SelfPath to scan (
--source). -
config(path: str) -> SelfUse an explicit gitleaks config (
--config). -
report_format(value: str) -> SelfReport format (
--report-format), e.g.json,sarif,csv. -
report_path(path: str) -> SelfWrite the report to a file (
--report-path). -
redact() -> SelfRedact secret values from the output (
--redact). -
no_git() -> SelfTreat the source as a plain directory, not a git repo (
--no-git). -
verbose() -> SelfVerbose output (
--verbose). -
log_opts(opts: str) -> SelfRestrict which commits are scanned, passed straight through to
git log(--log-opts). Without this,gitleaks detectwalks the whole history reachable from the refs present in the checkout — so on a pull request, where CI typically fetches every branch, a secret-shaped string on an unrelated branch fails the scan and the failure appears on whichever pull request is looked at. Passing a range such asorigin/main..HEADscopes the scan to the commits under review. Has no effect alongside noGit, which makes gitleaks treat the source as a plain directory and ignore history entirely.
class OsvScannerSettings(ToolSettings) Settings for [osv-scanner](https://github.com/google/osv-scanner), which matches lockfile entries against the OSV vulnerability database.
-
lockfile(path: str) -> SelfScan an explicit lockfile (
--lockfile); repeatable. -
paths(*inputs: str) -> SelfAdd a directory to scan (positional); repeatable.
-
format(value: str) -> SelfOutput format (
--format), e.g.table,json,sarif. -
output(path: str) -> SelfWrite the report to a file (
--output). -
recursive() -> SelfRecurse into subdirectories (
--recursive).
class SecurityTasks Task functions for running free, open-source security scanners.
-
static async zizmor(ctx: ServiceContext, configure: Callable[[ZizmorSettings], ZizmorSettings] | None=None) -> ExecResultAudit GitHub Actions workflows with
zizmor. -
static async actionlint(ctx: ServiceContext, configure: Callable[[ActionlintSettings], ActionlintSettings] | None=None) -> ExecResultLint GitHub Actions workflows with
actionlint. -
static async gitleaks(ctx: ServiceContext, configure: Callable[[GitleaksDetectSettings], GitleaksDetectSettings] | None=None) -> ExecResultScan for committed secrets with
gitleaks detect. -
static async osv_scanner(ctx: ServiceContext, configure: Callable[[OsvScannerSettings], OsvScannerSettings] | None=None) -> ExecResultScan lockfiles for known vulnerabilities with
osv-scanner. -
static async semgrep(ctx: ServiceContext, configure: Callable[[SemgrepScanSettings], SemgrepScanSettings] | None=None) -> ExecResultRun source-code static analysis with
semgrep scan. -
static async trivy_fs(ctx: ServiceContext, configure: Callable[[TrivyFsSettings], TrivyFsSettings] | None=None) -> ExecResultScan a filesystem path with
trivy fs. -
static async trivy_config(ctx: ServiceContext, configure: Callable[[TrivyConfigSettings], TrivyConfigSettings] | None=None) -> ExecResultScan configuration / IaC files with
trivy config.
class SemgrepScanSettings(ToolSettings) Settings for [semgrep scan](https://github.com/semgrep/semgrep), a static analysis engine for source code. Defaults to whatever rules --config selects (e.g. auto or p/ci).
-
config(value: str) -> SelfAdd a rules config (
--config), e.g.auto,p/ci; repeatable. -
paths(*inputs: str) -> SelfAdd a path to scan (positional); repeatable.
-
sarif() -> SelfEmit SARIF (
--sarif). -
json() -> SelfEmit JSON (
--json). -
output(path: str) -> SelfWrite output to a file (
--output). -
error() -> SelfExit non-zero when findings are present (
--error).
class TrivyConfigSettings(TrivyReportSettings) Settings for [trivy config](https://github.com/aquasecurity/trivy), which scans IaC / configuration files (Dockerfiles, workflows, etc.) for misconfigurations.
-
target(path: str) -> SelfThe path to scan (default
.).
class TrivyFsSettings(TrivyReportSettings) Settings for [trivy fs](https://github.com/aquasecurity/trivy), which scans a filesystem path for vulnerabilities, secrets, and misconfigurations.
-
target(path: str) -> SelfThe path to scan (default
.). -
scanners(*values: str) -> SelfEnable specific scanners (
--scanners), e.g.vuln,secret,misconfig.
class TrivyReportSettings(ToolSettings) Shared options for trivy subcommands that produce a report.
-
format(value: str) -> SelfReport format (
--format), e.g.table,json,sarif. -
output(path: str) -> SelfWrite the report to a file (
--output). -
severity(*values: str) -> SelfRestrict to these severities (
--severity), e.g.HIGH,CRITICAL. -
exit_code(code: float) -> SelfProcess exit code when issues are found (
--exit-code).
class ZizmorSettings(ToolSettings) Settings for [zizmor](https://github.com/woodruffw/zizmor), a static analyzer for GitHub Actions workflows (detects unpinned actions, script injection, over-broad permissions, and more).
-
paths(*inputs: str) -> SelfAdd a workflow file or directory to audit (positional); repeatable.
-
config(path: str) -> SelfUse an explicit zizmor config file (
--config). -
format(value: str) -> SelfOutput format (
--format), e.g.plain,json, orsarif. -
min_severity(value: str) -> SelfOnly report findings at or above this severity (
--min-severity). -
persona(value: str) -> SelfAudit persona (
--persona), e.g.regular,pedantic,auditor. -
offline() -> SelfDo not perform any network access (
--offline).