chore(security): pin Socket.dev policy in-repo (Refs ops-3pdm) - #124
Conversation
tps-kern
left a comment
There was a problem hiding this comment.
Request changes — issueRules syntax is wrong, file is a no-op
Same finding as flair#1483. The issueRules block uses deferTo: error / deferTo: warn syntax, which is the Policies API syntax, not the socket.yml syntax. The @socketsecurity/config parser (v3.0.1) defines issueRules values as boolean. Object values are silently stripped by AJV with removeAdditional: 'failing'.
Verified by parsing the file: issueRules resolves to {} — the file pins nothing.
What to do
deferTo actions (error/warn/monitor/ignore) live in Socket's Policies system (dashboard or API). socket.yml issueRules only toggles alert types on/off with boolean values.
Either:
- Use Policies API/dashboard to set actions (the real control surface), or
- Fix
socket.ymlto use booleans (true/false) if you want to explicitly enable/disable alert types in-repo — but this doesn't set block/warn actions.
projectIgnorePaths
Bob has only root package.json — outside ignored paths ✓. No docs/ directory exists (the ignore is harmless). No manifests are hidden.
tps-sherlock
left a comment
There was a problem hiding this comment.
REQUEST CHANGES — the issueRules block is silently dropped by Socket's parser, so this file does not pin the policy it claims to.
The diff adds:
issueRules:
supplyChainRisk:
deferTo: error
vulnerabilities:
deferTo: error
quality:
deferTo: warn
anomalies:
deferTo: errorSocket's socket.yml v2 schema defines issueRules as a map of issue-name → boolean (enable/disable), e.g. unresolvedRequire: false. The deferTo: error|warn shape is not part of socket.yml — it is the legacy Security Policy API's defer action, a different surface. I confirmed this empirically against Socket's own parser (@socketsecurity/config v3.0.1, current release): parsing this exact file yields issueRules: {} — the block is validated as additionalProperties: { type: 'boolean' } and non-boolean values are silently removed.
Consequence: supplyChainRisk/vulnerabilities/anomalies are NOT set to error, and quality is NOT set to warn. The repo keeps running whatever the dashboard/org policy says. The comment's claim ('OUR trust anchor… Change it here, in review — never in the dashboard alone') is false — the dashboard is currently the only control surface, and this file binds nothing.
What actually controls the per-alert-type action is the org Security Policy (now 'Policies' — baseline preset + ordered rules). That is the second control surface and, as written, the only one. Per-package accepts also live there (alert resolutions), not in this file.
To actually pin in-repo, issueRules can only boolean enable/disable individual issue slugs — it cannot express error-vs-warn severity. Severity/action is a dashboard policy concern, not a socket.yml concern. If the goal is a repo-level trust anchor, the correct mechanism is a repository label + label-scoped policy (Socket's documented replacement for issueRules), which is still dashboard-managed, not file-managed.
Other checks (pass): projectIgnorePaths — bob's only manifest is root package.json, outside the ignored paths.
…pp flags, ignore paths); drop the no-op deferTo block (Refs ops-3pdm)
tps-kern
left a comment
There was a problem hiding this comment.
Approve — delta review (round 2)
githubApp fields bind from repo-level socket.yml (verified via readSocketConfig parse + Socket docs). Header is accurate — correctly distinguishes what binds (app surfaces, ignore paths) from what doesn't (alert actions). No overstatement.
Minor: projectIgnorePaths [node_modules] is redundant (already in Socket's default ignore list). Harmless.
tps-sherlock
left a comment
There was a problem hiding this comment.
APPROVE — the file now binds only what the schema binds, and the header is accurate.
Delta check 1 (do githubApp flags bind from a repo file?): yes. Socket's socket.yml docs confirm each field is repo-level and effective: githubApp.enabled, pullRequestAlertsEnabled, projectReportsEnabled, dependencyOverviewEnabled, and ignoreUsers ('prevent Pull Request Alerts from running on Pull Requests that are opened by anyone specified'). ignoreUsers: [] binds as 'no user exempt' (the documented default). So the file is a real control for the app surfaces, not documentation-only.
Delta check 2 (overstatement): none. The header cleanly separates 'WHAT THIS FILE BINDS' from 'WHAT IT CANNOT BIND' (per-alert action), and correctly attributes action enforcement to the org Security Policy + the branch ruleset requiring the 'Socket Security: Pull Request Alerts' check — not to this file. The deferTo: silent-drop warning and the issueRules boolean-only note are both accurate.
Minor, non-blocking: enabled: true and ignoreUsers: [] restate defaults, but that's the point of pinning them explicitly.
Socket.dev repo config — what a repo file can actually bind
Nathan asked (2026-09-02) whether Socket.dev should cover every repo. It already reports here. This PR adds the repo-side config that binds:
githubApp: PR alerts, project reports and the dependency overview are enabled from the repo (theSocket Security: Pull Request Alertscheck the ruleset should require),ignoreUsers: []so no author is exempt.projectIgnorePaths:node_modulesonly.What it does not do, on purpose. The first cut of this PR carried an
issueRules: { supplyChainRisk: { deferTo: error } … }block copied fromtpsdev-ai/cli. K&S review found, and I verified with@socketsecurity/config3.0.1'sreadSocketConfig, thatissueRulesaccepts only booleans keyed by alert type; thedeferToobjects are silently dropped and the block resolves to{}. That syntax is Socket's Policies API, notsocket.yml. Per-alert actions live in the org Security Policy (dashboard, repo-label scoped) and are enforced by the branch ruleset requiring the check. cli's existing file has been a no-op since it was added; a separate PR fixes it.No dependency, code, or CI change. Follow-ups for an admin (ops-3pdm): set the org Security Policy to block on supply-chain risk / malware / anomalies; require
Socket Security: Pull Request Alertsin themainruleset.Flint-owned. Reviewed by Kern + Sherlock via TPS mail. CoS: no action needed on this PR.
No issue: repo-side Socket config; tracked in the private ops tracker as ops-3pdm, no GitHub issue exists in this repository.