Skip to content

ci: add security scanning workflow (pip-audit + trivy) - #16

Merged
dvcdsys merged 2 commits into
mainfrom
claude/audit-supply-chain-d8oCU
Mar 25, 2026
Merged

ci: add security scanning workflow (pip-audit + trivy)#16
dvcdsys merged 2 commits into
mainfrom
claude/audit-supply-chain-d8oCU

Conversation

@dvcdsys

@dvcdsys dvcdsys commented Mar 25, 2026

Copy link
Copy Markdown
Owner

What

Why

How

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • CI / infra

Checklist

  • Tested against a running API server
  • go vet ./... passes (CLI changes)
  • pytest tests/ passes (API changes)
  • No secrets or API keys committed

claude added 2 commits March 25, 2026 10:48
Adds a dedicated security.yml workflow that runs on every PR, push to
main, and weekly (Monday 06:00 UTC). pip-audit audits Python deps via
PyPI Advisory DB; trivy scans filesystem for vulns and secrets with
SARIF upload to GitHub Security tab.

Motivated by the LiteLLM 1.82.8 supply chain attack (2026-03-24).

https://claude.ai/code/session_01NfCfV7ZWBHQDeKUKGkrvWZ
GitHub Secret Scanning is already enabled on the repo, so trivy's
secret scanner is redundant. Keep trivy only for vuln scanning as a
second opinion alongside Dependabot (uses different OSV-based DBs).

https://claude.ai/code/session_01NfCfV7ZWBHQDeKUKGkrvWZ
@dvcdsys
dvcdsys merged commit 5d9c1d5 into main Mar 25, 2026
3 of 5 checks passed
@dvcdsys
dvcdsys deleted the claude/audit-supply-chain-d8oCU branch March 25, 2026 10:53
dvcdsys added a commit that referenced this pull request May 14, 2026
…projects

Two related correctness fixes:

1. POST /git-repos was not transactional — a failed gitrepos insert
   (e.g. UNIQUE violation under concurrent posts) left an orphan
   projects row in 'pending' that the dashboard couldn't surface for
   cleanup. The handler now tracks whether it created the project
   row and runs a compensating DeleteByHash on gitrepos failure.
   TestAddGitRepo_ConcurrentDuplicate_NoOrphan asserts the
   invariant: SELECT COUNT(*) FROM projects WHERE host_path = ?
   == 1 after two parallel posts.

2. workspaceprojects.Link checked precondition + did INSERT in two
   separate queries — race window where the project could be deleted
   between the SELECT and INSERT surfaced as a 500 instead of 404.
   Rewritten as a single INSERT ... SELECT ... WHERE EXISTS, with a
   follow-up diagnostic SELECT when RowsAffected == 0 to return the
   right 404/422 reason.

3. TestDeleteProject_CascadesGitRepoAndMembership now explicitly
   asserts SELECT COUNT(*) FROM workspace_projects WHERE
   project_path = ? == 0 (instead of relying on UNIQUE-retry
   inference).

Resolves Fix #5, #6, #15, #16.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
dvcdsys added a commit that referenced this pull request May 14, 2026
…projects

Two related correctness fixes:

1. POST /git-repos was not transactional — a failed gitrepos insert
   (e.g. UNIQUE violation under concurrent posts) left an orphan
   projects row in 'pending' that the dashboard couldn't surface for
   cleanup. The handler now tracks whether it created the project
   row and runs a compensating DeleteByHash on gitrepos failure.
   TestAddGitRepo_ConcurrentDuplicate_NoOrphan asserts the
   invariant: SELECT COUNT(*) FROM projects WHERE host_path = ?
   == 1 after two parallel posts.

2. workspaceprojects.Link checked precondition + did INSERT in two
   separate queries — race window where the project could be deleted
   between the SELECT and INSERT surfaced as a 500 instead of 404.
   Rewritten as a single INSERT ... SELECT ... WHERE EXISTS, with a
   follow-up diagnostic SELECT when RowsAffected == 0 to return the
   right 404/422 reason.

3. TestDeleteProject_CascadesGitRepoAndMembership now explicitly
   asserts SELECT COUNT(*) FROM workspace_projects WHERE
   project_path = ? == 0 (instead of relying on UNIQUE-retry
   inference).

Resolves Fix #5, #6, #15, #16.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants