-
Hey, i have a question regarding calling server Artifacts from APIclients. Objetive:
Issue: collect_client for server requires high privs (SERVER_ADMIN) (for obvious reason) Question: Context: For this i wrote a small Server Artifact called SELECT label(client_id=client_id, labels="label", operation="set") FROM clients() On the API side. /* does not work because of missing SERVER_ADMIN privs */
LET collection <= collect_client(client_id='server',artifacts='Test.LabelClients',env=dict())
/* does work */
SELECT label(client_id=client_id, labels="label", operation="set") FROM clients() Related Links: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Scheduling a server artifact requires the SERVER_ADMIN permission (I think it should be COLLECT_SERVER actually). From an API user you can just call the artifact using the So this basically reuses the VQL query in the artifact - no need to copy it out. The only issue is that the query will run with the ACL of the API user. Which means if you want to do a privileged operation (like collect new artifacts etc) you need to give the API user the relevant permissions. For this reason there is actually not a lot of difference in giving collect_server permissions to an API user. The user can schedule new server side collections, but they are running with the User's ACLs which is the same as what the user can do over the api anyway. In newer versions of Velociraptor we have the impersonation mechanism https://docs.velociraptor.app/blog/2024/2024-09-10-release-notes-0.73/#enable-a-server-artifact-to-specify-an-impersonation-user This allows a user which can already collect an artifact, to impersonate another user (like SUID basically) and therefore get higher privileges. |
Beta Was this translation helpful? Give feedback.
Scheduling a server artifact requires the SERVER_ADMIN permission (I think it should be COLLECT_SERVER actually). From an API user you can just call the artifact using the
SELECT * FROM Artifact.XX.YY.ZZ()
format. This is almost the same as scheduling it but the results are not stored on the server but are streamed over the API.So this basically reuses the VQL query in the artifact - no need to copy it out. The only issue is that the query will run with the ACL of the API user. Which means if you want to do a privileged operation (like collect new artifacts etc) you need to give the API user the relevant permissions.
For this reason there is actually not a lot of difference in giving col…