forked from Checkmarx/kics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(knative): add knative security query and k8's pod queries intero…
…perability (Checkmarx#5692) * stage * stage * stage * stage * stage * Add Knative Query and K8s Pod refac * add exception for k8s sample validator * fix package lock * update kind pod check * update policy * change
- Loading branch information
1 parent
e0d460a
commit e17c979
Showing
55 changed files
with
1,144 additions
and
179 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package generic.knative | ||
|
||
import data.generic.common as common_lib |
57 changes: 57 additions & 0 deletions
57
assets/queries/k8s/audit_log_maxage_not_properly_set/test/positive3.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,57 @@ | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: dummy | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: [] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Configuration | ||
metadata: | ||
name: dummy-config | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: [] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Revision | ||
metadata: | ||
name: dummy-rev | ||
namespace: knative-sequence | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: [] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: sources.knative.dev/v1 | ||
kind: ContainerSource | ||
metadata: | ||
name: dummy-cs | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: [] | ||
restartPolicy: OnFailure |
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
57 changes: 57 additions & 0 deletions
57
assets/queries/k8s/audit_log_maxbackup_not_properly_set/test/positive3.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,57 @@ | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: dummy | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxbackup=5"] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Configuration | ||
metadata: | ||
name: dummy-config | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxbackup=5"] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Revision | ||
metadata: | ||
name: dummy-rev | ||
namespace: knative-sequence | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxbackup=5"] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: sources.knative.dev/v1 | ||
kind: ContainerSource | ||
metadata: | ||
name: dummy-cs | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxbackup=5"] | ||
restartPolicy: OnFailure |
48 changes: 36 additions & 12 deletions
48
assets/queries/k8s/audit_log_maxbackup_not_properly_set/test/positive_expected_result.json
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,14 +1,38 @@ | ||
[ | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive1.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive2.yaml" | ||
} | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive1.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive2.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 12, | ||
"fileName": "positive3.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 27, | ||
"fileName": "positive3.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 40, | ||
"fileName": "positive3.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxbackup Not Properly Set", | ||
"severity": "LOW", | ||
"line": 55, | ||
"fileName": "positive3.yaml" | ||
} | ||
] |
57 changes: 57 additions & 0 deletions
57
assets/queries/k8s/audit_log_maxsize_not_properly_set/test/positive3.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,57 @@ | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: dummy | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxsize=50"] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Configuration | ||
metadata: | ||
name: dummy-config | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxsize=50"] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Revision | ||
metadata: | ||
name: dummy-rev | ||
namespace: knative-sequence | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxsize=50"] | ||
restartPolicy: OnFailure | ||
--- | ||
apiVersion: sources.knative.dev/v1 | ||
kind: ContainerSource | ||
metadata: | ||
name: dummy-cs | ||
namespace: knative-sequence | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: command-demo-container | ||
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0 | ||
command: ["kube-apiserver"] | ||
args: ["--audit-log-maxsize=50"] | ||
restartPolicy: OnFailure |
48 changes: 36 additions & 12 deletions
48
assets/queries/k8s/audit_log_maxsize_not_properly_set/test/positive_expected_result.json
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,14 +1,38 @@ | ||
[ | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive1.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive2.yaml" | ||
} | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive1.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 11, | ||
"fileName": "positive2.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 12, | ||
"fileName": "positive3.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 27, | ||
"fileName": "positive3.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 40, | ||
"fileName": "positive3.yaml" | ||
}, | ||
{ | ||
"queryName": "Audit Log Maxsize Not Properly Set", | ||
"severity": "LOW", | ||
"line": 55, | ||
"fileName": "positive3.yaml" | ||
} | ||
] |
Oops, something went wrong.