Changes between Version 3 and Version 4 of BuildInstructions


Ignore:
Timestamp:
08/22/26 19:58:27 (5 days ago)
Author:
231118
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildInstructions

    v3 v4  
    33== Development environment description ==
    44
    5 The prototype is implemented as a web application.
     5The prototype is implemented as a web application (Flask backend + Vite frontend + a Python client agent).
    66
    77Required software:
    88
    99 * 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)
    1112 * Git
    1213 * Visual Studio Code or PyCharm (recommended)
    1314 * Modern web browser (Google Chrome, Microsoft Edge or Mozilla Firefox)
    1415
    15 Python libraries:
     16Main Python libraries (see requirements.txt for the full list):
    1617
    17  * Flask
    18  * Flask-CORS
    19  * Requests
    20  * python-dotenv
    21  * 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)
    2223
    23 The database used by the prototype is ''lan_logs_sysmon.db''.
     24The 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.
    2427
    2528----
     
    3134{{{
    3235git clone https://github.com/istevanoska/NETIntel
    33 cd Proekt_Wazuh
     36cd NETIntel
    3437}}}
    3538
     
    3740
    3841Windows:
    39 
    4042{{{
    4143python -m venv .venv
     
    4446
    4547Linux/macOS:
    46 
    4748{{{
    4849python3 -m venv .venv
     
    5657}}}
    5758
    58 4. Start the server.
     594. Create a .env file in the project root with the required configuration.
     60
     61{{{
     62GOOGLE_CLIENT_ID=your-google-oauth-client-id
     63JWT_SECRET=your-secret-key
     64OPENAI_API_KEY=your-openai-key   # само за Chat / RAG модулот
     65}}}
     66
     675. Start the server.
    5968
    6069{{{
     
    6372
    6473The server starts on:
    65 
    6674{{{
    6775http://localhost:5555
    6876}}}
    6977
    70 If the database does not exist, it is automatically created when the server starts.
     78If the database does not exist, it is created automatically (all tables) when the server starts.
    7179
    72 5. Start the frontend.
     806. Configure and start the frontend.
    7381
     82Create a file lan-frontend/.env with:
     83{{{
     84VITE_API_BASE=http://localhost:5555
     85VITE_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
     90Then install and start:
    7491{{{
    7592cd lan-frontend
     93npm install
    7694npm run dev
    7795}}}
    7896
    79 Starts on:
     97The frontend starts on:
    8098{{{
    8199http://localhost:5173
    82100}}}
    83101
    84 
    85 
    86 6. Start the client.
     1027. Start the client agent.
    87103
    88104{{{
     
    90106}}}
    91107
    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 
     108When prompted, enter the server IP address shown in the server terminal, and the environment token generated from the admin panel.
    100109
    101110----
     
    104113
    105114Open the application in a web browser:
    106 
    107115{{{
    108 http://localhost:5555
     116http://localhost:5173
    109117}}}
    110118
    111 Login using a valid user account.
     119Login using a Google account (Google OAuth). The session is kept via an HttpOnly JWT cookie.
    112120
    113121After successful login the following prototype functionalities can be tested:
    114122
    115123 * 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)
    117125 * Environment Management – create and manage environments and generate tokens
    118126 * Agent Communication – send monitoring data from the client application
    119  * RAG / Chat – generate SQL queries from natural language questions
     127 * RAG / Chat – generate SQL queries from natural-language questions
    120128
    121129Example questions for the Chat module:
    122130
    123  * Show all active processes for Ilina-laptop.
     131 * Show all active processes for PC-ADMIN.
    124132 * Show all security alerts.
    125133 * Show the latest Sysmon events.
     
    128136Mini guide:
    129137
    130  1. Login to the application.
     138 1. Login to the application (Google).
    131139 2. Open the Dashboard.
    132140 3. Select a monitored computer.
    133141 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.
    135143 6. Open the Chat page and ask a question in natural language.
    136144 7. Review the generated SQL query and the returned results.
     
    138146----
    139147
    140 == Database initialization
     148== Database initialization ==
    141149
    142 Execute the following SQL scripts in order:
     150The database is created and populated automatically by the server on first start (init_db creates all tables if missing).
    143151
    144 1. database/schema.sql
    145 2. database/sample_data.sql
     152Optionally, to (re)create the schema and load sample data manually, run:
    146153
    147 After creating and populating the database, start the server:
     154 1. database/schema.sql
     155 2. database/sample_data.sql
    148156
     157Then start the server:
     158{{{
    149159python server.py
     160}}}
    150161
    151162----
     
    156167
    157168 * Complete application source code
    158  * Flask backend
    159  * Frontend source code
    160  * SQL scripts for creating the database schema
    161  * SQL scripts containing sample data
    162  * Documentation for the project
     169 * 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
    163174
    164175All source code required to build and run the prototype is available in the DEVELOP repository.