gym_csle_apt_game.dao package

Submodules

gym_csle_apt_game.dao.apt_game_attacker_mdp_config module

class gym_csle_apt_game.dao.apt_game_attacker_mdp_config.AptGameAttackerMdpConfig(env_name: str, apt_game_config: AptGameConfig, defender_strategy: Policy, apt_game_name: str = 'csle-apt-game-v1')[source]

Bases: SimulationEnvInputConfig

DTO class representing the configuration of the MDP environnment of the attacker when facing a static defender policy

static from_dict(d: Dict[str, Any]) AptGameAttackerMdpConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) AptGameAttackerMdpConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

gym_csle_apt_game.dao.apt_game_config module

class gym_csle_apt_game.dao.apt_game_config.AptGameConfig(env_name: str, T: ndarray[Any, dtype[Any]], O: ndarray[Any, dtype[int64]], Z: ndarray[Any, dtype[Any]], C: ndarray[Any, dtype[Any]], S: ndarray[Any, dtype[int64]], A1: ndarray[Any, dtype[int64]], A2: ndarray[Any, dtype[int64]], b1: ndarray[Any, dtype[float64]], N: int, p_a: float, save_dir: str, checkpoint_traces_freq: int, gamma: float = 1)[source]

Bases: SimulationEnvInputConfig

DTO class containing the configuration of the APT game

attacker_action_space() Discrete[source]
Returns

the attacker’s action space

attacker_observation_space() Box[source]
Returns

the attacker’s observation space

defender_action_space() Discrete[source]
Returns

the defender’s action space

defender_observation_space() Box[source]
Returns

the defender’s observation space

static from_dict(d: Dict[str, Any]) AptGameConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) AptGameConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

gym_csle_apt_game.dao.apt_game_defender_pomdp_config module

class gym_csle_apt_game.dao.apt_game_defender_pomdp_config.AptGameDefenderPomdpConfig(env_name: str, apt_game_config: AptGameConfig, attacker_strategy: Policy, apt_game_name: str = 'csle-apt-game-v1')[source]

Bases: SimulationEnvInputConfig

DTO class representing the configuration of the POMDP environnment of the defender when facing a static attacker policy

static from_dict(d: Dict[str, Any]) AptGameDefenderPomdpConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) AptGameDefenderPomdpConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

gym_csle_apt_game.dao.apt_game_state module

class gym_csle_apt_game.dao.apt_game_state.AptGameState(b1: ndarray[Any, dtype[float64]])[source]

Bases: JSONSerializable

Represents the state of the optimal APT game

attacker_observation() Tuple[ndarray[Any, dtype[Any]], int][source]
Returns

the attacker’s observation

defender_observation() ndarray[Any, dtype[Any]][source]
Returns

the defender’s observation

static from_dict(d: Dict[str, Any]) AptGameState[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) AptGameState[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

reset() None[source]

Resets the state

Returns

None

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

Module contents