/*
* ThreadPilot - Advanced Windows Process and Power Plan Manager
* Copyright (C) 2025 Prime Build
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 only.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
namespace ThreadPilot.Services
{
using System.Diagnostics;
///
/// Service for security validation and auditing of elevated operations.
///
public interface ISecurityService
{
///
/// Validates that the specified operation is allowed to be performed with elevated privileges.
///
/// The operation to validate.
/// True if the operation is allowed, false otherwise.
bool ValidateElevatedOperation(string operation);
///
/// Audits an elevated action for security logging.
///
/// The action that was performed.
/// The target of the action (process name, power plan, etc.)
/// Whether the action was successful.
Task AuditElevatedAction(string action, string target, bool success);
///
/// Validates that a process operation is safe to perform.
///
/// The name of the process.
/// The operation to perform.
/// True if the operation is safe, false otherwise.
bool ValidateProcessOperation(string processName, string operation);
///
/// Validates that a power plan operation is safe to perform.
///
/// The power plan GUID.
/// The operation to perform.
/// True if the operation is safe, false otherwise.
bool ValidatePowerPlanOperation(string powerPlanId, string operation);
///
/// Gets the list of allowed elevated operations.
///
/// Array of allowed operation names.
string[] GetAllowedElevatedOperations();
///
/// Determines whether a process is protected and should be excluded from optimization operations.
///
/// Target process.
/// True if process is protected; otherwise false.
bool IsProtected(Process process);
}
}