Skip to content

Access groups for cracker binaries - #2500

Open
s3inlc wants to merge 6 commits into
886-stack-1-uploadfrom
886-stack-2-cracker-access-group
Open

s3inlc wants to merge 6 commits into
886-stack-1-uploadfrom
886-stack-2-cracker-access-group

Conversation

@s3inlc

@s3inlc s3inlc commented Sep 17, 2026

Copy link
Copy Markdown
Member

Adds access-group isolation for cracker binaries. Each binary now belongs to an access group, and API visibility, creation, updates, task selection, agent assignment, and downloads enforce user/agent membership. Existing binaries migrate to the default group, and binaries are reassigned there when a group is deleted.

@s3inlc
s3inlc added this pull request to stack #2501 September 17, 2026 12:36
@s3inlc
s3inlc force-pushed the 886-stack-2-cracker-access-group branch 2 times, most recently from c4f469c to a32ce4d Compare September 22, 2026 12:17
@s3inlc
s3inlc marked this pull request as ready for review September 22, 2026 12:24
@s3inlc
s3inlc requested a review from jessevz September 22, 2026 12:24
@s3inlc
s3inlc force-pushed the 886-stack-2-cracker-access-group branch 4 times, most recently from 8eca002 to 060e766 Compare September 23, 2026 09:13
@s3inlc
s3inlc force-pushed the 886-stack-2-cracker-access-group branch from 060e766 to 77b8a43 Compare September 23, 2026 09:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Critical cross-group access-control gaps remain in API expansion and legacy mutation paths, with additional assignment and coverage issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity

Open (3)
What changed in this PR

Adds access-group isolation for cracker binaries across persistence, APIs, task handling, agent downloads, and migrations.

Changes:

  • Adds and migrates accessGroupId for cracker binaries.
  • Enforces user and agent membership across binary and task workflows.
  • Updates schemas, setup data, fixtures, and tests.
File Reviewed changes Review notes
src/​migrations/​postgres/​20260917150500_cracker-access-groups.sql Adds PostgreSQL access-group migration.
src/​migrations/​mysql/​20260917150500_cracker-access-groups.sql Adds MySQL access-group migration.
src/​inc/​utils/​TaskUtils.php Restricts task selection by binary group. Moderate (1 vote): Validate or revoke stale assignments after access changes. Moderate (1 vote): Avoid the non-cached binary lookup N+1 query on the hot path.
src/​inc/​utils/​SupertaskUtils.php Checks binary access during supertask execution.
src/​inc/​utils/​PretaskUtils.php Checks binary access during pretask execution.
src/​inc/​utils/​HashlistUtils.php Selects accessible binary versions.
src/​inc/​utils/​CrackerUtils.php Validates and reassigns binary groups.
src/​inc/​utils/​CrackerBinaryUtils.php Filters newest binaries by user groups.
src/​inc/​utils/​AccessUtils.php Adds binary access checks.
src/​inc/​utils/​AccessGroupUtils.php Reassigns binaries when groups are deleted.
src/​inc/​user_api/​UserAPITask.php Passes user context to task operations.
src/​inc/​user_api/​UserAPICracker.php Assigns legacy-created binaries to the default group. Critical (2 votes): Legacy reads and mutations remain accessible across groups.
src/​inc/​startup/​setup.json Adds the default group to initial binaries.
src/​inc/​handlers/​TaskHandler.php Validates binary access during UI task creation.
src/​inc/​handlers/​SupertaskHandler.php Passes user context to supertask execution.
src/​inc/​handlers/​CrackerHandler.php Adds group context to binary creation. Critical (3 votes): Edit, delete, and type deletion paths lack group validation.
src/​inc/​downloadapi/​CrackerBinaryDownloadHandler.php Checks access before binary downloads.
src/​inc/​apiv2/​openapi/​SpecOverrides.php Documents the access-group field.
src/​inc/​apiv2/​model/​CrackerBinaryAPI.php Adds API ACLs and group relationships. Critical (1 vote): Relationship expansion can bypass binary ACLs. Moderate (1 vote): Add cross-group API coverage, including the count endpoint.
src/​inc/​apiv2/​helper/​CreateSupertaskHelperAPI.php Passes user context to supertask creation.
src/​inc/​agentapi/​model/​DownloadBinaryAction.php Checks agent membership before downloads. Moderate (1 vote): Health-check assignment or dispatch can still target agents outside the binary group.
src/​dba/​models/​generator.php Adds generated model metadata.
src/​dba/​models/​CrackerBinaryFactory.php Loads the access-group field.
src/​dba/​models/​CrackerBinary.php Stores and exposes access-group state.
openapi.json Updates generated API schemas.
ci/​phpunit/​TestBase.php Updates binary fixtures.
ci/​phpunit/​inc/​UtilTest.php Updates initial-object test data.
ci/​phpunit/​inc/​utils/​CrackerUtilsTest.php Tests group validation and reassignment.
ci/​phpunit/​inc/​utils/​CrackerBinaryUtilsTest.php Tests group-aware version selection.
ci/​phpunit/​inc/​utils/​AccessUtilsTest.php Updates agent task-access tests.
ci/​phpunit/​inc/​utils/​AccessGroupUtilsTest.php Tests reassignment on group deletion.
ci/​phpunit/​fixtures/​openapi/​crackerbinarytype.spec.json Updates API fixtures.
ci/​phpunit/​downloadapi/​DownloadAppTest.php Updates download fixtures and membership.
ci/​phpunit/​dba/​MassUpdateSetTest.php Updates binary construction.
ci/​phpunit/​dba/​AbstractModelFactoryTest.php Updates binary construction.
ci/​apiv2/​testfiles/​cracker/​create_cracker_002.json Adds required group data.
ci/​apiv2/​testfiles/​cracker/​create_cracker_001.json Adds required group data.
ci/​apiv2/​test_taskwrapper.py Updates cracker creation fixtures.
ci/​apiv2/​test_logentry.py Makes log selection resilient to pruning.
ci/​apiv2/​test_cracker.py Updates cracker creation and upload tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/inc/apiv2/model/CrackerBinaryAPI.php
Comment thread src/inc/handlers/CrackerHandler.php
Comment thread src/inc/user_api/UserAPICracker.php
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.

3 participants