-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from kubescape/split-default-namespace-rules
Split default namespace rules
- Loading branch information
Showing
88 changed files
with
1,586 additions
and
169 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
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,25 @@ | ||
{ | ||
"name": "configmap-in-default-namespace", | ||
"attributes": { | ||
"armoBuiltin": true | ||
}, | ||
"ruleLanguage": "Rego", | ||
"match": [ | ||
{ | ||
"apiGroups": [ | ||
"" | ||
], | ||
"apiVersions": [ | ||
"v1" | ||
], | ||
"resources": [ | ||
"ConfigMap" | ||
] | ||
} | ||
], | ||
"ruleDependencies": [ | ||
], | ||
"description": "", | ||
"remediation": "", | ||
"ruleQuery": "armo_builtins" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
rules/controllerrevision-in-default-namespace/rule.metadata.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "controllerrevision-in-default-namespace", | ||
"attributes": { | ||
"armoBuiltin": true | ||
}, | ||
"ruleLanguage": "Rego", | ||
"match": [ | ||
{ | ||
"apiGroups": [ | ||
"apps" | ||
], | ||
"apiVersions": [ | ||
"v1" | ||
], | ||
"resources": [ | ||
"ControllerRevision" | ||
] | ||
} | ||
], | ||
"ruleDependencies": [ | ||
], | ||
"description": "", | ||
"remediation": "", | ||
"ruleQuery": "armo_builtins" | ||
} |
23 changes: 23 additions & 0 deletions
23
rules/controllerrevision-in-default-namespace/test/controllerrevision/expected.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"alertMessage": "ControllerRevision: kubescape is in the 'default' namespace", | ||
"failedPaths": [ | ||
"metadata.namespace" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 3, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "apps/v1", | ||
"kind": "ControllerRevision", | ||
"metadata": { | ||
"name": "kubescape" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
8 changes: 8 additions & 0 deletions
8
...rollerrevision-in-default-namespace/test/controllerrevision/input/controllerrevision.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,8 @@ | ||
apiVersion: apps/v1 | ||
kind: ControllerRevision | ||
metadata: | ||
name: kubescape | ||
namespace: default | ||
revision: 1 | ||
data: | ||
raw: Serialized-Object |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
rules/csistoragecapacity-in-default-namespace/rule.metadata.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "csistoragecapacity-in-default-namespace", | ||
"attributes": { | ||
"armoBuiltin": true | ||
}, | ||
"ruleLanguage": "Rego", | ||
"match": [ | ||
{ | ||
"apiGroups": [ | ||
"storage.k8s.io" | ||
], | ||
"apiVersions": [ | ||
"v1beta1" | ||
], | ||
"resources": [ | ||
"CSIStorageCapacity" | ||
] | ||
} | ||
], | ||
"ruleDependencies": [ | ||
], | ||
"description": "", | ||
"remediation": "", | ||
"ruleQuery": "armo_builtins" | ||
} |
23 changes: 23 additions & 0 deletions
23
rules/csistoragecapacity-in-default-namespace/test/csistoragecapacity/expected.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"alertMessage": "CSIStorageCapacity: kubescape is in the 'default' namespace", | ||
"failedPaths": [ | ||
"metadata.namespace" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 3, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "storage.k8s.io/v1beta1", | ||
"kind": "CSIStorageCapacity", | ||
"metadata": { | ||
"name": "kubescape" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
9 changes: 9 additions & 0 deletions
9
...toragecapacity-in-default-namespace/test/csistoragecapacity/input/csistoragecapacity.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,9 @@ | ||
apiVersion: storage.k8s.io/v1beta1 | ||
kind: CSIStorageCapacity | ||
metadata: | ||
name: kubescape | ||
namespace: default | ||
topology: | ||
segments: | ||
topology.storage.k8s.io/zone: us-east-1a | ||
storageClassName: example-storageclass |
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,25 @@ | ||
{ | ||
"name": "endpoints-in-default-namespace", | ||
"attributes": { | ||
"armoBuiltin": true | ||
}, | ||
"ruleLanguage": "Rego", | ||
"match": [ | ||
{ | ||
"apiGroups": [ | ||
"" | ||
], | ||
"apiVersions": [ | ||
"v1" | ||
], | ||
"resources": [ | ||
"Endpoints" | ||
] | ||
} | ||
], | ||
"ruleDependencies": [ | ||
], | ||
"description": "", | ||
"remediation": "", | ||
"ruleQuery": "armo_builtins" | ||
} |
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
10 changes: 10 additions & 0 deletions
10
rules/endpoints-in-default-namespace/test/endpoints/input/endpoints.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,10 @@ | ||
apiVersion: v1 | ||
kind: Endpoints | ||
metadata: | ||
name: kubescape | ||
namespace: default | ||
subsets: | ||
- addresses: | ||
- ip: 192.0.2.42 | ||
ports: | ||
- port: 9376 |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
rules/endpointslice-in-default-namespace/rule.metadata.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "endpointslice-in-default-namespace", | ||
"attributes": { | ||
"armoBuiltin": true | ||
}, | ||
"ruleLanguage": "Rego", | ||
"match": [ | ||
{ | ||
"apiGroups": [ | ||
"discovery.k8s.io" | ||
], | ||
"apiVersions": [ | ||
"v1" | ||
], | ||
"resources": [ | ||
"EndpointSlice" | ||
] | ||
} | ||
], | ||
"ruleDependencies": [ | ||
], | ||
"description": "", | ||
"remediation": "", | ||
"ruleQuery": "armo_builtins" | ||
} |
23 changes: 23 additions & 0 deletions
23
rules/endpointslice-in-default-namespace/test/endpointslice/expected.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"alertMessage": "EndpointSlice: kubescape is in the 'default' namespace", | ||
"failedPaths": [ | ||
"metadata.namespace" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 3, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "discovery.k8s.io/v1", | ||
"kind": "EndpointSlice", | ||
"metadata": { | ||
"name": "kubescape" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
14 changes: 14 additions & 0 deletions
14
rules/endpointslice-in-default-namespace/test/endpointslice/input/endpointslice.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,14 @@ | ||
apiVersion: discovery.k8s.io/v1 | ||
kind: EndpointSlice | ||
metadata: | ||
name: kubescape | ||
namespace: default | ||
addressType: IPv4 | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
endpoints: | ||
- addresses: ["10.1.2.3"] | ||
conditions: | ||
ready: true |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
rules/horizontalpodautoscaler-in-default-namespace/rule.metadata.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "horizontalpodautoscaler-in-default-namespace", | ||
"attributes": { | ||
"armoBuiltin": true | ||
}, | ||
"ruleLanguage": "Rego", | ||
"match": [ | ||
{ | ||
"apiGroups": [ | ||
"autoscaling" | ||
], | ||
"apiVersions": [ | ||
"v2" | ||
], | ||
"resources": [ | ||
"HorizontalPodAutoscaler" | ||
] | ||
} | ||
], | ||
"ruleDependencies": [ | ||
], | ||
"description": "", | ||
"remediation": "", | ||
"ruleQuery": "armo_builtins" | ||
} |
23 changes: 23 additions & 0 deletions
23
...s/horizontalpodautoscaler-in-default-namespace/test/horizontalpodautoscaler/expected.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"alertMessage": "HorizontalPodAutoscaler: kubescape is in the 'default' namespace", | ||
"failedPaths": [ | ||
"metadata.namespace" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 3, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "autoscaling/v2", | ||
"kind": "HorizontalPodAutoscaler", | ||
"metadata": { | ||
"name": "kubescape" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
13 changes: 13 additions & 0 deletions
13
...aler-in-default-namespace/test/horizontalpodautoscaler/input/horizontalpodautoscaler.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,13 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: kubescape | ||
namespace: default | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: my-application | ||
minReplicas: 1 | ||
maxReplicas: 10 | ||
targetCPUUtilizationPercentage: 50 |
Oops, something went wrong.