-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure that all check patterns have test (#110)
* make sure that all check patterns have test
- Loading branch information
1 parent
c8f5488
commit f24b42a
Showing
11 changed files
with
112 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
- from: kubernetes | ||
test: \s*(kubectl|k)\s*delete\s*(ns|namespace) | ||
test: (kubectl|k)\s*delete\s*(ns|namespace) | ||
description: "Deleting the namespace also deletes all the residing components." | ||
id: kubernetes:delete_namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- test: k delete ns | ||
description: match command | ||
- test: kubectl delete namespace | ||
description: match command with spaces | ||
- test: kubectll delete | ||
description: invalid command |
7 changes: 7 additions & 0 deletions
7
shellfirm/tests/checks/kubernetes-strict-change_resource_size.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- test: k scale | ||
description: match command | ||
- test: kubectl scale | ||
description: match command with spaces | ||
- test: kubectll scale | ||
description: invalid command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
shellfirm/tests/snapshots/checks__kubernetes-delete_namespace.yaml.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: shellfirm/tests/checks.rs | ||
expression: test_file_results | ||
--- | ||
[ | ||
TestSensitivePatternsResult { | ||
file_path: "kubernetes-delete_namespace.yaml", | ||
test: "k delete ns", | ||
check_detection_ids: [ | ||
"kubernetes:delete_namespace", | ||
"kubernetes-strict:delete_resource", | ||
], | ||
test_description: "match command", | ||
}, | ||
TestSensitivePatternsResult { | ||
file_path: "kubernetes-delete_namespace.yaml", | ||
test: "kubectl delete namespace", | ||
check_detection_ids: [ | ||
"kubernetes:delete_namespace", | ||
"kubernetes-strict:delete_resource", | ||
], | ||
test_description: "match command with spaces", | ||
}, | ||
TestSensitivePatternsResult { | ||
file_path: "kubernetes-delete_namespace.yaml", | ||
test: "kubectll delete", | ||
check_detection_ids: [], | ||
test_description: "invalid command", | ||
}, | ||
] |
28 changes: 28 additions & 0 deletions
28
shellfirm/tests/snapshots/checks__kubernetes-strict-change_resource_size.yaml.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
source: shellfirm/tests/checks.rs | ||
expression: test_file_results | ||
--- | ||
[ | ||
TestSensitivePatternsResult { | ||
file_path: "kubernetes-strict-change_resource_size.yaml", | ||
test: "k scale", | ||
check_detection_ids: [ | ||
"kubernetes-strict:change_resource_size", | ||
], | ||
test_description: "match command", | ||
}, | ||
TestSensitivePatternsResult { | ||
file_path: "kubernetes-strict-change_resource_size.yaml", | ||
test: "kubectl scale", | ||
check_detection_ids: [ | ||
"kubernetes-strict:change_resource_size", | ||
], | ||
test_description: "match command with spaces", | ||
}, | ||
TestSensitivePatternsResult { | ||
file_path: "kubernetes-strict-change_resource_size.yaml", | ||
test: "kubectll scale", | ||
check_detection_ids: [], | ||
test_description: "invalid command", | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: shellfirm/tests/checks.rs | ||
expression: not_covered | ||
--- | ||
[] |