WhiteBoxNetSecGame
Whitebox version of NSG is an extension of the NetSecGame which provides full action space for the agents upon registration in the game. This version is used for training of agents that require fixed size action space.
netsecgame.game.worlds.WhiteBoxNetSecGame.WhiteBoxNetSecGame
Bases: NetSecGame
WhiteBoxNetSecGame is an extension for the NetSecGame environment that provides list of all possible actions to each agent that registers in the game.
Initializes the WhiteBoxNetSecGame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game_host
|
str
|
The host for the game server. |
required |
game_port
|
int
|
The port for the game server. |
required |
task_config
|
str
|
Path to the task configuration file. |
required |
seed
|
Optional[int]
|
Random seed. |
None
|
include_block_action
|
bool
|
Whether to include BlockIP actions. |
True
|
Source code in netsecgame/game/worlds/WhiteBoxNetSecGame.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
_create_state_from_view
Creates a GameState from a view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view
|
Dict[str, Any]
|
The view dictionary. |
required |
add_neighboring_nets
|
bool
|
Whether to add neighboring networks. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
GameState |
GameState
|
The generated game state. |
Source code in netsecgame/game/worlds/WhiteBoxNetSecGame.py
145 146 147 148 149 150 151 152 153 154 155 156 | |
_dynamic_ip_change
Dynamic IP change is not supported for WhiteBoxNetSecGame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_attempts
|
int
|
Maximum number of attempts. |
10
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in netsecgame/game/worlds/WhiteBoxNetSecGame.py
158 159 160 161 162 163 164 165 166 167 168 169 170 | |
_generate_all_actions
Generates a list of all possible actions for the game.
Returns:
| Type | Description |
|---|---|
List[Action]
|
List[Action]: List of all possible actions. |
Source code in netsecgame/game/worlds/WhiteBoxNetSecGame.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
_initialize
Initializes the game state and generates all possible actions.
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in netsecgame/game/worlds/WhiteBoxNetSecGame.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |