Skip to content

Commit

Permalink
Adding more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Schendel <[email protected]>
  • Loading branch information
amitschendel committed Nov 20, 2024
1 parent 549e1a8 commit d26c8ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/ruleengine/v1/r1003_malicious_ssh_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,12 @@ func TestR1003DisallowedSSHConnectionPort_ProcessEvent(t *testing.T) {
if failure == nil {
t.Errorf("Expected failure since the SSH connection is to a disallowed port, got nil")
}

// Test allowed port
sshEvent.DstPort = 2022
sshEvent.DstIP = "3.3.3.3"
failure = rule.ProcessEvent(utils.SSHEventType, sshEvent, &objCache)
if failure != nil {
t.Errorf("Expected nil since the SSH connection is to an allowed port, got %v", failure)
}
}

0 comments on commit d26c8ff

Please sign in to comment.