[backend] feat(service-account): implement the new token in the lifecycle of the agent and implant, and clean up the previous usage. (#5768)#5882
Open
EvaE-Filigran wants to merge 53 commits into
Conversation
… service account.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ycle of the agent and implant, and clean up the previous usage.
Contributor
Author
|
The tests will be added. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… user service account.
…nto issue/chunk_2_service_account
…tion on existing role.
…delete on group, role and user. Using reserved name: email regex (user) and name (group and role).
# Conflicts: # openaev-api/src/main/java/io/openaev/opencti/connectors/service/PrivilegeService.java # openaev-api/src/main/java/io/openaev/service/RoleService.java
…roup id and tenantId
…unk_3_service_account
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 12 comments.
Comments suppressed due to low confidence (1)
openaev-api/src/main/java/io/openaev/service/TenantGroupService.java:126
- issue (blocking):
updateGroupRolesresolves roles viaroleService.findById(id)which is not tenant-scoped. A caller can provide a role ID from another tenant and (if it exists) associate it to a group in the current tenant, risking cross-tenant privilege leakage. Use the tenant-scoped lookup (findByIdInTenant) instead.
List<Role> roles =
input.getRoleIds().stream()
.map(
id ->
roleService
… this case. Datapack should be able to update role.
…update and delete user service from player api.
…, following the usage of id fix for each role and group by tenant.
…ce_account # Conflicts: # openaev-api/src/main/java/io/openaev/service/RoleService.java
… this case. Datapack should be able to update role.
…he player to delete does not exist, replace ReservedName with ReservedKey by id (group and role tests)
…ce_account # Conflicts: # openaev-api/src/test/java/io/openaev/rest/role/TenantRoleReservedNameApiTest.java
…dNameApiTest to TenantGroupReservedKeyApiTest
Member
|
Test 🆗 |
…_account # Conflicts: # openaev-api/src/main/java/io/openaev/service/account/ServiceAccountPrivilegeService.java # openaev-api/src/test/java/io/openaev/datapack/packs/V20260518_Service_AccountTest.java # openaev-api/src/test/java/io/openaev/service/account/ServiceAccountPrivilegeServiceTest.java
RomuDeuxfois
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Backend
getTokenUserServiceAccountByTenant()toServiceAccountPrivilegeService— resolves the service account token for a given tenant, throwing if the account is missing or has an unexpected token countgetUserServiceAccountByTenant()to only return a user that has exactly one token (guards against partially-provisioned accounts)ServiceAccountPrivilegeServiceintoOpenAEVExecutorContextService,OpenAEVExecutorIntegration, andOpenAEVExecutorIntegrationFactoryso that executor command generation uses the tenant-scoped service token instead of the global admin tokenExecutorApiagent installer endpoint:{token}path variable — the token is now resolved server-side from the service accountTokenRepositorydependency withServiceAccountPrivilegeServiceExecutorHelper.replaceArgs(..., token)(markedtodo remove) to support the transition period while all executors are migrated off the admin tokenOpenaevImplantCommandBuilder.CommandVarswith the sametodo removeannotationFrontend
userTokenprop andMeTokensHelperusage fromAgents.tsxandInstructionSelector.tsx— the token is no longer passed through the UIbuildInstallationUrl()to drop the token segment from the installer URL path (/session-user/{token}→/session-user)MeTokensHelperinterface fromhelper.d.tsmeTokensdispatch callTesting Instructions
Related issues
Checklist