Skip to content

Commit d8d9c68

Browse files
authored
Merge pull request #340 from stratosphereips/eldraco-patch-1
Update README.md
2 parents 14f9bd5 + de7e5e0 commit d8d9c68

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Netwrok Security Game
1+
# Network Security Game
22
[![Python Checks](https://github.com/stratosphereips/game-states-maker/actions/workflows/python-checks.yml/badge.svg)](https://github.com/stratosphereips/game-states-maker/actions/workflows/python-checks.yml)
33
[![Autotag](https://github.com/stratosphereips/game-states-maker/actions/workflows/autotag.yml/badge.svg)](https://github.com/stratosphereips/game-states-maker/actions/workflows/autotag.yml)
44
[![Docs](https://github.com/stratosphereips/game-states-maker/actions/workflows/deploy-docs.yml/badge.svg)](https://stratosphereips.github.io/NetSecGame/)
55

66

7-
The NetSecGame (Network Security Game) is a framework for training and evaluation of AI agents in the network security tasks (both offensive and defensive). It is build with [CYST](https://pypi.org/project/cyst/) network simulator and enables rapid development and testing of AI agents in highly configurable scenarios. Examples of implemented agents can be seen in the submodule [NetSecGameAgents](https://github.com/stratosphereips/NetSecGameAgents/tree/main).
7+
The NetSecGame (Network Security Game) is a framework for training and evaluation of AI agents in network security tasks (both offensive and defensive). It is built with [CYST](https://pypi.org/project/cyst/) network simulator and enables rapid development and testing of AI agents in highly configurable scenarios. Examples of implemented agents can be seen in the submodule [NetSecGameAgents](https://github.com/stratosphereips/NetSecGameAgents/tree/main).
88

99
## Installation Guide
10-
It is recommended to install the NetSecGame in a virual environement:
10+
It is recommended to install the NetSecGame in a virtual environment:
1111
### Python venv
1212
1.
1313
```bash
@@ -37,7 +37,7 @@ The NetSecGame can be run in a Docker container. You can build the image locally
3737
```bash
3838
docker build -t aidojo-nsg-coordinator:latest .
3939
```
40-
or use the availabe image from [Dockerhub](https://hub.docker.com/r/lukasond/aidojo-coordinator).
40+
or use the available image from [Dockerhub](https://hub.docker.com/r/lukasond/aidojo-coordinator).
4141
```bash
4242
docker pull lukasond/aidojo-coordinator:1.0.2
4343
```
@@ -150,7 +150,7 @@ The NetSecGame environment has several components in the following files:
150150
### Directory Details
151151
- `coordinator.py`: Basic coordinator class. Handles agent communication and coordination. **Does not implement dynamics of the world** and must be extended (see examples in `worlds/`).
152152
- `game_components.py`: Implements a library with objects used in the environment. See [detailed explanation](AIDojoCoordinator/docs/Components.md) of the game components.
153-
- `global_defender.py`: Implements global (omnipresent) defender which can be used to stop agents. Simulation of SIEM.
153+
- `global_defender.py`: Implements a global (omnipresent) defender that can be used to stop agents. Simulation of SIEM.
154154

155155
#### **`worlds/`**
156156
Modules for different world configurations:
@@ -161,9 +161,9 @@ Modules for different world configurations:
161161
#### **`scenarios/`**
162162
Predefined scenario configurations:
163163
- `tiny_scenario_configuration.py`: A minimal example scenario.
164-
- `smaller_scenario_configuration.py`: A compact scenario configuration used for develompent and rapid testing.
164+
- `smaller_scenario_configuration.py`: A compact scenario configuration used for development and rapid testing.
165165
- `scenario_configuration.py`: The main scenario configuration.
166-
- `three_net_configuration.py`: Configuration for a three-network scenario. Used for evaluation of the model overfitting.
166+
- `three_net_configuration.py`: Configuration for a three-network scenario. Used for the evaluation of the model overfitting.
167167
Implements the network game's configuration of hosts, data, services, and connections. It is taken from [CYST](https://pypi.org/project/cyst/).
168168

169169
#### **`utils/`**
@@ -184,9 +184,9 @@ The [scenarios](#definition-of-the-network-topology) define the **topology** of
184184
2. If the attacker does a successful action in the same step that the defender successfully detects the action, the priority goes to the defender. The reward is a penalty, and the game ends.
185185
(From commit d6d4ac9, July 18th, 2024, the new action BlockIP removes controlled hosts from the state of others. So the state can get smaller)
186186

187-
- The action FindServices finds the new services in a host. If in a subsequent call to FindServices there are less services, they completely replace the list of previous services found. That is, each list of services is the final one, and no memory of previous open services is retained.
187+
- The action FindServices finds the new services in a host. If in a subsequent call to FindServices there are fewer services, they completely replace the list of previous services found. That is, each list of services is the final one, and no memory of previous open services is retained.
188188

189-
#### Assumption and Conditions for Actions
189+
#### Assumptions and Conditions for Actions
190190
1. When playing the `ExploitService` action, it is expected that the agent has discovered this service before (by playing `FindServices` in the `target_host` before this action)
191191
2. The `Find Data` action finds all the available data in the host if successful.
192192
3. The `Find Data` action requires ownership of the target host.
@@ -220,7 +220,7 @@ Each action type has a predefined probability of being detected. However, detect
220220
- BlockIP: 0.01
221221

222222
This means that one action of the type ScanNetwork has a 5% probability of being detected by the defender.
223-
This way we can define some basic probabilities based on how good we want the defender to be.
223+
This way, we can define some basic probabilities based on how good we want the defender to be.
224224

225225
- Type Ratio Threshold
226226

@@ -275,10 +275,10 @@ This approach ensures that only repeated or excessive behavior is flagged, reduc
275275
## Starting the game
276276
The environment should be created before starting the agents. The properties of the game, the task and the topology can be either read from a local file or via REST request to the GameDashboard.
277277

278-
#### To start the game with local configuration file
278+
#### To start the game with a local configuration file
279279
```python3 -m AIDojoCoordinator.worlds.NSEGameCoordinator --task_config=<PATH TO CONFIGURATION FILE>```
280280

281-
#### To start the game with remotely defined configuration
281+
#### To start the game with a remotely defined configuration
282282
```python3 -m AIDojoCoordinator.worlds.CYSTCoordinator --service_host=<URL OF THE REMOTE HOST> --service_port=<PORT FOR THE CONFIGURATION REST API> ```
283283

284284
When created, the environment:
@@ -289,7 +289,7 @@ When created, the environment:
289289
5. starts the game server in a specified address and port
290290

291291
### Interaction with the Environment
292-
When the game server is created, [agents](https://github.com/stratosphereips/NetSecGameAgents/tree/main) connect to it and interact with the environment. In every step of the interaction, agents submits an [Action](./AIDojoCoordinator/docs/Components.md#actions) and receives [Observation](./AIDojoCoordinator/docs/Components.md#observations) with `next_state`, `reward`, `is_terminal`, `end`, and `info` values. Once the terminal state or timeout is reached, no more interaction is possible until the agent asks for a game reset. Each agent should extend the `BaseAgent` class in [agents](https://github.com/stratosphereips/NetSecGameAgents/tree/main).
292+
When the game server is created, [agents](https://github.com/stratosphereips/NetSecGameAgents/tree/main) connect to it and interact with the environment. In every step of the interaction, agents submits an [Action](./AIDojoCoordinator/docs/Components.md#actions) and receive [Observation](./AIDojoCoordinator/docs/Components.md#observations) with `next_state`, `reward`, `is_terminal`, `end`, and `info` values. Once the terminal state or timeout is reached, no more interaction is possible until the agent asks for a game reset. Each agent should extend the `BaseAgent` class in [agents](https://github.com/stratosphereips/NetSecGameAgents/tree/main).
293293

294294

295295
### Configuration
@@ -299,17 +299,17 @@ The NetSecEnv is highly configurable in terms of the properties of the world, ta
299299

300300
#### Environment configuration
301301
The environment part defines the properties of the environment for the task (see the example below). In particular:
302-
- `random_seed` - sets seed for any random processes in the environment
302+
- `random_seed` - sets the seed for any random processes in the environment
303303
- `scenario` - sets the scenario (network topology) used in the task (currently, `scenario1_tiny`, `scenario1_small`, `scenario1` and `three_nets` are available)
304304
- `save_tajectories` - if `True`, interaction of the agents is serialized and stored in a file
305305
- `use_dynamic_addresses` - if `True`, the network and IP addresses defined in `scenario` are randomly changed at the beginning of **EVERY** episode (the network topology is kept as defined in the `scenario`. Relations between networks are kept, IPs inside networks are chosen at random based on the network IP and mask)
306-
- `use_firewall` - if `True` firewall rules defined in `scenario` are used when executing actions. When `False`, the firewall is ignored, and all connections are allowed (Default)
307-
- `use_global_defender` - if `True`, enables global defendr which is part of the environment and can stop interaction of any playing agent.
306+
- `use_firewall` - if `True`, firewall rules defined in `scenario` are used when executing actions. When `False`, the firewall is ignored, and all connections are allowed (Default)
307+
- `use_global_defender` - if `True`, enables global defender, which is part of the environment and can stop interaction of any playing agent.
308308
- `required_players` - Minimum required players for the game to start (default 1)
309309
- `rewards`:
310-
- `success` - sets reward which agent gets when it reaches the goal (default 100)
311-
- `fail` - sets the reward that which agent does not reach it's objective (default -10)
312-
- `step_reward` - sets reward which agent gets for every step taken (default -1)
310+
- `success` - sets the reward when the agent reaches the goal (default 100)
311+
- `fail` - sets the reward when the agent does not reach its objective (default -10)
312+
- `step_reward` - sets the reward when the agent does each single step in the game (default -1)
313313
- `actions` - defines the probability of success for every ActionType
314314

315315
```YAML
@@ -364,7 +364,7 @@ Configuration of the attacking agents. Consists of three parts:
364364
- `known_blocks`(dict)
365365

366366
The initial network configuration must assign at least **one** controlled host to the attacker in the network. Any item in `controlled_hosts` is copied to `known_hosts`, so there is no need to include these in both sets. `known_networks` is also extended with a set of **all** networks accessible from the `controlled_hosts`
367-
3. Definition of maximum allowed amount of steps:
367+
3. Definition of maximum allowed number of steps:
368368
- `max_steps:`(int): defines the maximum allowed number of steps for attackers in **each** episode.
369369

370370
Example attacker configuration:
@@ -420,38 +420,38 @@ Example of defender configuration:
420420
blocked_ips: {}
421421
known_blocks: {}
422422
```
423-
As in other agents, the description is only a text for the agent, so it can know what is supposed to do to win. In the curent implementation, the *Defender* wins, if **NO ATTACKER** reaches their goal.
423+
As in other agents, the description is only a text for the agent, so it can know what is supposed to do to win. In the current implementation, the *Defender* wins, if **NO ATTACKER** reaches their goal.
424424

425425

426426
### Definition of the network topology
427427
The network topology and rules are defined using a [CYST](https://pypi.org/project/cyst/) simulator configuration. Cyst defines a complex network configuration, and this environment does not use all Cyst features for now. CYST components currently used are:
428428

429429
- Server hosts (are a NodeConf in CYST)
430430
- Interfaces, each with one IP address
431-
- Users that can log in to the host
431+
- Users who can log in to the host
432432
- Active and passive services
433433
- Data in the server
434434
- To which network is connected
435-
- Client host (are a Node in CYST)
435+
- Client host (are of type Node in CYST)
436436
- Interfaces, each with one IP address
437437
- To which network is connected
438-
- Active and passive services if any
438+
- Active and passive services, if any
439439
- Data in the client
440-
- Router (are a RouterConf in CYST)
440+
- Router (are of type RouterConf in CYST)
441441
- Interfaces, each with one IP address
442442
- Networks
443443
- Allowed connections between hosts
444-
- Internet host (as an external router) (are a Node in RouterConf)
444+
- Internet host (as an external router) (are of type Node in RouterConf)
445445
- Interfaces, each with one IP address
446446
- Which host can connect
447447
- Exploits
448-
- which service is the exploit linked to
448+
- Which service is the exploit linked to
449449

450450
### Scenarios
451451
In the current state, we support a single scenario: Data exfiltration to a remote C&C server. However, extensions can be made by modification of the task configuration.
452452

453453
#### Data exfiltration to a remote C&C
454-
For the data exfiltration we support 3 variants. The full scenario contains 5 clients (where the attacker can start) and 5 servers where the data that is supposed to be exfiltrated can be located. *scenario1_small* is a variant with a single client (the attacker always starts there) and all 5 servers. *scenario1_tiny* contains only a single server with data. The tiny scenario is trivial and intended only for debugging purposes.
454+
For the data exfiltration, we support 3 variants. The full scenario contains 5 clients (where the attacker can start) and 5 servers, where the data that is supposed to be exfiltrated can be located. *scenario1_small* is a variant with a single client (the attacker always starts there) and all 5 servers. *scenario1_tiny* contains only a single server with data. The tiny scenario is trivial and intended only for debugging purposes.
455455
<table>
456456
<tr><th>Scenario 1</th><th>Scenario 1 - small</th><th>Scenario 1 -tiny</th></tr>
457457
<tr><td><img src="AIDojoCoordinator/docs/figures/scenarios/scenario_1.png" alt="Scenario 1 - Data exfiltration" width="300"></td><td><img src="AIDojoCoordinator/docs/figures/scenarios/scenario 1_small.png" alt="Scenario 1 - small" width="300"</td><td><img src="AIDojoCoordinator/docs/figures/scenarios/scenario_1_tiny.png" alt="Scenario 1 - tiny" width="300"></td></tr>
@@ -476,12 +476,12 @@ env:
476476

477477
## Testing the environment
478478

479-
It is advised after every change you test if the env is running correctly by doing
479+
It is advised that after every change, you test if the env is running correctly by doing
480480

481481
```bash
482482
tests/run_all_tests.sh
483483
```
484-
This will load and run the unit tests in the `tests` folder. After passing all tests, linting and formatting is checked with ruff.
484+
This will load and run the unit tests in the `tests` folder. After passing all tests, linting and formatting are checked with ruff.
485485

486486
## Code adaptation for new configurations
487487
The code can be adapted to new configurations of games and for new agents. See [Agent repository](https://github.com/stratosphereips/NetSecGameAgents/tree/main) for more details.

0 commit comments

Comments
 (0)