Syncing before linting with black
This commit is contained in:
@@ -24,13 +24,14 @@
|
||||
import logging
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import dotenv
|
||||
import urllib3
|
||||
|
||||
from services.API import AirlockAPIWrapper
|
||||
from services.security import getAPI
|
||||
from utils.setup import get_base_directory, setup
|
||||
from utils.TUI import run_AirlockTools
|
||||
from utils.TUI import run_Loxide
|
||||
from utils.utils import irtang
|
||||
|
||||
urllib3.disable_warnings(
|
||||
@@ -74,15 +75,16 @@ def main():
|
||||
raise
|
||||
|
||||
|
||||
api_key = getAPI(username, "AirlockTools")
|
||||
api_key = getAPI(username, "Loxide")
|
||||
if api_key is None:
|
||||
raise ValueError("API key for AirlockTools is missing.")
|
||||
raise ValueError("API key for Loxide is missing.")
|
||||
|
||||
api = AirlockAPIWrapper(
|
||||
base_url=str(os.getenv("URL")),
|
||||
api_key=api_key,
|
||||
)
|
||||
run_AirlockTools(api)
|
||||
run_Loxide(api)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
# 🛡️ Airlock Tools
|
||||
# 🛡️ Loxide
|
||||
|
||||
Python toolkit for secure, auditable, and automated airlock agent and policy management. Designed for enterprise environments, it supports advanced policy workflows, device tracking, and terminal-based interaction.
|
||||
Python/Rust/Oxide toolkit for secure, auditable, and automated airlock agent and policy management. Designed for enterprise environments, it supports advanced policy workflows, device tracking, and terminal-based interaction.
|
||||
|
||||
---
|
||||
|
||||
@@ -51,7 +51,7 @@ Python toolkit for secure, auditable, and automated airlock agent and policy man
|
||||
|
||||
## 📜 License
|
||||
|
||||
**AirlockTools** is licensed under the **GNU Affero General Public License v3.0**.
|
||||
**Loxide** is licensed under the **GNU Affero General Public License v3.0**.
|
||||
|
||||
You may copy, distribute, and modify the software under the terms of the AGPL-3.0 license.
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Dict, List
|
||||
|
||||
def pull_policy_exec_histories(self, type: List[str], checkpoint: str, policy: List[str]) -> str:
|
||||
"""Retrieve execution history logs."""
|
||||
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 1.8 MiB |
@@ -28,7 +28,6 @@ import pandas as pd
|
||||
|
||||
import airlock_libs
|
||||
from services.API import AirlockAPIWrapper
|
||||
from services.policyhandler import pullPolicyExechistories
|
||||
from utils.configmanager import get_protected_value, load_env_json
|
||||
from utils.utils import colorText, regulator
|
||||
|
||||
|
||||
@@ -177,8 +177,10 @@ def pullPolicyExechistories(
|
||||
|
||||
|
||||
def getPolicyInfo(api: AirlockAPIWrapper, policy, type, days):
|
||||
import airlock_libs
|
||||
|
||||
executionhist_policy = pd.DataFrame()
|
||||
exehist = pullPolicyExechistories(api, policy, type, days, True)
|
||||
exehist = airlock_libs.pull_policy_exec_histories(api, policy.name, str(type), days)
|
||||
if exehist is not None:
|
||||
data = json.loads(exehist)
|
||||
executionhist_policy = pd.DataFrame(data["response"]["exechistories"])
|
||||
|
||||
@@ -52,7 +52,7 @@ def load_protected_config() -> dict:
|
||||
except FileNotFoundError:
|
||||
logging.warning("⚠️ system_config.json not found. Using built-in defaults.")
|
||||
system_config = {
|
||||
"APPNAME": "AirlockTools",
|
||||
"APPNAME": "Loxide",
|
||||
"PATH_EXCLUSION_CONST": 4,
|
||||
"MIN_FILES_FOR_PATH": 4,
|
||||
"VT_THREAT_TOLERANCE": 4,
|
||||
|
||||
+6
-6
@@ -31,15 +31,15 @@ def get_base_directory() -> Path:
|
||||
system = platform.system()
|
||||
home = Path.home()
|
||||
if system == 'Windows':
|
||||
return Path(os.getenv('APPDATA', home / 'AppData' / 'Roaming')) / "AirlockTools"
|
||||
return Path(os.getenv('APPDATA', home / 'AppData' / 'Roaming')) / "Loxide"
|
||||
elif system == 'Darwin':
|
||||
return home / 'Library' / 'Application Support' / "AirlockTools"
|
||||
return home / 'Library' / 'Application Support' / "Loxide"
|
||||
else:
|
||||
return home / '.local' / 'share' / "AirlockTools"
|
||||
return home / '.local' / 'share' / "Loxide"
|
||||
|
||||
|
||||
def configure_logging(log_dir: Path, log_level: str = "DEBUG"):
|
||||
log_file = log_dir / "airlocktools.log"
|
||||
log_file = log_dir / "Loxide.log"
|
||||
|
||||
config = {
|
||||
"version": 1, # Required key for dictConfig format version
|
||||
@@ -82,7 +82,7 @@ def configure_logging(log_dir: Path, log_level: str = "DEBUG"):
|
||||
try:
|
||||
config["handlers"]["eventlog"] = {
|
||||
"class": "logging.handlers.NTEventLogHandler",
|
||||
"appname": "AirlockTools", # Event log source name
|
||||
"appname": "Loxide", # Event log source name
|
||||
"level": "CRITICAL", # Only log critical errors
|
||||
"formatter": "simple", # Use simple format
|
||||
}
|
||||
@@ -108,7 +108,7 @@ def load_system_config() -> dict:
|
||||
except FileNotFoundError:
|
||||
logging.warning("⚠️ system_config.json not found. Using built-in defaults.")
|
||||
return {
|
||||
"APPNAME": "AirlockTools",
|
||||
"APPNAME": "Loxide",
|
||||
"LOG_LEVEL": "DEBUG",
|
||||
"PATH_EXCLUSION_CONST": 4,
|
||||
"MIN_FILES_FOR_PATH": 4,
|
||||
|
||||
+4
-4
@@ -366,7 +366,7 @@ class MainMenuScreen(Screen):
|
||||
# ---------------------------------------------------------------------------
|
||||
# 2) APP
|
||||
# ---------------------------------------------------------------------------
|
||||
class AirlockTools(App):
|
||||
class Loxide(App):
|
||||
CSS = """
|
||||
#logo {
|
||||
width: 100%;
|
||||
@@ -447,7 +447,7 @@ def _run_legacy_job(func, args, kwargs) -> None:
|
||||
# ---------------------------------------------------------------------------
|
||||
# 4) PUBLIC ENTRYPOINT
|
||||
# ---------------------------------------------------------------------------
|
||||
def run_AirlockTools(api: AirlockAPIWrapper) -> None:
|
||||
def run_Loxide(api: AirlockAPIWrapper) -> None:
|
||||
global _PENDING_JOB
|
||||
|
||||
while True:
|
||||
@@ -456,7 +456,7 @@ def run_AirlockTools(api: AirlockAPIWrapper) -> None:
|
||||
dotenv.load_dotenv(dotenv_path=env_path, override=True)
|
||||
|
||||
_PENDING_JOB = None
|
||||
app = AirlockTools(api)
|
||||
app = Loxide(api)
|
||||
|
||||
try:
|
||||
app.run()
|
||||
@@ -486,4 +486,4 @@ def run_AirlockTools(api: AirlockAPIWrapper) -> None:
|
||||
# ---------------------------------------------------------------------------
|
||||
if __name__ == "__main__":
|
||||
api = AirlockAPIWrapper()
|
||||
run_AirlockTools(api)
|
||||
run_Loxide(api)
|
||||
|
||||
Reference in New Issue
Block a user