From a02c7f1d3a796575617bd3edc3f1acdbed5fb745 Mon Sep 17 00:00:00 2001
From: vakarisz <vakarisz@yahoo.com>
Date: Tue, 11 Jun 2024 15:40:17 +0300
Subject: [PATCH] Add build_permission_change_command to
 ILinuxAgentCommandBuilder

---
 agentpluginapi/i_linux_agent_command_builder.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/agentpluginapi/i_linux_agent_command_builder.py b/agentpluginapi/i_linux_agent_command_builder.py
index ece057a..dfd5a94 100644
--- a/agentpluginapi/i_linux_agent_command_builder.py
+++ b/agentpluginapi/i_linux_agent_command_builder.py
@@ -4,7 +4,7 @@
 from typing import Optional
 
 from monkeytypes import InfectionMonkeyBaseModel
-from pydantic import model_validator
+from pydantic import model_validator, Field
 
 from .dropper_execution_mode import DropperExecutionMode
 
@@ -20,6 +20,11 @@ class LinuxDownloadOptions(InfectionMonkeyBaseModel):
     download_url: str
 
 
+class LinuxPermissionChangeOptions(InfectionMonkeyBaseModel):
+    file_path: PurePosixPath
+    permissions: int = Field(ge=0, le=777, default=700)
+
+
 class LinuxRunOptions(InfectionMonkeyBaseModel):
     agent_destination_path: PurePosixPath
     dropper_execution_mode: DropperExecutionMode
@@ -47,6 +52,15 @@ def build_download_command(self, download_options: LinuxDownloadOptions):
         :param download_options: Options needed for the command to be built
         """
 
+    @abc.abstractmethod
+    def build_permission_change_command(self,
+                                        permission_change_options: LinuxPermissionChangeOptions):
+        """
+        Build Agent's binary permission change command
+
+        :param permission_change_options: Options needed for the command to be built
+        """
+
     @abc.abstractmethod
     def build_run_command(self, run_options: LinuxRunOptions):
         """