Skip to content

Make @SocketSecurity ignore follow Policies - #482

Draft
Atakan Solak (mapleleafu) wants to merge 2 commits into
mainfrom
atakan/web-2599-ignore-follows-exceptions
Draft

Atakan Solak (mapleleafu) wants to merge 2 commits into
mainfrom
atakan/web-2599-ignore-follows-exceptions

Conversation

@mapleleafu

@mapleleafu Atakan Solak (mapleleafu) commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

LLM Description written by Claude Code:claude-opus-5-5

Explainer video, covering all three PRs: watch. Walkthrough: https://claude.ai/artifact/77ujJq9pxYd8DMjthjB3Y6

On an organization on the new Socket Policies, @SocketSecurity ignore and ignore-all now remove only the alerts the organization's policy lets an ignore pass. A Block the policy keeps still fails the run, and a Block it lowers to a Required Warn is reported as Warn.

Why?

On the new Policies an ignore passes only Blocks under a "Developers can skip" rule, and never below a Required rule's minimum. The CLI applies ignores itself, so today a No-exceptions or Required Block passes as soon as someone comments. The API now says per alert what an ignore leaves (actionAfterPullRequestIgnore, SocketDev/depscan#32287), and the SDK keeps it (SocketDev/socket-sdk-python#138).

Without the field, which is every organization today, results, comments, reactions and commit status are byte-identical to 2.15.8.

Merge order: release socket-sdk-python 3.7.0 first, then run uv lock here. Until then uv lock --locked and the Docker build fail on this branch.

Public Changelog

N/A


Refs WEB-2599

Details
  • Field: Issue.action_after_pull_request_ignore is set only when the API sends a non-empty string. Without it an Issue's __dict__, equality and JSON are as before. When an alert is seen more than once, the strictest value wins (Dedupe.action_rank).
  • Comments.remove_alerts:
    • error keeps the alert.
    • warn on a Block returns a Warn copy. It counts as ignored: +1, telemetry error.
    • warn on a Warn keeps it.
    • Anything else drops it.
    • ignore-all takes the same path.
  • Comment rows: a row an ignore can't remove gets kept-error, lowered-warn or kept-warn markers. They contain no @, so no ignore command in this or an older CLI matches them. kept-error and kept-warn rows show no ignore line. A cut-off table gets a matching truncation marker per kind, so ignore-all doesn't swap in "no alerts".
  • Comment-triggered run: it never removes kept rows. On GitLab with --enable-commit-status it posts no status while a kept-error or lowered-warn marker is listed, and the next pipeline run sets it. Under --disable-ignore nothing is read and the status is as today.
  • Reactions and telemetry: when the new field is in play, an ignore comment that changes nothing gets no +1 and no event, in the PR run and in the comment-triggered run.
  • Tests: tests/core/test_action_after_pull_request_ignore.py (71 tests). It drives raw API JSON through the real SDK against a local HTTP stub and runs the real socketcli.cli(). Goldens in tests/data/comments/ are rendered by main's code: comments, reactions and telemetry for v1 payloads. 1235 passed.
  • Local end to end: against a local API with depscan#32287, with GitHub and GitLab stubs. Each of the four rule types was run with ignore, ignore-all and --strict-blocking, plus the streamed fallback, comment-triggered runs, a v1 control, and released 2.15.7 and 2.2.43. Two checkers: 93 runs plus a second pass.
  • Known limits:
    • Released CLIs on a new-Policies org still let an ignore pass. The move to the new Policies checks each workflow's Python CLI version.
    • A comment-triggered GitLab run still posts success from an empty diff when the security note is missing or for ordinary Block rows. That is as on main, for every org.

On an organization on the new Socket Policies, an ignore comment may
pass only Blocks under a "Developers can skip" rule, and never below a
Required rule's minimum. The CLI applied every ignore itself, so a
No-exceptions or Required Block passed once someone commented.

The API now sends actionAfterPullRequestIgnore on each alert. An
ignore keeps an alert with error, lowers a Block with warn to Warn,
and drops it otherwise. Comment rows the ignore can't remove carry
markers without a package, so neither this CLI nor older ones remove
them from a comment-triggered run, and on GitLab such a run sets no
commit status while a kept Block is listed. An ignore comment that
changes nothing gets no +1.

Without the field (every other organization) results, comments,
reactions and status are as before.

Refs WEB-2599

Assisted-by: Claude Code:claude-opus-5-5
Refs WEB-2599

Assisted-by: Claude Code:claude-opus-5-5
@cursor

cursor Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how PR ignores affect blocking, exit codes, SCM comments, GitLab commit status, and telemetry—security-sensitive CI behavior—though organizations without the new API field remain unchanged.

Overview
Release 2.16.0 bumps socketdev to 3.7.0 and wires PR/MR @SocketSecurity ignore handling to the API’s actionAfterPullRequestIgnore field for orgs on the new Socket Policies.

Honored ignore commands now remove only alerts the policy allows to pass. Blocks the policy keeps still fail the run and stay in reports; Blocks lowered to Warn are treated as Warn (and count as a successful ignore for exit code, +1 reactions, and telemetry). Orgs without the field behave like 2.15.8.

Security comment rows use kept-error, lowered-warn, and kept-warn markers so ignores cannot strip policy-held findings; rows that cannot be ignored no longer show ignore instructions. Comment-only runs leave those rows untouched; on GitLab with --enable-commit-status, commit status is skipped while the comment still lists kept or lowered Block rows until the next pipeline refresh. +1 reactions and ignore telemetry fire only when an ignore actually changes the comment or alert set.

Docs and changelog describe the behavior; a large integration test suite and comment goldens lock in backward compatibility and policy-aware paths.

Reviewed by Cursor Bugbot for commit 53c5fb2. Configure here.

@mapleleafu

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 53c5fb2. Configure here.

This branch had an error being deployed

1 failed deployment
socket-firewall — 53c5fb20 Deployed Dec 3, 2026 by mapleleafu via python-sfw-smoke-enterprise #728
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant