Skip to content

Commit

Permalink
Merge branch 'feature/services' of github.com:kubescape/regolibrary i…
Browse files Browse the repository at this point in the history
…nto feature/services
  • Loading branch information
amitschendel committed Jul 14, 2024
2 parents 759dc32 + 81e9cff commit 81992f3
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
8 changes: 8 additions & 0 deletions controls/C-0274-unauthenticatedservice.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"attributes": {
"controlTypeTags": [
"security"
],
"attackTracks": [
{
"attackTrack": "workload-external-track",
"categories": [
"Data Collection"
]
}
]
},
"rulesNames": [
Expand Down
5 changes: 3 additions & 2 deletions rules/unauthenticated-service/test/service/expected.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
[{
"alertMessage": "Unauthenticated service operator exposes operator",
"alertObject": {
"k8sApiObjects": [
Expand Down Expand Up @@ -80,4 +80,5 @@
],
"reviewPaths": ["spec"],
"ruleStatus": ""
}
}
]
18 changes: 18 additions & 0 deletions rules/unauthenticated-service/test/service/input/operator2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kubescape.io/v1
kind: ServiceScanResult
metadata:
creationTimestamp: "2024-07-03T04:40:17Z"
generation: 4
name: operator2
namespace: kubescape
resourceVersion: "2772"
uid: 24dc622d-ee78-40c2-8654-2a5604715f95
spec:
clusterIP: 10.103.207.220
ports:
- applicationLayer: ""
authenticated: true
port: 4002
presentationLayer: http
protocol: TCP
sessionLayer: tcp
17 changes: 17 additions & 0 deletions rules/unauthenticated-service/test/service/input/pod2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Pod
metadata:
name: operator2
namespace: kubescape
labels:
app: operator2
spec:
containers:
- name: operator-container
image: your-operator-image:latest
ports:
- containerPort: 8080
resources:
limits:
cpu: "1"
memory: "1Gi"
12 changes: 12 additions & 0 deletions rules/unauthenticated-service/test/service/input/service2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: operator2
namespace: kubescape
spec:
selector:
app: operator2
ports:
- protocol: TCP
port: 4002
targetPort: 8080

0 comments on commit 81992f3

Please sign in to comment.