Skip to content

Debug Wrapper: TrueStateWrapper

For further information on how to use this wrapper, please go to its tutorial.

A CC4 wrapper that outputs the true state of the environment, in the form of various tables.

The tables are created using PrettyTable package to make the output more readable. It is recommended that the output is piped to a text file, as the length of the output can be long.

Attributes:

Name Type Description
hostnames List[str]

list of hostnames in the environment

env CybORG

the cyborg environment that the wrapper is being added to (parent class attribute).

agents dict

dictionary of agents (parent class attribute).

Functions

get_agent_session_tables

get_agent_session_tables()

Creates a table of: agent name, session ID, associated hostname, username, session type, and associated process ID; per agent team (red, blue, green).

Returns:

Name Type Description
team_tables Dict[str, PrettyTable]

get_host_overview_table

get_host_overview_table()

Creates a table of: hostnames, IP addresses, sessions, and number of processes.

Returns:

Name Type Description
table PrettyTable

host overview table

get_host_processes_tables

get_host_processes_tables()

Creates a table of: hostname, process ID, process name, process type, associated username, associated session and session ID (if any); per subnet.

Returns:

Name Type Description
tables Dict[str, PrettyTable]

dictionary of host processes tables per subnet

get_raw_full_true_state

get_raw_full_true_state()

Gets all the raw true state data straight from the environment.

Returns:

Type Description
dict

the raw true state data from the env

print_agent_session_tables

print_agent_session_tables()

Prints the tables produced by get_agent_session_tables to stdout.

print_host_overview_table

print_host_overview_table()

Prints the table produces by get_host_overview_table to stdout.

print_host_processes_tables

print_host_processes_tables()

Prints the tables produced by get_host_process_tables to stdout.