diff --git a/src/primaite/config/_package_data/data_manipulation_marl.yaml b/src/primaite/config/_package_data/data_manipulation_marl.yaml index 359d7c55..45779036 100644 --- a/src/primaite/config/_package_data/data_manipulation_marl.yaml +++ b/src/primaite/config/_package_data/data_manipulation_marl.yaml @@ -1061,6 +1061,8 @@ agents: source_port_id: 1 dest_port_id: 1 protocol_id: 1 + source_wildcard_id: 0 + dest_wildcard_id: 0 47: # old action num: 23 # "ACL: ADDRULE - Block outgoing traffic from client 2" action: "ROUTER_ACL_ADDRULE" options: @@ -1072,6 +1074,8 @@ agents: source_port_id: 1 dest_port_id: 1 protocol_id: 1 + source_wildcard_id: 0 + dest_wildcard_id: 0 48: # old action num: 24 # block tcp traffic from client 1 to web app action: "ROUTER_ACL_ADDRULE" options: @@ -1083,6 +1087,8 @@ agents: source_port_id: 1 dest_port_id: 1 protocol_id: 3 + source_wildcard_id: 0 + dest_wildcard_id: 0 49: # old action num: 25 # block tcp traffic from client 2 to web app action: "ROUTER_ACL_ADDRULE" options: @@ -1094,6 +1100,8 @@ agents: source_port_id: 1 dest_port_id: 1 protocol_id: 3 + source_wildcard_id: 0 + dest_wildcard_id: 0 50: # old action num: 26 action: "ROUTER_ACL_ADDRULE" options: @@ -1105,6 +1113,8 @@ agents: source_port_id: 1 dest_port_id: 1 protocol_id: 3 + source_wildcard_id: 0 + dest_wildcard_id: 0 51: # old action num: 27 action: "ROUTER_ACL_ADDRULE" options: @@ -1116,6 +1126,8 @@ agents: source_port_id: 1 dest_port_id: 1 protocol_id: 3 + source_wildcard_id: 0 + dest_wildcard_id: 0 52: # old action num: 28 action: "ROUTER_ACL_REMOVERULE" options: diff --git a/src/primaite/game/agent/observations/host_observations.py b/src/primaite/game/agent/observations/host_observations.py index b15ede9a..02c0d17f 100644 --- a/src/primaite/game/agent/observations/host_observations.py +++ b/src/primaite/game/agent/observations/host_observations.py @@ -227,6 +227,13 @@ class HostObservation(AbstractObservation, identifier="HOST"): applications = [ApplicationObservation.from_config(config=c, parent_where=where) for c in config.applications] folders = [FolderObservation.from_config(config=c, parent_where=where) for c in config.folders] nics = [NICObservation.from_config(config=c, parent_where=where) for c in config.network_interfaces] + # If list of network interfaces is not defined, assume we want to + # monitor the first N interfaces. Network interface numbering starts at 1. + count = 1 + while len(nics) < config.num_nics: + nic_config = NICObservation.ConfigSchema(nic_num=count, include_nmne=config.include_nmne) + nics.append(NICObservation.from_config(config=nic_config, parent_where=where)) + count += 1 return cls( where=where, diff --git a/src/primaite/notebooks/Data-Manipulation-Customising-Red-Agent.ipynb b/src/primaite/notebooks/Data-Manipulation-Customising-Red-Agent.ipynb index 56e9bf5a..74a1e0ef 100644 --- a/src/primaite/notebooks/Data-Manipulation-Customising-Red-Agent.ipynb +++ b/src/primaite/notebooks/Data-Manipulation-Customising-Red-Agent.ipynb @@ -362,7 +362,7 @@ " cfg = yaml.safe_load(f)\n", " cfg['simulation']['network']\n", " for node in cfg['simulation']['network']['nodes']:\n", - " if node['ref'] in ['client_1', 'client_2']:\n", + " if node['hostname'] in ['client_1', 'client_2']:\n", " node['applications'] = change['applications']\n", "\n", "env = PrimaiteGymEnv(game_config = cfg)\n", @@ -407,7 +407,7 @@ " cfg = yaml.safe_load(f)\n", " cfg['simulation']['network']\n", " for node in cfg['simulation']['network']['nodes']:\n", - " if node['ref'] in ['client_1', 'client_2']:\n", + " if node['hostname'] in ['client_1', 'client_2']:\n", " node['applications'] = change['applications']\n", "\n", "env = PrimaiteGymEnv(game_config = cfg)\n",