#2257: rearrange software pages + creating a list of applications and services which is hopefully a single point that should be referred to
This commit is contained in:
@@ -16,6 +16,7 @@ The bot is intended to simulate a malicious actor carrying out attacks like:
|
||||
- Dropping tables
|
||||
- Deleting records
|
||||
- Modifying data
|
||||
|
||||
on a database server by abusing an application's trusted database connectivity.
|
||||
|
||||
The bot performs attacks in the following stages to simulate the real pattern of an attack:
|
||||
@@ -0,0 +1,38 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
|
||||
DatabaseClient
|
||||
===============
|
||||
|
||||
The DatabaseClient provides a client interface for connecting to the ``DatabaseService``.
|
||||
|
||||
Key features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Connects to the ``DatabaseService`` via the ``SoftwareManager``.
|
||||
- Handles connecting and disconnecting.
|
||||
- Executes SQL queries and retrieves result sets.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
- Initialise with server IP address and optional password.
|
||||
- Connect to the ``DatabaseService`` with ``connect``.
|
||||
- Retrieve results in a dictionary.
|
||||
- Disconnect when finished.
|
||||
|
||||
To create database backups:
|
||||
|
||||
- Configure the backup server on the ``DatabaseService`` by providing the Backup server ``IPv4Address`` with ``configure_backup``
|
||||
- Create a backup using ``backup_database``. This fails if the backup server is not configured.
|
||||
- Restore a backup using ``restore_backup``. By default, this uses the database created via ``backup_database``.
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- Leverages ``SoftwareManager`` for sending payloads over the network.
|
||||
- Connect and disconnect methods manage sessions.
|
||||
- Payloads serialised as dictionaries for transmission.
|
||||
- Extends base Application class.
|
||||
@@ -0,0 +1,8 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
DoSBot
|
||||
------
|
||||
|
||||
test
|
||||
@@ -2,35 +2,9 @@
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
Web Browser and Web Server Service
|
||||
==================================
|
||||
|
||||
Web Server Service
|
||||
------------------
|
||||
Provides a Web Server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Simulates a web server with the capability to also request data from a database
|
||||
- Allows the emulation of HTTP requests between client (e.g. a web browser) and server
|
||||
- GET request sends a get all users request to the database server and returns an HTTP 200 status if the database is responsive
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the `WebServer`.
|
||||
- Service runs on HTTP port 80 by default. (TODO: HTTPS)
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- HTTP request uses a ``HttpRequestPacket`` object
|
||||
- HTTP response uses a ``HttpResponsePacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
|
||||
Web Browser (Web Client)
|
||||
------------------------
|
||||
WebBrowser
|
||||
==========
|
||||
|
||||
The ``WebBrowser`` provides a client interface for connecting to the ``WebServer``.
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
|
||||
Database Client Server
|
||||
======================
|
||||
|
||||
Database Service
|
||||
----------------
|
||||
|
||||
The ``DatabaseService`` provides a SQL database server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Creates a database file in the ``Node`` 's ``FileSystem`` upon creation.
|
||||
- Handles connecting clients by maintaining a dictionary of connections mapped to session IDs.
|
||||
- Authenticates connections using a configurable password.
|
||||
- Simulates ``SELECT``, ``DELETE`` and ``INSERT`` SQL queries.
|
||||
- Returns query results and status codes back to clients.
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the database service.
|
||||
- Clients connect, execute queries, and disconnect.
|
||||
- Service runs on TCP port 5432 by default.
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- Creates the database file within the node's file system.
|
||||
- Manages client connections in a dictionary by session ID.
|
||||
- Processes SQL queries.
|
||||
- Returns results and status codes in a standard dictionary format.
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
|
||||
Database Client
|
||||
---------------
|
||||
|
||||
The DatabaseClient provides a client interface for connecting to the ``DatabaseService``.
|
||||
|
||||
Key features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Connects to the ``DatabaseService`` via the ``SoftwareManager``.
|
||||
- Handles connecting and disconnecting.
|
||||
- Executes SQL queries and retrieves result sets.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
- Initialise with server IP address and optional password.
|
||||
- Connect to the ``DatabaseService`` with ``connect``.
|
||||
- Retrieve results in a dictionary.
|
||||
- Disconnect when finished.
|
||||
|
||||
To create database backups:
|
||||
|
||||
- Configure the backup server on the ``DatabaseService`` by providing the Backup server ``IPv4Address`` with ``configure_backup``
|
||||
- Create a backup using ``backup_database``. This fails if the backup server is not configured.
|
||||
- Restore a backup using ``restore_backup``. By default, this uses the database created via ``backup_database``.
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- Leverages ``SoftwareManager`` for sending payloads over the network.
|
||||
- Connect and disconnect methods manage sessions.
|
||||
- Payloads serialised as dictionaries for transmission.
|
||||
- Extends base Application class.
|
||||
@@ -0,0 +1,11 @@
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
applications/data_manipulation_bot.rst
|
||||
applications/database_client.rst
|
||||
applications/dos_bot.rst
|
||||
applications/web_browser.rst
|
||||
|
||||
More info :py:mod:`primaite.game.game.APPLICATION_TYPES_MAPPING`
|
||||
|
||||
.. include:: list_of_system_applications.rst
|
||||
@@ -0,0 +1,15 @@
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
services/database_service.rst
|
||||
services/dns_client.rst
|
||||
services/dns_server.rst
|
||||
services/ftp_client.rst
|
||||
services/ftp_server.rst
|
||||
services/ntp_client.rst
|
||||
services/ntp_server.rst
|
||||
services/web_server.rst
|
||||
|
||||
More info :py:mod:`primaite.game.game.SERVICE_TYPES_MAPPING`
|
||||
|
||||
.. include:: list_of_system_services.rst
|
||||
@@ -0,0 +1,19 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
``system applications``
|
||||
"""""""""""""""""""""""
|
||||
|
||||
Some applications are pre installed on nodes - this is similar to how some applications are included with the Operating System.
|
||||
|
||||
The application may not be configured as needed, in which case, see the relevant application page.
|
||||
|
||||
The list of applications that are considered system software are:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
applications/web_browser.rst
|
||||
|
||||
More info :py:mod:`primaite.simulator.network.hardware.nodes.host.host_node.SYSTEM_SOFTWARE`
|
||||
@@ -0,0 +1,21 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
``system services``
|
||||
"""""""""""""""""""
|
||||
|
||||
Some services are pre installed on nodes - this is similar to how some services are included with the Operating System.
|
||||
|
||||
The service may not be configured as needed, in which case, see the relevant service page.
|
||||
|
||||
The list of services that are considered system software are:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
services/dns_client.rst
|
||||
services/ftp_client.rst
|
||||
services/ntp_client.rst
|
||||
|
||||
More info :py:mod:`primaite.simulator.network.hardware.nodes.host.host_node.SYSTEM_SOFTWARE`
|
||||
@@ -0,0 +1,33 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
DatabaseService
|
||||
===============
|
||||
|
||||
The ``DatabaseService`` provides a SQL database server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Creates a database file in the ``Node`` 's ``FileSystem`` upon creation.
|
||||
- Handles connecting clients by maintaining a dictionary of connections mapped to session IDs.
|
||||
- Authenticates connections using a configurable password.
|
||||
- Simulates ``SELECT``, ``DELETE`` and ``INSERT`` SQL queries.
|
||||
- Returns query results and status codes back to clients.
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the database service.
|
||||
- Clients connect, execute queries, and disconnect.
|
||||
- Service runs on TCP port 5432 by default.
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- Creates the database file within the node's file system.
|
||||
- Manages client connections in a dictionary by session ID.
|
||||
- Processes SQL queries.
|
||||
- Returns results and status codes in a standard dictionary format.
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
@@ -2,34 +2,8 @@
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
DNS Client Server
|
||||
=================
|
||||
|
||||
DNS Server
|
||||
----------
|
||||
Also known as a DNS Resolver, the ``DNSServer`` provides a DNS Server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Simulates DNS requests and DNSPacket transfer across a network
|
||||
- Registers domain names and the IP Address linked to the domain name
|
||||
- Returns the IP address for a given domain name within a DNS Packet that a DNS Client can read
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the database service.
|
||||
- Service runs on TCP port 53 by default. (TODO: TCP for now, should be UDP in future)
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- DNS request and responses use a ``DNSPacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
|
||||
DNS Client
|
||||
----------
|
||||
DNSClient
|
||||
=========
|
||||
|
||||
The DNSClient provides a client interface for connecting to the ``DNSServer``.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
DNSServer
|
||||
=========
|
||||
Also known as a DNS Resolver, the ``DNSServer`` provides a DNS Server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Simulates DNS requests and DNSPacket transfer across a network
|
||||
- Registers domain names and the IP Address linked to the domain name
|
||||
- Returns the IP address for a given domain name within a DNS Packet that a DNS Client can read
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the database service.
|
||||
- Service runs on TCP port 53 by default. (TODO: TCP for now, should be UDP in future)
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- DNS request and responses use a ``DNSPacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
@@ -2,35 +2,9 @@
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
FTP Client Server
|
||||
=================
|
||||
|
||||
FTP Server
|
||||
----------
|
||||
Provides a FTP Client-Server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Simulates FTP requests and FTPPacket transfer across a network
|
||||
- Allows the emulation of FTP commands between an FTP client and server:
|
||||
- STOR: stores a file from client to server
|
||||
- RETR: retrieves a file from the FTP server
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the FTP server service.
|
||||
- Service runs on FTP (command) port 21 by default. (TODO: look at in depth implementation of FTP PORT command)
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- FTP request and responses use a ``FTPPacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
|
||||
FTP Client
|
||||
----------
|
||||
FTPClient
|
||||
=========
|
||||
|
||||
The ``FTPClient`` provides a client interface for connecting to the ``FTPServer``.
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
FTPServer
|
||||
=========
|
||||
Provides a FTP Client-Server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Simulates FTP requests and FTPPacket transfer across a network
|
||||
- Allows the emulation of FTP commands between an FTP client and server:
|
||||
- STOR: stores a file from client to server
|
||||
- RETR: retrieves a file from the FTP server
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the FTP server service.
|
||||
- Service runs on FTP (command) port 21 by default. (TODO: look at in depth implementation of FTP PORT command)
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- FTP request and responses use a ``FTPPacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
@@ -0,0 +1,26 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
NTPClient
|
||||
=========
|
||||
|
||||
The NTPClient provides a client interface for connecting to the ``NTPServer``.
|
||||
|
||||
Key features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Connects to the ``NTPServer`` via the ``SoftwareManager``.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
- Install on a Node via the ``SoftwareManager`` to start the database service.
|
||||
- Service runs on UDP port 123 by default.
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- Leverages ``SoftwareManager`` for sending payloads over the network.
|
||||
- Provides easy interface for Nodes to find IP addresses via domain names.
|
||||
- Extends base Service class.
|
||||
@@ -2,11 +2,8 @@
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
NTP Client Server
|
||||
=================
|
||||
|
||||
NTP Server
|
||||
----------
|
||||
NTPServer
|
||||
=========
|
||||
The ``NTPServer`` provides a NTP Server simulation by extending the base Service class.
|
||||
|
||||
NTP Client
|
||||
@@ -29,26 +26,3 @@ Implementation
|
||||
|
||||
- NTP request and responses use a ``NTPPacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
|
||||
NTP Client
|
||||
----------
|
||||
|
||||
The NTPClient provides a client interface for connecting to the ``NTPServer``.
|
||||
|
||||
Key features
|
||||
^^^^^^^^^^^^
|
||||
|
||||
- Connects to the ``NTPServer`` via the ``SoftwareManager``.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
|
||||
- Install on a Node via the ``SoftwareManager`` to start the database service.
|
||||
- Service runs on UDP port 123 by default.
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- Leverages ``SoftwareManager`` for sending payloads over the network.
|
||||
- Provides easy interface for Nodes to find IP addresses via domain names.
|
||||
- Extends base Service class.
|
||||
@@ -0,0 +1,27 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
WebServer
|
||||
=========
|
||||
Provides a Web Server simulation by extending the base Service class.
|
||||
|
||||
Key capabilities
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
- Simulates a web server with the capability to also request data from a database
|
||||
- Allows the emulation of HTTP requests between client (e.g. a web browser) and server
|
||||
- GET request sends a get all users request to the database server and returns an HTTP 200 status if the database is responsive
|
||||
- Leverages the Service base class for install/uninstall, status tracking, etc.
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
- Install on a Node via the ``SoftwareManager`` to start the `WebServer`.
|
||||
- Service runs on HTTP port 80 by default. (TODO: HTTPS)
|
||||
|
||||
Implementation
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
- HTTP request uses a ``HttpRequestPacket`` object
|
||||
- HTTP response uses a ``HttpResponsePacket`` object
|
||||
- Extends Service class for integration with ``SoftwareManager``.
|
||||
@@ -16,6 +16,8 @@ ARP, ICMP, or the Web Client. This pathway exemplifies the structured processing
|
||||
each frame reaches its intended target within the simulated environment.
|
||||
|
||||
.. image:: node_session_software_model_example.png
|
||||
:width: 500
|
||||
:align: center
|
||||
|
||||
Session Manager
|
||||
---------------
|
||||
|
||||
@@ -39,16 +39,27 @@ See :ref:`Node Start up and Shut down`
|
||||
assert node.operating_state is NodeOperatingState.ON
|
||||
assert web_server.operating_state is ServiceOperatingState.RUNNING # service turned back on when node is powered on
|
||||
|
||||
.. _List of Applications:
|
||||
|
||||
Services, Processes and Applications:
|
||||
#####################################
|
||||
Applications
|
||||
############
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
These are a list of applications that are currently available in PrimAITE:
|
||||
|
||||
database_client_server
|
||||
data_manipulation_bot
|
||||
dns_client_server
|
||||
ftp_client_server
|
||||
ntp_client_server
|
||||
web_browser_and_web_server_service
|
||||
.. include:: list_of_applications.rst
|
||||
|
||||
.. _List of Services:
|
||||
|
||||
Services
|
||||
########
|
||||
|
||||
These are a list of services that are currently available in PrimAITE:
|
||||
|
||||
.. include:: list_of_services.rst
|
||||
|
||||
.. _List of Processes:
|
||||
|
||||
Processes
|
||||
#########
|
||||
|
||||
`To be implemented`
|
||||
|
||||
Reference in New Issue
Block a user