MCPcopy Create free account

hub / github.com/alpha-omega-security/scrutineer / functions

Functions2,165 in github.com/alpha-omega-security/scrutineer

↓ 8 callersFunctionfindingNotes
findingNotes fetches the notes rows for a finding. Used by the verify tests to assert the evidence trail lands in FindingNote now that the old Finding
internal/worker/skill_parsers_test.go:461
↓ 8 callersFunctionmdCell
(m map[string]any, key string)
internal/web/repo_report.go:679
↓ 8 callersMethodnow
()
internal/worker/worker.go:263
↓ 8 callersMethodparseExposureOutput
parseExposureOutput reads the one-shot verdict produced by the exposure skill and upserts a finding_dependents row. Unknown status values fall back to
internal/worker/exposure.go:230
↓ 8 callersFunctionparseTimeField
parseTimeField wraps parseTime and emits a transcript line when a non-empty value matches none of the accepted layouts, so a model emitting timestamps
internal/worker/skill_parsers.go:1105
↓ 8 callersFunctionparseUnifiedDiff
parseUnifiedDiff extracts target file paths from a unified diff, rejecting paths that escape the workspace and malformed hunk headers. It is deliberat
internal/worker/patch_gate.go:133
↓ 8 callersFunctionpreferRateLimitReset
(current, candidate *RateLimitInfo)
internal/worker/claude_limit.go:126
↓ 8 callersFunctionproxySidecarName
proxySidecarName returns the container name for a single hardened scan's egress proxy sidecar. Uniqueness per scan keeps concurrent scans' sidecars an
internal/worker/container.go:144
↓ 8 callersFunctionreadSnippet
readSnippet returns the source lines around the finding's primary location (file:line) read from srcDir, with snippetContextLines of context on either
internal/worker/snippet.go:21
↓ 8 callersMethodrepoScopedID
The read endpoints below expose the structured rows scrutineer already populates from prior skill scans. Skills that need context for a repo (verify/p
internal/web/api_reads.go:22
↓ 8 callersFunctionseedPrereqSkill
(t *testing.T, w *Worker, prereq string, active bool)
internal/worker/preflight_test.go:65
↓ 8 callersFunctionstageSkill
stageSkill writes the skill's files into dst so claude-code discovers them at ./.claude/skills/{name}. SKILL.md and schema.json are reconstructed from
internal/worker/skill.go:923
↓ 8 callersFunctionwrapErr
(format Format, err error)
internal/ingest/ingest.go:167
↓ 7 callersFunctionAddFindingReference
AddFindingReference records an external URL related to the finding.
internal/db/finding_helpers.go:329
↓ 7 callersFunctionLoadDirectory
LoadDirectory walks root looking for */SKILL.md files, parses each, and upserts into the DB. Returns the number of skills seen and any hard errors enc
internal/skills/load.go:23
↓ 7 callersFunctionLookupCWE
LookupCWE accepts "CWE-79", "cwe-79" or "79" and returns the entry plus the canonical id. Second return is false when unknown.
internal/web/cwe.go:85
↓ 7 callersFunctionNew
New builds a queue wired to goqite. concurrency controls how many jobs the runner processes in parallel; pass 0 to use DefaultWorkerConcurrency. The r
internal/queue/queue.go:61
↓ 7 callersMethodOnOverage
OnOverage reports whether the Claude account is currently past its included subscription quota (any tracked window isUsingOverage with an unexpired re
internal/worker/worker.go:240
↓ 7 callersMethodPersistStreamedFinding
PersistStreamedFinding records one finding emitted mid-scan into the concurrent-finding log so sibling scans in the same ScanGroup can read it before
internal/worker/findings.go:24
↓ 7 callersMethodShouldDowngradeModel
ShouldDowngradeModel reports whether the max/high-to-mid overage fallback is both enabled and currently active. The web layer calls it at enqueue to r
internal/worker/worker.go:252
↓ 7 callersFunctionSplitPatterns
SplitPatterns parses the newline-separated form stored in db.Skill.Paths / db.Skill.IgnorePaths into a clean slice, trimming whitespace and dropping e
internal/skills/filter.go:144
↓ 7 callersMethodStart
Start runs the job runner until ctx is cancelled, then waits for in-flight jobs to drain. ctx is retained as the parent for every runner instance, so
internal/queue/queue.go:92
↓ 7 callersFunctionWriteFindingTimeField
WriteFindingTimeField is the time.Time twin of WriteFindingField for timestamp columns the analyst (or a skill) can set. The closed set of writable ti
internal/db/finding_helpers.go:98
↓ 7 callersFunctionappendAutoResume
(msg string, resetAt *time.Time)
internal/worker/worker.go:673
↓ 7 callersFunctionauditAPIReq
(t *testing.T, s *Server, method, path, token, body string)
internal/web/audit_test.go:31
↓ 7 callersFunctiondispatch
dispatch routes a subcommand when args[0] names one, returning handled=true. Server flags start with "-" and an empty argv both fall through with hand
cmd/scrutineer/backup.go:29
↓ 7 callersFunctionimageExistsLocally
(ctx context.Context, rt ContainerRuntime, tag string)
internal/worker/profile.go:660
↓ 7 callersFunctionimageTag
imageTag returns the content-addressed tag for a profile's Dockerfile. The runner image ref and its resolved registry digest are both folded into the
internal/worker/profile.go:501
↓ 7 callersFunctionloadRepoMap
loadRepoMap batch-loads the repositories referenced by a slice of rows and returns a map keyed by repository ID. The repoID accessor abstracts over Fi
internal/web/server.go:760
↓ 7 callersFunctionpaginate
(r *http.Request, total int64)
internal/web/server.go:550
↓ 7 callersFunctionparseProxyConfig
parseProxyConfig resolves the sidecar configuration from flags layered over environment defaults. Env carries the per-scan values the container runner
cmd/scrutineer/proxy.go:41
↓ 7 callersMethodparseSkillOutput
(skill *db.Skill, scan *db.Scan, report string, emit func(Event))
internal/worker/skill.go:295
↓ 7 callersFunctionpreferAccountErrText
preferAccountErrText picks which account-error message a run should keep as it streams lines: the first account-error line seen, except that a later a
internal/worker/claude_limit.go:113
↓ 7 callersFunctionrequireRepoListRow
(t *testing.T, body string, repoID uint)
internal/web/server_test.go:52
↓ 7 callersFunctionresumableReset
resumableReset returns a captured reset only for transient account limits.
internal/worker/claude_limit.go:142
↓ 7 callersFunctionstageContext
(workRoot, apiBase, forkOrg, metadataDir string, scan *db.Scan, repo *db.Repository)
internal/worker/skill.go:1051
↓ 7 callersFunctionstubVid
stubVid writes an executable that prints out and exits with code, recording its argv (one per line) to args.txt next to it.
internal/worker/vid_test.go:28
↓ 7 callersFunctionvalidateFixPost
(s *Server, repoID uint, ref string, findingIDs ...uint)
internal/web/validate_fix_enqueue_test.go:46
↓ 7 callersFunctionverifyUpstreamDNS
(ctx context.Context, allow []string, lookup func(context.Context, string) ([]string, error))
internal/worker/egress.go:471
↓ 7 callersMethodworkRoot
workRoot returns the per-scan workspace directory under DataDir.
internal/worker/worker.go:320
↓ 7 callersFunctionwriteTestKey
writeTestKey writes PEM bytes to a temp file and returns the path.
cmd/scrutineer/main_test.go:285
↓ 6 callersFunctionEcosystemType
EcosystemType returns the canonical PURL-type ecosystem to store on Package and Dependency rows: the parsed PURL type when present, else the declared
internal/db/ecosystem.go:111
↓ 6 callersMethodEnqueue
Enqueue puts a job on the queue. Higher priority is received first; use 0 for long-running scans and >0 for quick housekeeping that should jump them.
internal/queue/queue.go:155
↓ 6 callersMethodEnsureImage
EnsureImage builds the profile's container image if it is not in the local cache and returns the tag to pass to the runtime's `run`. A runner-based pr
internal/worker/profile.go:565
↓ 6 callersMethodError
()
internal/worker/schema_validate.go:19
↓ 6 callersFunctionHostSELinuxEnabled
HostSELinuxEnabled reports whether the host has SELinux enabled (enforcing or permissive). Best-effort filesystem probe, no libselinux dependency. Per
internal/worker/selinux.go:63
↓ 6 callersFunctionLatestRevalidateVerdict
LatestRevalidateVerdict returns the verdict from the most recent revalidate FindingNote on the finding, or empty when revalidate has not run. The audi
internal/db/audit.go:162
↓ 6 callersFunctionProfileByName
ProfileByName returns the registered profile, or the default profile when name is empty / "default" / unknown. Unknown names fall back rather than err
internal/worker/profile.go:236
↓ 6 callersMethodReconfigure
Reconfigure swaps the runner for one with a new parallelism limit without restarting the process. goqite fixes the limit at construction, so the only
internal/queue/queue.go:129
↓ 6 callersFunctionResolveHostGatewayIPv4
ResolveHostGatewayIPv4 returns the IPv4 address that the runtime's host-gateway maps to on the given network. An empty network probes the default brid
internal/worker/container.go:622
↓ 6 callersMethodRunSkill
(ctx context.Context, sj SkillJob, emit func(Event))
internal/worker/claude.go:32
↓ 6 callersFunctionRunnerImageName
RunnerImageName returns the container image the given runner uses for scans, or "" when the runner is not container-backed (e.g. LocalClaude under --n
internal/worker/versions.go:13
↓ 6 callersMethodSetDefaultModel
SetDefaultModel pins the default model id, overriding "first entry in the pick list". Set at startup from config and mutable via settings/model; in-me
internal/web/models.go:66
↓ 6 callersFunctionValidModel
(id string)
internal/web/models.go:87
↓ 6 callersFunctionappendFixDescription
appendFixDescription folds an ingested fix description into the Trace markdown rather than writing Finding.SuggestedFix, which is reserved for diffs t
internal/web/import.go:350
↓ 6 callersMethodapplyAccountPauseReset
applyAccountPauseReset moves the trigger and batch to the furthest known reset, returning that effective reset for scheduling.
internal/worker/worker.go:738
↓ 6 callersFunctionapplyCWECategoryFilter
applyCWECategoryFilter restricts a findings query to the CWE-IDs in the given View-1400 category. UncategorizedCWE matches findings whose cwe is empty
internal/web/cwe.go:126
↓ 6 callersFunctionassertValidateFixRejected
(t *testing.T, s *Server, w *httptest.ResponseRecorder, repoID uint)
internal/web/validate_fix_enqueue_test.go:144
↓ 6 callersMethodautoEnqueueFindingDedup
autoEnqueueFindingDedup is wired onto Worker.OnScanFinalized. The worker calls it once after a scan completes and its findings are committed. We enque
internal/web/finding_dedup_enqueue.go:43
↓ 6 callersFunctionbindMount
bindMount builds a `-v` value "src:dst[:opts]" for a runner bind mount, appending the SELinux relabel option "z" when relabel is true. opts carries an
internal/worker/selinux.go:136
↓ 6 callersFunctionchainTestSetup
chainTestSetup creates a repo, a parent scan, a verify skill, and a finding the callback tests can act on. Returns the server, the verify skill, and a
internal/web/import_test.go:255
↓ 6 callersFunctionclaudeAccountErrorText
claudeAccountErrorText returns s when it looks like an account-level message from claude-code -- a usage/plan/rate limit, or access being disabled or
internal/worker/claude_limit.go:60
↓ 6 callersFunctioncloneOrPull
(ctx context.Context, url, ref, dst string, fullClone bool)
internal/skills/git.go:70
↓ 6 callersFunctionloadIdentities
loadIdentities reads an age identity file (one or more AGE-SECRET-KEY lines) or an SSH private key (PEM). Both formats are auto-detected. Encrypted SS
cmd/scrutineer/main.go:906
↓ 6 callersFunctionnewFindingForExploitedTest
(t *testing.T, s *Server)
internal/web/finding_exploited_test.go:28
↓ 6 callersFunctionnewFindingUnder
(t *testing.T, s *Server, repoID, scanID uint, status db.FindingLifecycle)
internal/web/finding_dedup_enqueue_test.go:28
↓ 6 callersFunctionnewScan
(t *testing.T, s *Server, repoID uint, skillName string)
internal/web/finding_dedup_enqueue_test.go:21
↓ 6 callersFunctionnewStreamWorker
(t *testing.T)
internal/worker/findings_stream_test.go:13
↓ 6 callersFunctionopenEcosystemsTestDB
(t *testing.T)
internal/worker/ecosystems_test.go:75
↓ 6 callersMethodparsePatchOutput
parsePatchOutput runs the applicability gate over a patch skill's diff and, on pass, writes Finding.SuggestedFix and Finding.SuggestedFixCommit via Wr
internal/worker/patch_gate.go:32
↓ 6 callersFunctionparseReport
(raw []byte)
internal/worker/findings.go:96
↓ 6 callersFunctionpodmanOrSkip
(t *testing.T)
internal/worker/podman_integration_test.go:33
↓ 6 callersFunctionpostValidate
(t *testing.T, s *Server, scanID uint, token, body string)
internal/web/api_test.go:585
↓ 6 callersFunctionprepareLocalSrc
prepareLocalSrc populates workRoot/src by copying the user's local directory. Mirrors prepareDependentSrc's "copy into per-scan src" pattern so the co
internal/worker/clone.go:35
↓ 6 callersFunctionrefreshEcosystems
(ctx context.Context, gdb *gorm.DB, repoID uint, staleOnly bool, log *slog.Logger, ep ecosystemsEndpoints)
internal/worker/ecosystems.go:98
↓ 6 callersFunctionsanitiseFilename
(s string)
internal/web/repo_report.go:763
↓ 6 callersFunctionsecurityHeaders
securityHeaders enforces T3 mitigations: host header check to prevent DNS rebinding, Sec-Fetch-Site check on POST to prevent cross-origin CSRF, and a
internal/web/server.go:2586
↓ 6 callersFunctiontoStringSlice
(v any)
internal/web/finding_csaf_test.go:218
↓ 6 callersMethodvalidateFixReject
(w http.ResponseWriter, r *http.Request, repoID uint, msg string)
internal/web/validate_fix_enqueue.go:120
↓ 6 callersFunctionwriteFiles
(t *testing.T, root string, files map[string]string)
internal/worker/skill_test.go:716
↓ 6 callersFunctionwriteProse
(b *strings.Builder, heading, body string)
internal/web/repo_report.go:503
↓ 6 callersFunctionwriteSrcFile
(t *testing.T, srcDir, rel string)
internal/worker/vid_test.go:15
↓ 5 callersFunctionAddFindingCommunication
AddFindingCommunication records one external interaction.
internal/db/finding_helpers.go:308
↓ 5 callersFunctionAuditQueue
AuditQueue returns findings the automation has bucketed as not worth pursuing, which a TOC or VCT auditor should spot-check periodically to keep the h
internal/db/audit.go:77
↓ 5 callersFunctionCWECategories
CWECategories returns the View-1400 category labels in alphabetical order. Used to populate the category filter dropdown.
internal/web/cwe.go:99
↓ 5 callersFunctionCWEsInCategory
CWEsInCategory returns the CWE-IDs that belong to a View-1400 category, or nil for an unknown category. The UncategorizedCWE bucket is handled by appl
internal/web/cwe.go:119
↓ 5 callersMethodIsDefault
IsDefault reports whether p falls back to the configured runner image instead of a profile-specific built one.
internal/worker/profile.go:101
↓ 5 callersFunctionModelForTier
ModelForTier resolves a tier name to a concrete model id: a per-tier setting in the DB wins, then a built-in heuristic over the pick list, then the ca
internal/web/models.go:127
↓ 5 callersFunctionResolveSELinuxRelabel
ResolveSELinuxRelabel turns the --selinux switch into the concrete decision of whether to add the ":z" relabel option to runner bind mounts. See the m
internal/worker/selinux.go:97
↓ 5 callersFunctionSQLStringLiteral
SQLStringLiteral renders s as a single-quoted SQL string literal, doubling any embedded single quote. It is for splicing a TRUSTED CONSTANT into a que
internal/db/db.go:377
↓ 5 callersFunctionSeverityAtLeast
SeverityAtLeast reports whether got ranks at or above the threshold on the Low/Medium/High/Critical scale. An empty threshold never matches.
internal/db/finding_helpers.go:221
↓ 5 callersFunctionSnapshot
Snapshot writes a consistent copy of the SQLite database at src to dest using VACUUM INTO. Unlike Open it neither migrates nor otherwise writes to src
internal/db/db.go:1106
↓ 5 callersMethodTotalInputTokens
TotalInputTokens is everything billed on the input side: fresh input plus both cache categories.
internal/db/db.go:958
↓ 5 callersFunctionValidEffort
(value string)
internal/web/efforts.go:50
↓ 5 callersFunctionValidateGitRef
ValidateGitRef restricts refs to a conservative branch/tag-name charset before they flow into the fetchRef path. The clone code already passes ref aft
internal/worker/clone.go:96
↓ 5 callersFunctionValidateTheme
ValidateTheme returns an error when s is not a known theme name. Empty is valid (caller keeps the default).
internal/config/config.go:189
↓ 5 callersFunctionalmostEq
(a, b float64)
internal/web/usage_test.go:14
↓ 5 callersFunctionappendAutoResumeFailure
(msg string, err error)
internal/worker/worker.go:702
↓ 5 callersFunctionassertExists
(t *testing.T, root string, rels ...string)
internal/worker/skill_test.go:729
↓ 5 callersFunctionassertGone
(t *testing.T, root string, rels ...string)
internal/worker/skill_test.go:738
← previousnext →101–200 of 2,165, ranked by callers