Skip to content

Commit

Permalink
Merge pull request #407 from kubescape/feature/ssh-tests
Browse files Browse the repository at this point in the history
Adding more tests
  • Loading branch information
amitschendel authored Nov 20, 2024
2 parents 549e1a8 + d26c8ff commit e267183
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 e267183

Please sign in to comment.