From 89b2d60f345bb8e1ebd38285651b946810b0cc98 Mon Sep 17 00:00:00 2001 From: Taylor Date: Tue, 14 May 2024 08:24:49 -0500 Subject: [PATCH] creating proper velo client for agent deletion now --- .gitignore | 1 + backend/app/agents/velociraptor/services/agents.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bff2a984..2963552e 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ wheels/ *.sqbpro site/ backend/file-store/api.config.yaml +backend/data/api.config.yaml unplugin.components.d.ts package-lock.json *.checkpoint diff --git a/backend/app/agents/velociraptor/services/agents.py b/backend/app/agents/velociraptor/services/agents.py index 492c19df..700fcfd5 100644 --- a/backend/app/agents/velociraptor/services/agents.py +++ b/backend/app/agents/velociraptor/services/agents.py @@ -198,7 +198,7 @@ async def delete_client(client_id: str) -> dict: Returns: dict: A dictionary containing the result of the deletion operation. """ - universal_service = UniversalService() + universal_service = await UniversalService.create("Velociraptor") try: query = create_query( f"SELECT collect_client(client_id='server', artifacts=['Server.Utils.DeleteClient'], env=dict(ClientIdList='{client_id}',ReallyDoIt='Y')) FROM scope()", @@ -219,7 +219,7 @@ async def ensure_client_deleted(client_id: str) -> dict: Returns: dict: The result of the deletion operation. """ - universal_service = UniversalService() + universal_service = await UniversalService.create("Velociraptor") try: query = create_query( "SELECT collect_client(client_id='server', artifacts=['Server.Information.Clients'], env=dict()) FROM scope()",