diff --git a/.hypothesis/constants/0ddcef3521551894 b/.hypothesis/constants/0ddcef3521551894 new file mode 100644 index 0000000..25e79e5 --- /dev/null +++ b/.hypothesis/constants/0ddcef3521551894 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/env.py +# hypothesis_version: 6.151.11 + +['.env', '.env.local', '0.0.0.0', '8000', '8080', 'DECNET_ADMIN_USER', 'DECNET_API_HOST', 'DECNET_API_PORT', 'DECNET_DEVELOPER', 'DECNET_JWT_SECRET', 'DECNET_WEB_HOST', 'DECNET_WEB_PORT', 'False', 'admin', 'true'] \ No newline at end of file diff --git a/.hypothesis/constants/2615c511fb910a77 b/.hypothesis/constants/2615c511fb910a77 new file mode 100644 index 0000000..3e4530d --- /dev/null +++ b/.hypothesis/constants/2615c511fb910a77 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[' AND ', ' WHERE ', ':', 'BEGIN IMMEDIATE', 'COMMIT', 'ROLLBACK', '[^a-zA-Z0-9_]', 'active_deckies', 'admin', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/2db3d63e8d96a289 b/.hypothesis/constants/2db3d63e8d96a289 new file mode 100644 index 0000000..caadac3 --- /dev/null +++ b/.hypothesis/constants/2db3d63e8d96a289 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/deployer.py +# hypothesis_version: 6.151.11 + +[5.0, ', ', '--build', '--no-cache', '--watch', '-d', '-f', 'DECNET Deckies', 'Decky', 'Deployed Deckies', 'Hostname', 'IP', 'IPvlan', 'IPvlan L2', 'MACVLAN', 'Services', 'Status', '[green]up[/]', '[red]degraded[/]', 'absent', 'bold', 'build', 'cmdline', 'compose', 'decnet-compose.yml', 'decnet.cli', 'decnet.web.api:app', 'docker', 'down', 'green', 'manifest for', 'manifest unknown', 'mutate', 'name', 'not found', 'pid', 'pull access denied', 'red', 'rm', 'running', 'stop', 'up', 'uvicorn'] \ No newline at end of file diff --git a/.hypothesis/constants/4cd7a4f95d87415b b/.hypothesis/constants/4cd7a4f95d87415b new file mode 100644 index 0000000..ace2d77 --- /dev/null +++ b/.hypothesis/constants/4cd7a4f95d87415b @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/api.py +# hypothesis_version: 6.151.11 + +[0.5, 400, 404, 500, 512, 1000, 1024, '*', '/api/v1/auth/login', '/api/v1/bounty', '/api/v1/deckies', '/api/v1/logs', '/api/v1/stats', '/api/v1/stream', '/docs', '/openapi.json', '/redoc', '1.0.0', 'Authentication', 'Authorization', 'Bearer', 'Bearer ', 'Bounty Vault', 'Decky not found', 'Fleet Management', 'Logs', 'No active deployment', 'Observability', 'WWW-Authenticate', 'access_token', 'bearer', 'data', 'decnet.web.api', 'histogram', 'id', 'lastEventId', 'limit', 'logs', 'message', 'must_change_password', 'offset', 'password_hash', 'stats', 'text/event-stream', 'token', 'token_type', 'total', 'type', 'unihost', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/53471efd62b2da7e b/.hypothesis/constants/53471efd62b2da7e new file mode 100644 index 0000000..e6e1485 --- /dev/null +++ b/.hypothesis/constants/53471efd62b2da7e @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[0.1, ' AND ', ' WHERE ', ':', 'BEGIN IMMEDIATE', 'COMMIT', 'ROLLBACK', '[^a-zA-Z0-9_]', 'active_deckies', 'admin', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/5bbda598391e1363 b/.hypothesis/constants/5bbda598391e1363 new file mode 100644 index 0000000..3e4530d --- /dev/null +++ b/.hypothesis/constants/5bbda598391e1363 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[' AND ', ' WHERE ', ':', 'BEGIN IMMEDIATE', 'COMMIT', 'ROLLBACK', '[^a-zA-Z0-9_]', 'active_deckies', 'admin', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/8198d9c81a23f13a b/.hypothesis/constants/8198d9c81a23f13a new file mode 100644 index 0000000..4b420cf --- /dev/null +++ b/.hypothesis/constants/8198d9c81a23f13a @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[' AND ', ' WHERE ', ':', '[^a-zA-Z0-9_]', 'active_deckies', 'admin', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/8c8bf0135bf44b74 b/.hypothesis/constants/8c8bf0135bf44b74 new file mode 100644 index 0000000..3b82b7f --- /dev/null +++ b/.hypothesis/constants/8c8bf0135bf44b74 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/api.py +# hypothesis_version: 6.151.11 + +[0.5, 400, 404, 500, 512, 1000, 1024, '*', '/api/v1/auth/login', '/api/v1/bounty', '/api/v1/deckies', '/api/v1/logs', '/api/v1/stats', '/api/v1/stream', '/docs', '/openapi.json', '/redoc', '1.0.0', 'Authentication', 'Authorization', 'Bearer', 'Bearer ', 'Bounty Vault', 'Decky not found', 'Fleet Management', 'Logs', 'No active deployment', 'Observability', 'WWW-Authenticate', 'access_token', 'admin', 'bearer', 'data', 'decnet.web.api', 'histogram', 'id', 'lastEventId', 'limit', 'logs', 'message', 'must_change_password', 'offset', 'password_hash', 'role', 'stats', 'text/event-stream', 'token', 'token_type', 'total', 'type', 'unihost', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/d99450cc39d56b56 b/.hypothesis/constants/d99450cc39d56b56 new file mode 100644 index 0000000..886a15d --- /dev/null +++ b/.hypothesis/constants/d99450cc39d56b56 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[' AND ', ' WHERE ', ':', '[^a-zA-Z0-9_]', 'active_deckies', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/constants/dac5eeebbec66cb4 b/.hypothesis/constants/dac5eeebbec66cb4 new file mode 100644 index 0000000..e6e1485 --- /dev/null +++ b/.hypothesis/constants/dac5eeebbec66cb4 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[0.1, ' AND ', ' WHERE ', ':', 'BEGIN IMMEDIATE', 'COMMIT', 'ROLLBACK', '[^a-zA-Z0-9_]', 'active_deckies', 'admin', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz b/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz index 2d4ad9c..3e4e79c 100644 Binary files a/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz and b/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz differ diff --git a/decnet.db-wal b/decnet.db-wal deleted file mode 100644 index 8403139..0000000 Binary files a/decnet.db-wal and /dev/null differ diff --git a/decnet/deployer.py b/decnet/deployer.py index 0b77fde..ff5a31f 100644 --- a/decnet/deployer.py +++ b/decnet/deployer.py @@ -210,7 +210,7 @@ def status() -> None: table.add_column("Hostname") table.add_column("Status") - running = {c.name: c.status for c in client.containers.list(all=True)} + running = {c.name: c.status for c in client.containers.list(all=True, ignore_removed=True)} for decky in config.deckies: statuses = [] diff --git a/decnet/web/api.py b/decnet/web/api.py index 24fdce4..8da9320 100644 --- a/decnet/web/api.py +++ b/decnet/web/api.py @@ -1,4 +1,3 @@ -import uuid from contextlib import asynccontextmanager from datetime import timedelta from typing import Any, AsyncGenerator, Optional @@ -20,7 +19,7 @@ from decnet.web.auth import ( ) from decnet.web.sqlite_repository import SQLiteRepository from decnet.web.ingester import log_ingestion_worker -from decnet.env import DECNET_ADMIN_USER, DECNET_ADMIN_PASSWORD, DECNET_DEVELOPER +from decnet.env import DECNET_DEVELOPER import asyncio repo: SQLiteRepository = SQLiteRepository() @@ -39,22 +38,6 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: except Exception: await asyncio.sleep(0.5) - # Create default admin if no users exist - try: - _admin_user: Optional[dict[str, Any]] = await repo.get_user_by_username(DECNET_ADMIN_USER) - if not _admin_user: - await repo.create_user( - { - "uuid": str(uuid.uuid4()), - "username": DECNET_ADMIN_USER, - "password_hash": get_password_hash(DECNET_ADMIN_PASSWORD), - "role": "admin", - "must_change_password": True # nosec B105 - } - ) - except Exception: # nosec B110 - pass - # Start background ingestion task if ingestion_task is None or ingestion_task.done(): ingestion_task = asyncio.create_task(log_ingestion_worker(repo)) diff --git a/decnet/web/sqlite_repository.py b/decnet/web/sqlite_repository.py index e01328b..cfcc087 100644 --- a/decnet/web/sqlite_repository.py +++ b/decnet/web/sqlite_repository.py @@ -1,4 +1,5 @@ import aiosqlite +import asyncio from typing import Any, Optional from decnet.web.repository import BaseRepository from decnet.config import load_state, _ROOT @@ -9,46 +10,85 @@ class SQLiteRepository(BaseRepository): def __init__(self, db_path: str = str(_ROOT / "decnet.db")) -> None: self.db_path: str = db_path + self._initialize_sync() - async def initialize(self) -> None: + def _initialize_sync(self) -> None: """Initialize the database schema synchronously to ensure reliability.""" import sqlite3 - with sqlite3.connect(self.db_path) as _conn: + import uuid + import os + from decnet.env import DECNET_ADMIN_USER, DECNET_ADMIN_PASSWORD + from decnet.web.auth import get_password_hash + + # Ensure directory exists + os.makedirs(os.path.dirname(os.path.abspath(self.db_path)), exist_ok=True) + + with sqlite3.connect(self.db_path, isolation_level=None) as _conn: _conn.execute("PRAGMA journal_mode=WAL") - _conn.execute(""" - CREATE TABLE IF NOT EXISTS logs ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, - decky TEXT, - service TEXT, - event_type TEXT, - attacker_ip TEXT, - raw_line TEXT, - fields TEXT, - msg TEXT - ) - """) - _conn.execute(""" - CREATE TABLE IF NOT EXISTS users ( - uuid TEXT PRIMARY KEY, - username TEXT UNIQUE, - password_hash TEXT, - role TEXT DEFAULT 'viewer', - must_change_password BOOLEAN DEFAULT 0 - ) - """) - _conn.execute(""" - CREATE TABLE IF NOT EXISTS bounty ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, - decky TEXT, - service TEXT, - attacker_ip TEXT, - bounty_type TEXT, - payload TEXT - ) - """) - _conn.commit() + _conn.execute("PRAGMA synchronous=NORMAL") + + _conn.execute("BEGIN IMMEDIATE") + try: + _conn.execute(""" + CREATE TABLE IF NOT EXISTS logs ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, + decky TEXT, + service TEXT, + event_type TEXT, + attacker_ip TEXT, + raw_line TEXT, + fields TEXT, + msg TEXT + ) + """) + _conn.execute(""" + CREATE TABLE IF NOT EXISTS users ( + uuid TEXT PRIMARY KEY, + username TEXT UNIQUE, + password_hash TEXT, + role TEXT DEFAULT 'viewer', + must_change_password BOOLEAN DEFAULT 0 + ) + """) + _conn.execute(""" + CREATE TABLE IF NOT EXISTS bounty ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, + decky TEXT, + service TEXT, + attacker_ip TEXT, + bounty_type TEXT, + payload TEXT + ) + """) + + # Ensure admin exists + _cursor = _conn.execute("SELECT uuid FROM users WHERE username = ?", (DECNET_ADMIN_USER,)) + if not _cursor.fetchone(): + _conn.execute( + "INSERT INTO users (uuid, username, password_hash, role, must_change_password) VALUES (?, ?, ?, ?, ?)", + (str(uuid.uuid4()), DECNET_ADMIN_USER, get_password_hash(DECNET_ADMIN_PASSWORD), "admin", 1) + ) + _conn.execute("COMMIT") + except Exception: + _conn.execute("ROLLBACK") + raise + + async def initialize(self) -> None: + """Initialize the database schema and verify it exists.""" + # Schema already initialized in __init__ via _initialize_sync + # But we do a synchronous 'warm up' query here to ensure the file is ready for async threads + import sqlite3 + with sqlite3.connect(self.db_path) as _conn: + _conn.execute("SELECT count(*) FROM users") + _conn.execute("SELECT count(*) FROM logs") + _conn.execute("SELECT count(*) FROM bounty") + pass + + def reinitialize(self) -> None: + """Force a re-initialization of the schema (useful for tests).""" + self._initialize_sync() async def add_log(self, log_data: dict[str, Any]) -> None: async with aiosqlite.connect(self.db_path) as _db: @@ -273,11 +313,16 @@ class SQLiteRepository(BaseRepository): return _deckies async def get_user_by_username(self, username: str) -> Optional[dict[str, Any]]: - async with aiosqlite.connect(self.db_path) as _db: - _db.row_factory = aiosqlite.Row - async with _db.execute("SELECT * FROM users WHERE username = ?", (username,)) as _cursor: - _row: Optional[aiosqlite.Row] = await _cursor.fetchone() - return dict(_row) if _row else None + for _ in range(3): + try: + async with aiosqlite.connect(self.db_path) as _db: + _db.row_factory = aiosqlite.Row + async with _db.execute("SELECT * FROM users WHERE username = ?", (username,)) as _cursor: + _row = await _cursor.fetchone() + return dict(_row) if _row else None + except aiosqlite.OperationalError: + await asyncio.sleep(0.1) + return None async def get_user_by_uuid(self, uuid: str) -> Optional[dict[str, Any]]: async with aiosqlite.connect(self.db_path) as _db: diff --git a/development/DEVELOPMENT.md b/development/DEVELOPMENT.md index 6e4362e..14929d8 100644 --- a/development/DEVELOPMENT.md +++ b/development/DEVELOPMENT.md @@ -1,5 +1,48 @@ # DECNET Development Roadmap +## 🛠️ Service Realism & Interaction (First Release Path) +*Goal: Ensure every service is interactive enough to feel real during manual exploration.* + +### Remote Access & Shells +- [ ] **SSH (Cowrie)** — Custom filesystem, realistic user database, and command execution. +- [ ] **Telnet (Cowrie)** — Realistic banner and command emulation. +- [ ] **RDP** — Realistic NLA authentication and screen capture (where possible). +- [ ] **VNC** — Realistic RFB protocol handshake and authentication. +- [ ] **Real SSH** — Pass-through or high-interaction proxying. + +### Databases +- [ ] **MySQL** — Support for common SQL queries and realistic schema. +- [ ] **Postgres** — Realistic version strings and basic query support. +- [ ] **MSSQL** — Realistic TDS protocol handshake. +- [ ] **MongoDB** — Support for common Mongo wire protocol commands. +- [ ] **Redis** — Support for basic GET/SET/INFO commands. +- [ ] **Elasticsearch** — Realistic REST API responses for `/_cluster/health` etc. + +### Web & APIs +- [ ] **HTTP** — Flexible templates (WordPress, phpMyAdmin, etc.) with logging. +- [ ] **Docker API** — Realistic responses for `docker version` and `docker ps`. +- [ ] **Kubernetes (K8s)** — Mocked kubectl responses and basic API exploration. + +### File Transfer & Storage +- [ ] **SMB** — Realistic share discovery and basic file browsing. +- [ ] **FTP** — Support for common FTP commands and directory listing. +- [ ] **TFTP** — Basic block-based file transfer emulation. + +### Directory & Mail +- [ ] **LDAP** — Basic directory search and authentication responses. +- [ ] **SMTP** — Mail server banners and basic EHLO/MAIL FROM support. +- [ ] **IMAP** — Realistic mail folder structure and auth. +- [ ] **POP3** — Basic mail retrieval protocol emulation. + +### Industrial & IoT (ICS) +- [ ] **MQTT** — Basic topic subscription and publishing support. +- [ ] **SNMP** — Realistic MIB responses for common OIDs. +- [ ] **SIP** — Basic VoIP protocol handshake and registration. +- [ ] **LLMNR** — Realistic local name resolution responses. +- [ ] **Conpot** — SCADA/ICS protocol emulation (Modbus, etc.). + +--- + ## Core / Hardening - [ ] **Attacker fingerprinting** — Capture TLS JA3/JA4 hashes, TCP window sizes, User-Agent strings, and SSH client banners. diff --git a/decnet.db-shm b/test_bounty_decnet.db-shm similarity index 89% rename from decnet.db-shm rename to test_bounty_decnet.db-shm index c165d5a..ec95b1b 100644 Binary files a/decnet.db-shm and b/test_bounty_decnet.db-shm differ diff --git a/test_bounty_decnet.db-wal b/test_bounty_decnet.db-wal new file mode 100644 index 0000000..e1b3655 Binary files /dev/null and b/test_bounty_decnet.db-wal differ diff --git a/test_decnet.db-shm b/test_decnet.db-shm index cb6f416..959a325 100644 Binary files a/test_decnet.db-shm and b/test_decnet.db-shm differ diff --git a/test_decnet.db-wal b/test_decnet.db-wal index 532c4f9..e80088b 100644 Binary files a/test_decnet.db-wal and b/test_decnet.db-wal differ diff --git a/test_fleet_decnet.db-shm b/test_fleet_decnet.db-shm new file mode 100644 index 0000000..4ec275e Binary files /dev/null and b/test_fleet_decnet.db-shm differ diff --git a/test_fleet_decnet.db-wal b/test_fleet_decnet.db-wal new file mode 100644 index 0000000..de50df4 Binary files /dev/null and b/test_fleet_decnet.db-wal differ diff --git a/test_fuzz_decnet.db-shm b/test_fuzz_decnet.db-shm index b8e8535..1bd4ed6 100644 Binary files a/test_fuzz_decnet.db-shm and b/test_fuzz_decnet.db-shm differ diff --git a/test_fuzz_decnet.db-wal b/test_fuzz_decnet.db-wal index 77dac69..4ceeba4 100644 Binary files a/test_fuzz_decnet.db-wal and b/test_fuzz_decnet.db-wal differ diff --git a/tests/.hypothesis/constants/071376f7808c803b b/tests/.hypothesis/constants/071376f7808c803b new file mode 100644 index 0000000..2f6bf44 --- /dev/null +++ b/tests/.hypothesis/constants/071376f7808c803b @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/cli.py +# hypothesis_version: 6.151.11 + +[8000, ',', ', ', '--all', '--api', '--api-port', '--archetype', '--config', '--deckies', '--decky', '--distro', '--dry-run', '--emit-syslog', '--host', '--id', '--interface', '--ip-start', '--ipvlan', '--log-file', '--log-target', '--min-deckies', '--mode', '--mutate-interval', '--no-cache', '--output', '--port', '--randomize-distros', '--randomize-services', '--services', '--subnet', '--watch', '--web-port', '-a', '-c', '-d', '-f', '-i', '-m', '-n', '-o', '-w', '/index.html', 'Available Services', 'Default Services', 'Description', 'Display Name', 'Docker Image', 'Image', 'Machine Archetypes', 'Name', 'Ports', 'Slug', 'archetypes', 'bold cyan', 'correlate', 'decnet', 'decnet.cli', 'decnet.log', 'decnet.web.api:app', 'decnet_web', 'dim', 'dist', 'distros', 'green', 'json', 'linux', 'mutate', 'services', 'swarm', 'syslog', 'table', 'unihost', 'uvicorn', 'web'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/0ba82ca4ea63f3bc b/tests/.hypothesis/constants/0ba82ca4ea63f3bc new file mode 100644 index 0000000..b7a563c --- /dev/null +++ b/tests/.hypothesis/constants/0ba82ca4ea63f3bc @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/.venv/bin/pytest +# hypothesis_version: 6.151.12 + +['__main__'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/0ddcef3521551894 b/tests/.hypothesis/constants/0ddcef3521551894 new file mode 100644 index 0000000..25e79e5 --- /dev/null +++ b/tests/.hypothesis/constants/0ddcef3521551894 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/env.py +# hypothesis_version: 6.151.11 + +['.env', '.env.local', '0.0.0.0', '8000', '8080', 'DECNET_ADMIN_USER', 'DECNET_API_HOST', 'DECNET_API_PORT', 'DECNET_DEVELOPER', 'DECNET_JWT_SECRET', 'DECNET_WEB_HOST', 'DECNET_WEB_PORT', 'False', 'admin', 'true'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/15d50d1e53b9b5c3 b/tests/.hypothesis/constants/15d50d1e53b9b5c3 new file mode 100644 index 0000000..ac4f157 --- /dev/null +++ b/tests/.hypothesis/constants/15d50d1e53b9b5c3 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/tftp.py +# hypothesis_version: 6.151.12 + +['LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'restart', 'templates', 'tftp', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/1f005a833d034313 b/tests/.hypothesis/constants/1f005a833d034313 new file mode 100644 index 0000000..5c6b47c --- /dev/null +++ b/tests/.hypothesis/constants/1f005a833d034313 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/logging/forwarder.py +# hypothesis_version: 6.151.12 + +[2.0, ':'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/1f12b014d4fe2068 b/tests/.hypothesis/constants/1f12b014d4fe2068 new file mode 100644 index 0000000..177de92 --- /dev/null +++ b/tests/.hypothesis/constants/1f12b014d4fe2068 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/mongodb.py +# hypothesis_version: 6.151.12 + +[27017, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'mongodb', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/2220ccbe8a25f02d b/tests/.hypothesis/constants/2220ccbe8a25f02d new file mode 100644 index 0000000..5a64088 --- /dev/null +++ b/tests/.hypothesis/constants/2220ccbe8a25f02d @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/snmp.py +# hypothesis_version: 6.151.12 + +[161, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'restart', 'snmp', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/2db3d63e8d96a289 b/tests/.hypothesis/constants/2db3d63e8d96a289 new file mode 100644 index 0000000..0b1c8a9 --- /dev/null +++ b/tests/.hypothesis/constants/2db3d63e8d96a289 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/deployer.py +# hypothesis_version: 6.151.12 + +[5.0, ', ', '--build', '--no-cache', '--watch', '-d', '-f', 'DECNET Deckies', 'Decky', 'Deployed Deckies', 'Hostname', 'IP', 'IPvlan', 'IPvlan L2', 'MACVLAN', 'Services', 'Status', '[green]up[/]', '[red]degraded[/]', 'absent', 'bold', 'build', 'cmdline', 'compose', 'decnet-compose.yml', 'decnet.cli', 'decnet.web.api:app', 'docker', 'down', 'green', 'manifest for', 'manifest unknown', 'mutate', 'name', 'not found', 'pid', 'pull access denied', 'red', 'rm', 'running', 'stop', 'up', 'uvicorn'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/2f0b53ebdb35c4e1 b/tests/.hypothesis/constants/2f0b53ebdb35c4e1 new file mode 100644 index 0000000..0596e50 --- /dev/null +++ b/tests/.hypothesis/constants/2f0b53ebdb35c4e1 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/sip.py +# hypothesis_version: 6.151.12 + +[5060, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'restart', 'sip', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/30a7ffe86227f7f1 b/tests/.hypothesis/constants/30a7ffe86227f7f1 new file mode 100644 index 0000000..fa8fcbe --- /dev/null +++ b/tests/.hypothesis/constants/30a7ffe86227f7f1 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/mssql.py +# hypothesis_version: 6.151.12 + +[1433, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'mssql', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/349ec22a74b50191 b/tests/.hypothesis/constants/349ec22a74b50191 new file mode 100644 index 0000000..8399e32 --- /dev/null +++ b/tests/.hypothesis/constants/349ec22a74b50191 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/composer.py +# hypothesis_version: 6.151.11 + +['/var/log/decnet', '3.8', 'BASE_IMAGE', 'DECNET_LOG_FILE', 'HOSTNAME', 'NET_ADMIN', 'args', 'bridge', 'build', 'cap_add', 'command', 'container_name', 'decnet_logs', 'depends_on', 'driver', 'environment', 'external', 'hostname', 'image', 'infinity', 'internal', 'ipv4_address', 'network_mode', 'networks', 'restart', 'services', 'sleep', 'sysctls', 'unless-stopped', 'version', 'volumes'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/37d6bf6c6c0b58e6 b/tests/.hypothesis/constants/37d6bf6c6c0b58e6 new file mode 100644 index 0000000..be031d6 --- /dev/null +++ b/tests/.hypothesis/constants/37d6bf6c6c0b58e6 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/elasticsearch.py +# hypothesis_version: 6.151.12 + +[9200, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'elasticsearch', 'environment', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/3cc47bb868bcb8f4 b/tests/.hypothesis/constants/3cc47bb868bcb8f4 new file mode 100644 index 0000000..8f6a0ca --- /dev/null +++ b/tests/.hypothesis/constants/3cc47bb868bcb8f4 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/telnet.py +# hypothesis_version: 6.151.12 + +[':', 'COWRIE_SSH_ENABLED', 'NET_BIND_SERVICE', 'cap_add', 'container_name', 'cowrie/cowrie', 'environment', 'false', 'image', 'restart', 'telnet', 'true', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/42a1dcb5c22b1ac1 b/tests/.hypothesis/constants/42a1dcb5c22b1ac1 new file mode 100644 index 0000000..3aba509 --- /dev/null +++ b/tests/.hypothesis/constants/42a1dcb5c22b1ac1 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/ini_loader.py +# hypothesis_version: 6.151.11 + +[100, 512, 1024, ',', '.', '1', '[', ']', 'amount', 'archetype', 'binary', 'custom-', 'exceeds maximum', 'exec', 'general', 'gw', 'interface', 'ip', 'log-target', 'log_target', 'mutate-interval', 'mutate_interval', 'net', 'nmap-os', 'nmap_os', 'ports', 'services'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/507a3145954fca93 b/tests/.hypothesis/constants/507a3145954fca93 new file mode 100644 index 0000000..7f18d0d --- /dev/null +++ b/tests/.hypothesis/constants/507a3145954fca93 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/http.py +# hypothesis_version: 6.151.12 + +[443, '/opt/html_files', 'CUSTOM_BODY', 'EXTRA_HEADERS', 'FAKE_APP', 'FILES_DIR', 'LOG_TARGET', 'NODE_NAME', 'RESPONSE_CODE', 'SERVER_HEADER', 'build', 'container_name', 'context', 'custom_body', 'environment', 'extra_headers', 'fake_app', 'files', 'http', 'response_code', 'restart', 'server_header', 'templates', 'unless-stopped', 'volumes'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/53a42446f9f19b20 b/tests/.hypothesis/constants/53a42446f9f19b20 new file mode 100644 index 0000000..b54bca1 --- /dev/null +++ b/tests/.hypothesis/constants/53a42446f9f19b20 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/ftp.py +# hypothesis_version: 6.151.12 + +['LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'ftp', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/574dbe54f9b23d3e b/tests/.hypothesis/constants/574dbe54f9b23d3e new file mode 100644 index 0000000..0d41063 --- /dev/null +++ b/tests/.hypothesis/constants/574dbe54f9b23d3e @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/correlation/engine.py +# hypothesis_version: 6.151.11 + +[3600, ',', 'Attacker IP', 'Deckies', 'Duration', 'Events', 'First Seen', 'Traversal Path', 'bold red', 'correlator', 'cyan', 'decnet-correlator', 'dim', 'events_indexed', 'lines_parsed', 'right', 'stats', 'traversal_detected', 'traversals', 'unique_ips', 'yellow'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/5a5554db0771f35b b/tests/.hypothesis/constants/5a5554db0771f35b new file mode 100644 index 0000000..275bac0 --- /dev/null +++ b/tests/.hypothesis/constants/5a5554db0771f35b @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/repository.py +# hypothesis_version: 6.151.11 + +[] \ No newline at end of file diff --git a/tests/.hypothesis/constants/5feefba3d1c668ca b/tests/.hypothesis/constants/5feefba3d1c668ca new file mode 100644 index 0000000..0a65034 --- /dev/null +++ b/tests/.hypothesis/constants/5feefba3d1c668ca @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/ingester.py +# hypothesis_version: 6.151.11 + +['.json', 'attacker_ip', 'bounty_type', 'credential', 'decky', 'decnet.web.ingester', 'fields', 'password', 'payload', 'r', 'replace', 'service', 'username', 'utf-8'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/62e387790ed5b79f b/tests/.hypothesis/constants/62e387790ed5b79f new file mode 100644 index 0000000..e16b095 --- /dev/null +++ b/tests/.hypothesis/constants/62e387790ed5b79f @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/vnc.py +# hypothesis_version: 6.151.12 + +[5900, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'restart', 'templates', 'unless-stopped', 'vnc'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/66bd79275cd609e8 b/tests/.hypothesis/constants/66bd79275cd609e8 new file mode 100644 index 0000000..21e2f78 --- /dev/null +++ b/tests/.hypothesis/constants/66bd79275cd609e8 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/correlation/parser.py +# hypothesis_version: 6.151.11 + +['"', '-', '\\', '\\"', '\\\\', '\\]', ']', 'client_ip', 'ip', 'remote_ip', 'src', 'src_ip'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/76302489300fdc45 b/tests/.hypothesis/constants/76302489300fdc45 new file mode 100644 index 0000000..68be2a1 --- /dev/null +++ b/tests/.hypothesis/constants/76302489300fdc45 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/config.py +# hypothesis_version: 6.151.11 + +[0.0, ':', 'compose_path', 'config', 'debian', 'debian:bookworm-slim', 'decnet-state.json', 'linux', 'log_target', 'services', 'swarm', 'unihost'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/77b4b42ea3b9c9bf b/tests/.hypothesis/constants/77b4b42ea3b9c9bf new file mode 100644 index 0000000..30a4e5c --- /dev/null +++ b/tests/.hypothesis/constants/77b4b42ea3b9c9bf @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/llmnr.py +# hypothesis_version: 6.151.12 + +[5353, 5355, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'llmnr', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/79661beef79449a5 b/tests/.hypothesis/constants/79661beef79449a5 new file mode 100644 index 0000000..427d19f --- /dev/null +++ b/tests/.hypothesis/constants/79661beef79449a5 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/registry.py +# hypothesis_version: 6.151.11 + +['base', 'decnet.services.', 'registry'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/7f9302a54093ce41 b/tests/.hypothesis/constants/7f9302a54093ce41 new file mode 100644 index 0000000..18fa665 --- /dev/null +++ b/tests/.hypothesis/constants/7f9302a54093ce41 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/correlation/__init__.py +# hypothesis_version: 6.151.11 + +['AttackerTraversal', 'CorrelationEngine', 'LogEvent', 'TraversalHop', 'parse_line'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/8029f0494746966f b/tests/.hypothesis/constants/8029f0494746966f new file mode 100644 index 0000000..13d9382 --- /dev/null +++ b/tests/.hypothesis/constants/8029f0494746966f @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/ldap.py +# hypothesis_version: 6.151.12 + +[389, 636, 'LOG_TARGET', 'NET_BIND_SERVICE', 'NODE_NAME', 'build', 'cap_add', 'container_name', 'context', 'environment', 'ldap', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/87dce71ef389d477 b/tests/.hypothesis/constants/87dce71ef389d477 new file mode 100644 index 0000000..df14e34 --- /dev/null +++ b/tests/.hypothesis/constants/87dce71ef389d477 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/mqtt.py +# hypothesis_version: 6.151.12 + +[1883, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'mqtt', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/8b9368be0f77a253 b/tests/.hypothesis/constants/8b9368be0f77a253 new file mode 100644 index 0000000..d9b1a47 --- /dev/null +++ b/tests/.hypothesis/constants/8b9368be0f77a253 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/custom_service.py +# hypothesis_version: 6.151.12 + +['-', 'LOG_TARGET', 'NODE_NAME', '_', 'command', 'container_name', 'environment', 'image', 'restart', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/8c8bf0135bf44b74 b/tests/.hypothesis/constants/8c8bf0135bf44b74 new file mode 100644 index 0000000..3b82b7f --- /dev/null +++ b/tests/.hypothesis/constants/8c8bf0135bf44b74 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/api.py +# hypothesis_version: 6.151.11 + +[0.5, 400, 404, 500, 512, 1000, 1024, '*', '/api/v1/auth/login', '/api/v1/bounty', '/api/v1/deckies', '/api/v1/logs', '/api/v1/stats', '/api/v1/stream', '/docs', '/openapi.json', '/redoc', '1.0.0', 'Authentication', 'Authorization', 'Bearer', 'Bearer ', 'Bounty Vault', 'Decky not found', 'Fleet Management', 'Logs', 'No active deployment', 'Observability', 'WWW-Authenticate', 'access_token', 'admin', 'bearer', 'data', 'decnet.web.api', 'histogram', 'id', 'lastEventId', 'limit', 'logs', 'message', 'must_change_password', 'offset', 'password_hash', 'role', 'stats', 'text/event-stream', 'token', 'token_type', 'total', 'type', 'unihost', 'username', 'uuid'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/8c9335cb8231944a b/tests/.hypothesis/constants/8c9335cb8231944a new file mode 100644 index 0000000..c0bb5ec --- /dev/null +++ b/tests/.hypothesis/constants/8c9335cb8231944a @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/docker_api.py +# hypothesis_version: 6.151.12 + +[2375, 2376, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'docker_api', 'environment', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/8e330e30c399dccc b/tests/.hypothesis/constants/8e330e30c399dccc new file mode 100644 index 0000000..cb5504a --- /dev/null +++ b/tests/.hypothesis/constants/8e330e30c399dccc @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/real_ssh.py +# hypothesis_version: 6.151.12 + +['NET_BIND_SERVICE', 'SSH_HOSTNAME', 'SSH_ROOT_PASSWORD', 'admin', 'build', 'cap_add', 'container_name', 'context', 'environment', 'hostname', 'password', 'real_ssh', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/9193e12e937c9da2 b/tests/.hypothesis/constants/9193e12e937c9da2 new file mode 100644 index 0000000..3481ac4 --- /dev/null +++ b/tests/.hypothesis/constants/9193e12e937c9da2 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/logging/syslog_formatter.py +# hypothesis_version: 6.151.11 + +[255, '"', '-', '1', '\\', '\\"', '\\\\', '\\]', ']', 'decnet@55555'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/952b61539a326753 b/tests/.hypothesis/constants/952b61539a326753 new file mode 100644 index 0000000..938b69d --- /dev/null +++ b/tests/.hypothesis/constants/952b61539a326753 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/ssh.py +# hypothesis_version: 6.151.12 + +[2222, ':', 'COWRIE_HOSTNAME', 'COWRIE_SSH_VERSION', 'NET_BIND_SERVICE', 'NODE_NAME', 'build', 'cap_add', 'container_name', 'context', 'cowrie', 'environment', 'hardware_platform', 'kernel_build_string', 'kernel_version', 'restart', 'ssh', 'ssh_banner', 'templates', 'true', 'unless-stopped', 'users'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/95eb634544ca6000 b/tests/.hypothesis/constants/95eb634544ca6000 new file mode 100644 index 0000000..2400f5d --- /dev/null +++ b/tests/.hypothesis/constants/95eb634544ca6000 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/smb.py +# hypothesis_version: 6.151.12 + +[139, 445, 'LOG_TARGET', 'NET_BIND_SERVICE', 'NODE_NAME', 'build', 'cap_add', 'container_name', 'context', 'environment', 'restart', 'smb', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/996aa9c745349122 b/tests/.hypothesis/constants/996aa9c745349122 new file mode 100644 index 0000000..5f2dc31 --- /dev/null +++ b/tests/.hypothesis/constants/996aa9c745349122 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/base.py +# hypothesis_version: 6.151.11 + +[] \ No newline at end of file diff --git a/tests/.hypothesis/constants/9f85e820bb1eb903 b/tests/.hypothesis/constants/9f85e820bb1eb903 new file mode 100644 index 0000000..a0c1c88 --- /dev/null +++ b/tests/.hypothesis/constants/9f85e820bb1eb903 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/distros.py +# hypothesis_version: 6.151.11 + +['Alpine Linux 3.19', 'Arch Linux', 'CentOS 7', 'Debian 12 (Bookworm)', 'Fedora 39', 'Kali Linux (Rolling)', 'Rocky Linux 9', 'alpha', 'alpine', 'alpine:3.19', 'arch', 'archlinux:latest', 'backup', 'bravo', 'centos7', 'centos:7', 'charlie', 'db', 'debian', 'debian:bookworm-slim', 'delta', 'dev', 'echo', 'fedora', 'fedora:39', 'files', 'foxtrot', 'generic', 'golf', 'hotel', 'india', 'juliet', 'kali', 'kilo', 'lima', 'mail', 'mike', 'minimal', 'monitor', 'nova', 'oscar', 'prod', 'proxy', 'rhel', 'rocky9', 'rockylinux:9-minimal', 'rolling', 'stage', 'ubuntu20', 'ubuntu22', 'ubuntu:20.04', 'ubuntu:22.04', 'web'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/a115dde40ee13bf8 b/tests/.hypothesis/constants/a115dde40ee13bf8 new file mode 100644 index 0000000..26d7257 --- /dev/null +++ b/tests/.hypothesis/constants/a115dde40ee13bf8 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/mysql.py +# hypothesis_version: 6.151.12 + +[3306, 'LOG_TARGET', 'MYSQL_VERSION', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'mysql', 'restart', 'templates', 'unless-stopped', 'version'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/a36433a7a8a46f4d b/tests/.hypothesis/constants/a36433a7a8a46f4d new file mode 100644 index 0000000..1d89ce3 --- /dev/null +++ b/tests/.hypothesis/constants/a36433a7a8a46f4d @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/smtp.py +# hypothesis_version: 6.151.12 + +[587, 'LOG_TARGET', 'NET_BIND_SERVICE', 'NODE_NAME', 'SMTP_BANNER', 'SMTP_MTA', 'banner', 'build', 'cap_add', 'container_name', 'context', 'environment', 'mta', 'restart', 'smtp', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/a36bdeb88e27cda2 b/tests/.hypothesis/constants/a36bdeb88e27cda2 new file mode 100644 index 0000000..be4d537 --- /dev/null +++ b/tests/.hypothesis/constants/a36bdeb88e27cda2 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/postgres.py +# hypothesis_version: 6.151.12 + +[5432, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'postgres', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/a4b0cd024dec37b3 b/tests/.hypothesis/constants/a4b0cd024dec37b3 new file mode 100644 index 0000000..c8e44e0 --- /dev/null +++ b/tests/.hypothesis/constants/a4b0cd024dec37b3 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/pop3.py +# hypothesis_version: 6.151.12 + +[110, 995, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'pop3', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/a92a9b5d6ef7fbda b/tests/.hypothesis/constants/a92a9b5d6ef7fbda new file mode 100644 index 0000000..11589ce --- /dev/null +++ b/tests/.hypothesis/constants/a92a9b5d6ef7fbda @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/os_fingerprint.py +# hypothesis_version: 6.151.11 + +['128', '2', '255', '3', '6', '64', 'bsd', 'cisco', 'embedded', 'linux', 'windows'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/ad18d933a368774b b/tests/.hypothesis/constants/ad18d933a368774b new file mode 100644 index 0000000..16932ef --- /dev/null +++ b/tests/.hypothesis/constants/ad18d933a368774b @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/archetypes.py +# hypothesis_version: 6.151.11 + +[', ', 'Database Server', 'DevOps Host', 'Domain Controller', 'File Server', 'IoT Device', 'Linux Server', 'Mail Server', 'Monitoring Node', 'Network Printer', 'VoIP Server', 'Web Server', 'Windows Server', 'Windows Workstation', 'alpine', 'conpot', 'database-server', 'deaddeck', 'debian', 'devops-host', 'docker_api', 'domain-controller', 'embedded', 'fedora', 'file-server', 'ftp', 'http', 'imap', 'industrial-control', 'iot-device', 'k8s', 'ldap', 'linux', 'linux-server', 'llmnr', 'mail-server', 'monitoring-node', 'mqtt', 'mysql', 'pop3', 'postgres', 'printer', 'rdp', 'real_ssh', 'redis', 'rocky9', 'sip', 'smb', 'smtp', 'snmp', 'ssh', 'telnet', 'ubuntu20', 'ubuntu22', 'voip-server', 'web-server', 'windows', 'windows-server', 'windows-workstation'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/b0cdd7ca461ac3a7 b/tests/.hypothesis/constants/b0cdd7ca461ac3a7 new file mode 100644 index 0000000..f37dbd3 --- /dev/null +++ b/tests/.hypothesis/constants/b0cdd7ca461ac3a7 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/k8s.py +# hypothesis_version: 6.151.12 + +[6443, 8080, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'k8s', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/b3ae76f264e289ba b/tests/.hypothesis/constants/b3ae76f264e289ba new file mode 100644 index 0000000..1fba6d8 --- /dev/null +++ b/tests/.hypothesis/constants/b3ae76f264e289ba @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/redis.py +# hypothesis_version: 6.151.12 + +[6379, 'LOG_TARGET', 'NODE_NAME', 'REDIS_OS', 'REDIS_VERSION', 'build', 'container_name', 'context', 'environment', 'os_string', 'redis', 'restart', 'templates', 'unless-stopped', 'version'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/b4fbfe7d71d1fde1 b/tests/.hypothesis/constants/b4fbfe7d71d1fde1 new file mode 100644 index 0000000..2250f94 --- /dev/null +++ b/tests/.hypothesis/constants/b4fbfe7d71d1fde1 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/correlation/graph.py +# hypothesis_version: 6.151.11 + +[' → ', 'attacker_ip', 'deckies', 'decky', 'decky_count', 'duration_seconds', 'event_type', 'first_seen', 'hop_count', 'hops', 'last_seen', 'path', 'service', 'timestamp'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/c1bae63b725863f0 b/tests/.hypothesis/constants/c1bae63b725863f0 new file mode 100644 index 0000000..34ff1c8 --- /dev/null +++ b/tests/.hypothesis/constants/c1bae63b725863f0 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/imap.py +# hypothesis_version: 6.151.12 + +[143, 993, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'imap', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/cac20128001ccd85 b/tests/.hypothesis/constants/cac20128001ccd85 new file mode 100644 index 0000000..5f7d4fe --- /dev/null +++ b/tests/.hypothesis/constants/cac20128001ccd85 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/network.py +# hypothesis_version: 6.151.11 + +['/', 'add', 'addr', 'bridge', 'decnet_ipvlan0', 'decnet_lan', 'decnet_macvlan0', 'default', 'del', 'dev', 'inet ', 'inet6', 'ip', 'ipvlan', 'ipvlan_mode', 'l2', 'link', 'macvlan', 'mode', 'parent', 'route', 'set', 'show', 'type', 'up', 'via'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/cf9d3e39a6bf6308 b/tests/.hypothesis/constants/cf9d3e39a6bf6308 new file mode 100644 index 0000000..886a15d --- /dev/null +++ b/tests/.hypothesis/constants/cf9d3e39a6bf6308 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/sqlite_repository.py +# hypothesis_version: 6.151.11 + +[' AND ', ' WHERE ', ':', '[^a-zA-Z0-9_]', 'active_deckies', 'attacker', 'attacker-ip', 'attacker_ip', 'bounty_type', 'bounty_type = ?', 'bucket_time', 'count', 'decky', 'decnet.db', 'deployed_deckies', 'event', 'event_type', 'fields', 'id > ?', 'max_id', 'msg', 'must_change_password', 'password_hash', 'payload', 'raw_line', 'role', 'service', 'time', 'timestamp', 'timestamp <= ?', 'timestamp >= ?', 'total', 'total_logs', 'unique_attackers', 'username', 'uuid'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/d479b632891acb05 b/tests/.hypothesis/constants/d479b632891acb05 new file mode 100644 index 0000000..5254387 --- /dev/null +++ b/tests/.hypothesis/constants/d479b632891acb05 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/logging/file_handler.py +# hypothesis_version: 6.151.11 + +[1024, '%(message)s', 'DECNET_LOG_FILE', 'decnet.syslog', 'utf-8'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/e04c4b026eeb7e26 b/tests/.hypothesis/constants/e04c4b026eeb7e26 new file mode 100644 index 0000000..8ec51c6 --- /dev/null +++ b/tests/.hypothesis/constants/e04c4b026eeb7e26 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/rdp.py +# hypothesis_version: 6.151.12 + +[3389, 'LOG_TARGET', 'NODE_NAME', 'build', 'container_name', 'context', 'environment', 'rdp', 'restart', 'templates', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/f9f2aace37ce402b b/tests/.hypothesis/constants/f9f2aace37ce402b new file mode 100644 index 0000000..18ba47e --- /dev/null +++ b/tests/.hypothesis/constants/f9f2aace37ce402b @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/web/auth.py +# hypothesis_version: 6.151.11 + +[1440, 'HS256', 'exp', 'iat', 'utf-8'] \ No newline at end of file diff --git a/tests/.hypothesis/constants/fb7b3bbd8bd7b0f3 b/tests/.hypothesis/constants/fb7b3bbd8bd7b0f3 new file mode 100644 index 0000000..3561039 --- /dev/null +++ b/tests/.hypothesis/constants/fb7b3bbd8bd7b0f3 @@ -0,0 +1,4 @@ +# file: /home/anti/Tools/DECNET/decnet/services/conpot.py +# hypothesis_version: 6.151.12 + +[161, 502, 'CONPOT_TEMPLATE', 'conpot', 'container_name', 'default', 'environment', 'honeynet/conpot', 'image', 'restart', 'unless-stopped'] \ No newline at end of file diff --git a/tests/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz b/tests/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz index 377d821..5cbd184 100644 Binary files a/tests/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz and b/tests/.hypothesis/unicode_data/16.0.0/codec-utf-8.json.gz differ diff --git a/tests/service_testing/service-test.txt b/tests/service_testing/service-test.txt new file mode 100644 index 0000000..3d7e982 --- /dev/null +++ b/tests/service_testing/service-test.txt @@ -0,0 +1,117 @@ +# Nmap 7.92 scan initiated Thu Apr 9 02:09:54 2026 as: nmap -sS -sV -oN service-test.txt -p- 192.168.1.200 +Nmap scan report for 192.168.1.200 +Host is up (0.0000030s latency). +Not shown: 65510 closed tcp ports (reset) +PORT STATE SERVICE VERSION +21/tcp open ftp vsftpd (before 2.0.8) or WU-FTPD +23/tcp open telnet? +25/tcp open smtp Postfix smtpd +80/tcp open http Apache httpd 2.4.54 ((Debian)) +110/tcp open pop3 +143/tcp open imap +389/tcp open ldap Cisco LDAP server +445/tcp open microsoft-ds +1433/tcp open ms-sql-s? +1883/tcp open mqtt +2121/tcp open ccproxy-ftp? +2375/tcp open docker Docker 24.0.5 +3306/tcp open mysql MySQL 5.7.38-log +3389/tcp open ms-wbt-server xrdp +5020/tcp open zenginkyo-1? +5060/tcp open sip (SIP end point; Status: 401 Unauthorized) +5432/tcp open postgresql? +5900/tcp open vnc VNC (protocol 3.8) +6379/tcp open redis? +6443/tcp open sun-sr-https? +8800/tcp open sunwebadmin? +9200/tcp open wap-wsp? +10201/tcp open rsms? +27017/tcp open mongod? +44818/tcp open EtherNetIP-2? +9 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service : +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port23-TCP:V=7.92%I=7%D=4/9%Time=69D742B9%P=x86_64-redhat-linux-gnu%r(N +SF:ULL,7,"login:\x20")%r(GenericLines,2C,"login:\x20\xff\xfb\x01Password:\ +SF:x20\nLogin\x20incorrect\nlogin:\x20")%r(tn3270,16,"login:\x20\xff\xfe\x +SF:18\xff\xfe\x19\xff\xfc\x19\xff\xfe\0\xff\xfc\0")%r(GetRequest,2C,"login +SF::\x20\xff\xfb\x01Password:\x20\nLogin\x20incorrect\nlogin:\x20")%r(HTTP +SF:Options,2C,"login:\x20\xff\xfb\x01Password:\x20\nLogin\x20incorrect\nlo +SF:gin:\x20")%r(RTSPRequest,2C,"login:\x20\xff\xfb\x01Password:\x20\nLogin +SF:\x20incorrect\nlogin:\x20")%r(RPCCheck,7,"login:\x20")%r(DNSVersionBind +SF:ReqTCP,7,"login:\x20")%r(DNSStatusRequestTCP,7,"login:\x20")%r(Help,14, +SF:"login:\x20\xff\xfb\x01Password:\x20")%r(SSLSessionReq,14,"login:\x20\x +SF:ff\xfb\x01Password:\x20")%r(TerminalServerCookie,14,"login:\x20\xff\xfb +SF:\x01Password:\x20")%r(Kerberos,14,"login:\x20\xff\xfb\x01Password:\x20" +SF:)%r(X11Probe,7,"login:\x20")%r(FourOhFourRequest,2C,"login:\x20\xff\xfb +SF:\x01Password:\x20\nLogin\x20incorrect\nlogin:\x20")%r(LPDString,14,"log +SF:in:\x20\xff\xfb\x01Password:\x20")%r(LDAPSearchReq,2C,"login:\x20\xff\x +SF:fb\x01Password:\x20\nLogin\x20incorrect\nlogin:\x20")%r(LDAPBindReq,7," +SF:login:\x20")%r(SIPOptions,BE,"login:\x20\xff\xfb\x01Password:\x20\nLogi +SF:n\x20incorrect\nlogin:\x20Password:\x20\nLogin\x20incorrect\nlogin:\x20 +SF:Password:\x20\nLogin\x20incorrect\nlogin:\x20Password:\x20\nLogin\x20in +SF:correct\nlogin:\x20Password:\x20\nLogin\x20incorrect\nlogin:\x20Passwor +SF:d:\x20")%r(LANDesk-RC,7,"login:\x20")%r(TerminalServer,7,"login:\x20")% +SF:r(NotesRPC,7,"login:\x20")%r(JavaRMI,7,"login:\x20")%r(WMSRequest,7,"lo +SF:gin:\x20")%r(afp,7,"login:\x20")%r(giop,7,"login:\x20"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port110-TCP:V=7.92%I=7%D=4/9%Time=69D742B9%P=x86_64-redhat-linux-gnu%r( +SF:NULL,23,"\+OK\x20omega-decky\x20POP3\x20server\x20ready\r\n")%r(Generic +SF:Lines,4F,"\+OK\x20omega-decky\x20POP3\x20server\x20ready\r\n-ERR\x20Unk +SF:nown\x20command\r\n-ERR\x20Unknown\x20command\r\n")%r(HTTPOptions,4F,"\ +SF:+OK\x20omega-decky\x20POP3\x20server\x20ready\r\n-ERR\x20Unknown\x20com +SF:mand\r\n-ERR\x20Unknown\x20command\r\n"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port143-TCP:V=7.92%I=7%D=4/9%Time=69D742B9%P=x86_64-redhat-linux-gnu%r( +SF:NULL,2C,"\*\x20OK\x20\[omega-decky\]\x20IMAP4rev1\x20Service\x20Ready\r +SF:\n")%r(GetRequest,4C,"\*\x20OK\x20\[omega-decky\]\x20IMAP4rev1\x20Servi +SF:ce\x20Ready\r\nGET\x20BAD\x20Command\x20not\x20recognized\r\n")%r(Gener +SF:icLines,2C,"\*\x20OK\x20\[omega-decky\]\x20IMAP4rev1\x20Service\x20Read +SF:y\r\n"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port445-TCP:V=7.92%I=7%D=4/9%Time=69D742BE%P=x86_64-redhat-linux-gnu%r( +SF:SMBProgNeg,51,"\0\0\0M\xffSMBr\0\0\0\0\x80\0\xc0\0\0\0\0\0\0\0\0\0\0\0\ +SF:0\0\0@\x06\0\0\x01\0\x11\x07\0\x03\x01\0\x01\0\0\xfa\0\0\0\0\x01\0\0\0\ +SF:0\0p\0\0\0\0\0\0\0\0\0\0\0\0\0\x08\x08\0\x11\"3DUfw\x88"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port1433-TCP:V=7.92%I=7%D=4/9%Time=69D742BE%P=x86_64-redhat-linux-gnu%r +SF:(ms-sql-s,29,"\x04\x01\0\+\0\0\x01\0\0\0\x1a\0\x06\x01\0\x20\0\x01\x02\ +SF:0!\0\x01\x03\0\"\0\x04\xff\x10\0\x03\xe8\0\0\x02\0\0\0\0\x01"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port2121-TCP:V=7.92%I=7%D=4/9%Time=69D742B9%P=x86_64-redhat-linux-gnu%r +SF:(NULL,17,"200\x20FTP\x20server\x20ready\.\r\n")%r(GenericLines,3A,"200\ +SF:x20FTP\x20server\x20ready\.\r\n500\x20Command\x20'\\r\\n'\x20not\x20und +SF:erstood\r\n"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port5060-TCP:V=7.92%I=7%D=4/9%Time=69D742C5%P=x86_64-redhat-linux-gnu%r +SF:(SIPOptions,F1,"SIP/2\.0\x20401\x20Unauthorized\r\nVia:\x20SIP/2\.0/TCP +SF:\x20nm;branch=foo\r\nFrom:\x20;tag=root\r\nTo:\x20\r\nCall-ID:\x2050000\r\nCSeq:\x2042\x20OPTIONS\r\nWWW-Authenticate: +SF:\x20Digest\x20realm=\"omega-decky\",\x20nonce=\"decnet0000\",\x20algori +SF:thm=MD5\r\nContent-Length:\x200\r\n\r\n"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port5432-TCP:V=7.92%I=7%D=4/9%Time=69D742C8%P=x86_64-redhat-linux-gnu%r +SF:(SMBProgNeg,D,"R\0\0\0\x0c\0\0\0\x05\xde\xad\xbe\xef")%r(Kerberos,D,"R\ +SF:0\0\0\x0c\0\0\0\x05\xde\xad\xbe\xef"); +==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)============== +SF-Port6379-TCP:V=7.92%I=7%D=4/9%Time=69D742BE%P=x86_64-redhat-linux-gnu%r +SF:(redis-server,9F,"\$151\r\n#\x20Server\nredis_version:7\.0\.12\nredis_m +SF:ode:standalone\nos:Linux\x205\.15\.0\narch_bits:64\ntcp_port:6379\nupti +SF:me_in_seconds:864000\nconnected_clients:1\n#\x20Keyspace\n\r\n")%r(GetR +SF:equest,16,"-ERR\x20unknown\x20command\r\n")%r(HTTPOptions,16,"-ERR\x20u +SF:nknown\x20command\r\n")%r(RTSPRequest,16,"-ERR\x20unknown\x20command\r\ +SF:n")%r(Help,16,"-ERR\x20unknown\x20command\r\n")%r(SSLSessionReq,16,"-ER +SF:R\x20unknown\x20command\r\n")%r(TerminalServerCookie,16,"-ERR\x20unknow +SF:n\x20command\r\n")%r(TLSSessionReq,16,"-ERR\x20unknown\x20command\r\n") +SF:%r(Kerberos,16,"-ERR\x20unknown\x20command\r\n")%r(FourOhFourRequest,16 +SF:,"-ERR\x20unknown\x20command\r\n")%r(LPDString,16,"-ERR\x20unknown\x20c +SF:ommand\r\n")%r(LDAPSearchReq,2C,"-ERR\x20unknown\x20command\r\n-ERR\x20 +SF:unknown\x20command\r\n")%r(SIPOptions,DC,"-ERR\x20unknown\x20command\r\ +SF:n-ERR\x20unknown\x20command\r\n-ERR\x20unknown\x20command\r\n-ERR\x20un +SF:known\x20command\r\n-ERR\x20unknown\x20command\r\n-ERR\x20unknown\x20co +SF:mmand\r\n-ERR\x20unknown\x20command\r\n-ERR\x20unknown\x20command\r\n-E +SF:RR\x20unknown\x20command\r\n-ERR\x20unknown\x20command\r\n"); +MAC Address: 56:0E:4B:0C:6D:A0 (Unknown) +Service Info: Hosts: Twisted, omega-decky + +Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . +# Nmap done at Thu Apr 9 02:12:39 2026 -- 1 IP address (1 host up) scanned in 164.95 seconds diff --git a/tests/test_bounty.py b/tests/test_bounty.py index 189146f..3b53072 100644 --- a/tests/test_bounty.py +++ b/tests/test_bounty.py @@ -1,8 +1,20 @@ +import os +from typing import Generator import pytest from fastapi.testclient import TestClient -from decnet.web.api import app +from decnet.web.api import app, repo from decnet.env import DECNET_ADMIN_USER, DECNET_ADMIN_PASSWORD +@pytest.fixture(autouse=True) +def setup_db() -> Generator[None, None, None]: + repo.db_path = "test_bounty_decnet.db" + if os.path.exists(repo.db_path): + os.remove(repo.db_path) + repo.reinitialize() + yield + if os.path.exists(repo.db_path): + os.remove(repo.db_path) + @pytest.fixture def auth_token(): with TestClient(app) as client: diff --git a/tests/test_decnet.db-shm b/tests/test_decnet.db-shm new file mode 100644 index 0000000..7f85187 Binary files /dev/null and b/tests/test_decnet.db-shm differ diff --git a/tests/test_decnet.db-wal b/tests/test_decnet.db-wal new file mode 100644 index 0000000..49d6202 Binary files /dev/null and b/tests/test_decnet.db-wal differ diff --git a/tests/test_fleet_api.py b/tests/test_fleet_api.py index 2e0c41b..5cc14df 100644 --- a/tests/test_fleet_api.py +++ b/tests/test_fleet_api.py @@ -5,6 +5,18 @@ from decnet.web.api import app import decnet.config from pathlib import Path from decnet.env import DECNET_ADMIN_USER, DECNET_ADMIN_PASSWORD +from decnet.web.api import repo + +@pytest.fixture(autouse=True) +def setup_db(): + repo.db_path = "test_fleet_decnet.db" + import os + if os.path.exists(repo.db_path): + os.remove(repo.db_path) + repo.reinitialize() + yield + if os.path.exists(repo.db_path): + os.remove(repo.db_path) TEST_STATE_FILE = Path("test-decnet-state.json") diff --git a/tests/test_ini_spaces.py b/tests/test_ini_spaces.py new file mode 100644 index 0000000..d64bd13 --- /dev/null +++ b/tests/test_ini_spaces.py @@ -0,0 +1,27 @@ +from decnet.ini_loader import load_ini_from_string + +def test_load_ini_with_spaces_around_equals(): + content = """ +[general] +interface = eth0 + +[omega-decky] +services = http, ssh +""" + cfg = load_ini_from_string(content) + assert cfg.interface == "eth0" + assert len(cfg.deckies) == 1 + assert cfg.deckies[0].name == "omega-decky" + assert cfg.deckies[0].services == ["http", "ssh"] + +def test_load_ini_with_tabs_and_spaces(): + content = """ +[general] +interface = eth0 + +[omega-decky] +services = http, ssh +""" + cfg = load_ini_from_string(content) + assert cfg.interface == "eth0" + assert cfg.deckies[0].services == ["http", "ssh"] diff --git a/tests/test_web_api.py b/tests/test_web_api.py index 7e05596..933ed09 100644 --- a/tests/test_web_api.py +++ b/tests/test_web_api.py @@ -13,6 +13,8 @@ def setup_db() -> Generator[None, None, None]: if os.path.exists(repo.db_path): os.remove(repo.db_path) + repo.reinitialize() + # Yield control to the test function yield diff --git a/tests/test_web_api_fuzz.py b/tests/test_web_api_fuzz.py index 251642a..c318ac1 100644 --- a/tests/test_web_api_fuzz.py +++ b/tests/test_web_api_fuzz.py @@ -14,6 +14,8 @@ def setup_db() -> Generator[None, None, None]: repo.db_path = "test_fuzz_decnet.db" if os.path.exists(repo.db_path): os.remove(repo.db_path) + + repo.reinitialize() yield if os.path.exists(repo.db_path): os.remove(repo.db_path)