cage-challenge/cage-challenge-1

Questions on the expected effect of actions

aduyinuo opened this issue · 3 comments

  1. The order of actions. As said in the scenario description, the green agent takes an action, then the red agent, and finally the blue agent. However, I tried to print out the sequence of action execution in EnvironmentController.step():
print("+++++++++++++++++++++++++++++++++++++++++++++")
for agent_name, agent_object in self.agent_interfaces.items():
            # pass observation to agent to get action
            if agent is None or action is None or agent != agent_name:
                agent_action = agent_object.get_action(self.observation[agent_name])

            else:
                agent_action = action
            if not self.test_valid_action(agent_action, agent_object) and not skip_valid_action_check:
                agent_action = InvalidAction()
            self.action[agent_name] = agent_action

            print("{} {}".format(agent_name, agent_action))
            # perform action on state
            next_observation[agent_name] = self._filter_obs(self.execute_action(self.action[agent_name]), agent_name)
print("+++++++++++++++++++++++++++++++++++++++++++++")

The prints looks like follows:
Screen Shot 2021-12-30 at 9 18 48 PM
Suggesting that the order is actually blue->green->red

  1. The effect of Remove action.
    I changed the above code snippet to have the agents take actions in the order of green->red->blue and played with TestKeyboardBlue.py.
    Screen Shot 2021-12-30 at 9 23 39 PM
    As shown in the screenshot, the red agent launched an Exploit action on User1, then my blue agent launched a Remove User1, however, from the updated observation table for the blue agent, we can see that although the Remove action succeeded, User1 is still compromised. Isn't a successful Remove action supposed to remove the attacker out of a host

  2. The reward of Impact action
    In another test, I had the blue agent Sleep to allow the b-line agent pivot through the network. When it finally launched an Impact action, I didn't get the expected -10 points.
    Screen Shot 2021-12-30 at 9 36 05 PM
    Screen Shot 2021-12-30 at 9 38 37 PM

Thanks for your questions,

  1. Your analysis is correct, the blue agent is supposed to act first. We have updated the readme file to reflect this.
  2. The Compromised status assumes blue acts before red. In this case, Red's exploit has been detected by Blue, so it infers the host is compromised. This would be correct for the turn order Remove -> Exploit.
  3. I was unable to replicate this bug. Does it occur if you leave the turn order alone?

Thanks for the reply.

  1. For question 2, the compromise table is generated after I change the order to be green-red-blue. By "assumes blue acts before red", do you mean that the observation table is generated independently regardless of the actual action order?
  2. The bug for question 3 occurred if I leave the turn order alone. I'm not sure if it is introduced accidentally by my modifications.
  1. Blue's observation is taken after all of the actions have resolved so the agent has the most up to date information at the beginning of its turn.
  2. Is the bug consistent or only happens occasionally?