Changes between Version 3 and Version 4 of BuildInstructions
- Timestamp:
- 08/22/26 19:58:27 (5 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildInstructions
v3 v4 3 3 == Development environment description == 4 4 5 The prototype is implemented as a web application .5 The prototype is implemented as a web application (Flask backend + Vite frontend + a Python client agent). 6 6 7 7 Required software: 8 8 9 9 * Python 3.11 or newer 10 * SQLite 3 10 * Node.js 18+ and npm (for the frontend) 11 * SQLite 3 (used by the prototype database) 11 12 * Git 12 13 * Visual Studio Code or PyCharm (recommended) 13 14 * Modern web browser (Google Chrome, Microsoft Edge or Mozilla Firefox) 14 15 15 Python libraries:16 Main Python libraries (see requirements.txt for the full list): 16 17 17 * Flask 18 * Flask-CORS19 * Requests20 * python-dotenv21 * Grafana client libraries (if configured)18 * Flask, Flask-CORS, Flask-SocketIO 19 * requests, python-dotenv 20 * PyJWT, google-auth (Google login + JWT cookie session) 21 * openai (RAG / natural-language chat module) 22 * psutil (system metrics on the client) 22 23 23 The database used by the prototype is ''lan_logs_sysmon.db''. 24 The prototype database is a local SQLite file: ''lan_logs_sysmon.db''. It is created automatically the first time the server starts. 25 26 '''Note:''' The official project database from the previous phase is a PostgreSQL schema (project). The prototype uses a local SQLite database with the same table structure for easier local development. 24 27 25 28 ---- … … 31 34 {{{ 32 35 git clone https://github.com/istevanoska/NETIntel 33 cd Proekt_Wazuh36 cd NETIntel 34 37 }}} 35 38 … … 37 40 38 41 Windows: 39 40 42 {{{ 41 43 python -m venv .venv … … 44 46 45 47 Linux/macOS: 46 47 48 {{{ 48 49 python3 -m venv .venv … … 56 57 }}} 57 58 58 4. Start the server. 59 4. Create a .env file in the project root with the required configuration. 60 61 {{{ 62 GOOGLE_CLIENT_ID=your-google-oauth-client-id 63 JWT_SECRET=your-secret-key 64 OPENAI_API_KEY=your-openai-key # само за Chat / RAG модулот 65 }}} 66 67 5. Start the server. 59 68 60 69 {{{ … … 63 72 64 73 The server starts on: 65 66 74 {{{ 67 75 http://localhost:5555 68 76 }}} 69 77 70 If the database does not exist, it is automatically createdwhen the server starts.78 If the database does not exist, it is created automatically (all tables) when the server starts. 71 79 72 5. Start the frontend.80 6. Configure and start the frontend. 73 81 82 Create a file lan-frontend/.env with: 83 {{{ 84 VITE_API_BASE=http://localhost:5555 85 VITE_GOOGLE_CLIENT_ID=your-google-oauth-client-id 86 }}} 87 88 '''Note:''' VITE_GOOGLE_CLIENT_ID must be the same value as GOOGLE_CLIENT_ID in the backend .env. 89 90 Then install and start: 74 91 {{{ 75 92 cd lan-frontend 93 npm install 76 94 npm run dev 77 95 }}} 78 96 79 Starts on:97 The frontend starts on: 80 98 {{{ 81 99 http://localhost:5173 82 100 }}} 83 101 84 85 86 6. Start the client. 102 7. Start the client agent. 87 103 88 104 {{{ … … 90 106 }}} 91 107 92 You should enter the ip address from the server, provived in the terminal where you started the server. 93 Enter the token you have generated, from the admin panel for the environment. 94 95 {{{ 96 http://localhost:5555 97 }}} 98 99 108 When prompted, enter the server IP address shown in the server terminal, and the environment token generated from the admin panel. 100 109 101 110 ---- … … 104 113 105 114 Open the application in a web browser: 106 107 115 {{{ 108 http://localhost:5 555116 http://localhost:5173 109 117 }}} 110 118 111 Login using a valid user account.119 Login using a Google account (Google OAuth). The session is kept via an HttpOnly JWT cookie. 112 120 113 121 After successful login the following prototype functionalities can be tested: 114 122 115 123 * Dashboard – overview of all monitored computers 116 * Computer Details – detailed information about a selected computer 124 * Computer Details – detailed information about a selected computer (processes, Sysmon events, security alerts) 117 125 * Environment Management – create and manage environments and generate tokens 118 126 * Agent Communication – send monitoring data from the client application 119 * RAG / Chat – generate SQL queries from natural language questions127 * RAG / Chat – generate SQL queries from natural-language questions 120 128 121 129 Example questions for the Chat module: 122 130 123 * Show all active processes for Ilina-laptop.131 * Show all active processes for PC-ADMIN. 124 132 * Show all security alerts. 125 133 * Show the latest Sysmon events. … … 128 136 Mini guide: 129 137 130 1. Login to the application .138 1. Login to the application (Google). 131 139 2. Open the Dashboard. 132 140 3. Select a monitored computer. 133 141 4. View system metrics, running processes and security events. 134 5. Open Environment Management if administrator privileges are available.142 5. Open Environment Management (requires administrator role) to create environments and tokens. 135 143 6. Open the Chat page and ask a question in natural language. 136 144 7. Review the generated SQL query and the returned results. … … 138 146 ---- 139 147 140 == Database initialization 148 == Database initialization == 141 149 142 Execute the following SQL scripts in order: 150 The database is created and populated automatically by the server on first start (init_db creates all tables if missing). 143 151 144 1. database/schema.sql 145 2. database/sample_data.sql 152 Optionally, to (re)create the schema and load sample data manually, run: 146 153 147 After creating and populating the database, start the server: 154 1. database/schema.sql 155 2. database/sample_data.sql 148 156 157 Then start the server: 158 {{{ 149 159 python server.py 160 }}} 150 161 151 162 ---- … … 156 167 157 168 * Complete application source code 158 * Flask backend 159 * Frontend source code160 * SQL scripts for creating the database schema161 * SQL scripts containingsample data162 * Documentation for the project169 * Flask backend (server.py) 170 * Python client agent (sctry.py) 171 * Frontend source code (lan-frontend, Vite) 172 * SQL scripts for creating the database schema and sample data 173 * Project documentation 163 174 164 175 All source code required to build and run the prototype is available in the DEVELOP repository.
