Skip to content

[BUG] TargetInstance getFindings() doesnt work properly when the instance owner gets the instance findings #1650

Description

@proditis

Describe the bug
On backend method getFindings() of TargetInstance class, we assume that we are operating on a the player who owns the instance, however this causes problems for team instances, because the team players might still need to get the findings for this instance.

To Reproduce
Steps to reproduce the behavior:

  1. Create a team instance with a finding (say port 80/tcp)
  2. As an instance owner connect to the service
  3. Confirm that you got the finding
  4. As a player from the same team try to connect to the instance service
  5. No finding is given

Expected behavior
The team player must also be able to get the finding by connecting to the service

Additional context
This was done as a means to improve our findings and reduce the load that they cause on the gateway servers due to findings processing.

  • On backend/commands/CronCommand.php we currently have
      foreach ($ti->findings as $f) {
        $rules[] = $f->getMatchRule('<' . $ti->name . '_clients>', '<' . $ti->name . '>', $pflogmin, $pflogmax, $ti->player_id);
      }

We have to make this ($ti->findings and $f->getMatchRule) respect the fact that the instance might be "team accessible" and thus return findings based on all the players of the team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions