Skip to content

[BUG] The AIDojoCoordinator is ending the game incorrectly #302

@eldraco

Description

@eldraco

I was testing

  • Aidojo scenario 1
  • Defender heuristic-random
  • Attacker qlearning

The problem is that the attacker ends by timeout (correct), but the env sends the defender the message AgentStatus.Success with reward = 99. Signaling the defender that it won!!! But it didn't, it actually send 1 action and the block list is empty..

NSG_coordinator_2.log

2025-04-27 16:04:04  AIDojo-AgentServer INFO Sending response to agent ('127.0.0.1', 39326):
    Status: GameStatus.OK
    End Reason: AgentStatus.TimeoutReached
    To Agent: 127.0.0.1:39326
    Known Networks: 192.168.3.0/24, 192.168.1.0/24, 192.168.2.0/24
    Known Hosts: 192.168.2.2, 192.168.2.4, 192.168.2.6, 192.168.2.5, 213.47.23.195, 192.168.2.1, 192.168.2.3
    Controlled Hosts: 213.47.23.195, 192.168.2.6, 192.168.2.3
    Services on 213.47.23.195: bash, listener
    Services on 192.168.2.3: powershell, ms-wbt-server
    Services on 192.168.2.6: bash
    Services on 192.168.2.4: ssh
    Data on 192.168.2.6: logfile
    Data on 213.47.23.195: logfile
    Blocked Hosts: None
    Reward: -11
    End: True
2025-04-27 16:04:04  AIDojo-AgentServer INFO Sending response to agent ('127.0.0.1', 48786):
    Status: GameStatus.OK
    End Reason: AgentStatus.Success
    To Agent: 127.0.0.1:48786
    Known Networks: 192.168.0.0/24, 192.168.1.0/24, 192.168.3.0/24, 192.168.2.0/24
    Known Hosts: 192.168.2.2, 192.168.1.3, 192.168.1.4, 192.168.1.5, 192.168.2.4, 192.168.1.1, 192.168.2.6, 192.168.2.5, 192.168.2.1, 192.168.1.6, 192.168.1.2, 192.168.2.3
    Controlled Hosts: 192.168.2.2, 192.168.1.3, 192.168.1.4, 192.168.1.5, 192.168.2.4, 192.168.1.1, 192.168.2.6, 192.168.2.5, 192.168.2.1, 192.168.1.6, 192.168.1.2, 192.168.2.3
    Data on 192.168.1.6: logfile
    Blocked Hosts: None
    Reward: 99
    End: True

Full file is attached here of the log of the env.

To reproduce

Run env as netsecenv

  • Commit: 5facdd4 branch add-logs
  • Config: Config netsecenv 2
  • python3 -m AIDojoCoordinator.worlds.NSEGameCoordinator --task_config=./AIDojoCoordinator/netsecenv_conf.yaml -gp 10002
  • Logs are in NSG_coordinator_2.log

Run defender

  • Commit: 964de6dc9a86cc490454b8aa2fb643eb0959a73c Adding-defender-agent
  • cd NetSecGameAgents
  • python3 agents/defenders/stochastic-random/stochastic_random_agent.py --port 10002 --episodes 100

Run attacker

  • Commit: 964de6dc9a86cc490454b8aa2fb643eb0959a73c Adding-defender-agent
  • Model: https://github.com/stratosphereips/NetSecGameModels
  • cd NetSecGameAgents
  • python3 agents/attackers/q_learning/q_agent.py --episodes 100 --port 10002 --experiment_id 3 --store_actions True --env_conf ../AIDojoCoordinator/netsecenv_conf.yaml --previous_model /data/AIDojo/Models/q_agent_marl.experiment2-episodes-40000.pickle --logdir agents/attackers/q_learning/logs/q_agent_2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions