Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 2efd36a

Browse files
committed
Add ssh-scan integration tests
Todo: Needs to be integrated into github ci pipeline
1 parent 304a32c commit 2efd36a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

tests/integration/ssh-scan.test.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// todo: Integrate into github ci pipeline
2+
const { scan } = require("./helpers");
3+
4+
test(
5+
"ssh-scan should find a couple of findings for a dummy ssh service",
6+
async () => {
7+
const { categories, severities, count } = await scan(
8+
"ssh-scan-dummy-ssh",
9+
"ssh-scan",
10+
["-t", "dummy-ssh.demo-apps.svc"],
11+
90
12+
);
13+
14+
expect(count).toBe(4);
15+
expect(categories).toMatchInlineSnapshot(`
16+
Object {
17+
"SSH Policy Violation": 3,
18+
"SSH Service": 1,
19+
}
20+
`);
21+
expect(severities).toMatchInlineSnapshot(`
22+
Object {
23+
"informational": 1,
24+
"medium": 3,
25+
}
26+
`);
27+
},
28+
3 * 60 * 1000
29+
);
30+
31+
test(
32+
"ssh-scan should gracefully handle a non-existing target",
33+
async () => {
34+
await expect(
35+
scan(
36+
"ssh-scan-non-existing",
37+
"ssh-scan",
38+
["-t", "this-target-doesnt-exist.demo-apps.svc"],
39+
180
40+
)
41+
).rejects.toThrow(
42+
'Scan failed with description "Failed to run the Scan Container, check k8s Job and its logs for more details"'
43+
);
44+
},
45+
3 * 60 * 1000
46+
);

0 commit comments

Comments
 (0)