-
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 #617 from kubescape/fix-volumes
improve remediations - C-0020, C-0045
- Loading branch information
Showing
6 changed files
with
122 additions
and
126 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
48 changes: 26 additions & 22 deletions
48
rules/alert-mount-potential-credentials-paths/test/pod_eks_failed/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 |
---|---|---|
@@ -1,24 +1,28 @@ | ||
{ | ||
"alertMessage": "Pod: test-pd has: test-volume as volume with potential credentials access.", | ||
"deletePaths": [ | ||
"spec.volumes[0].hostPath.path" | ||
], | ||
"failedPaths": [ | ||
"spec.volumes[0].hostPath.path" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 7, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "v1", | ||
"kind": "Pod", | ||
"metadata": { | ||
"name": "test-pd" | ||
[ | ||
{ | ||
"alertMessage": "Pod: test-pd has: test-volume as volume with potential credentials access.", | ||
"failedPaths": [ | ||
"spec.volumes[0]", | ||
"spec.containers[0].volumeMounts[0]" | ||
], | ||
"deletePaths": [ | ||
"spec.volumes[0]", | ||
"spec.containers[0].volumeMounts[0]" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 7, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "v1", | ||
"kind": "Pod", | ||
"metadata": { | ||
"name": "test-pd" | ||
} | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} | ||
] |
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,44 +1,54 @@ | ||
[{ | ||
"alertMessage": "Deployment: my-deployment has: test-volume as hostPath volume", | ||
"deletePaths": ["spec.template.spec.containers[0].volumeMounts[0].readOnly"], | ||
"failedPaths": ["spec.template.spec.containers[0].volumeMounts[0].readOnly"], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 7, | ||
"alertObject": { | ||
"k8sApiObjects": [{ | ||
"apiVersion": "apps/v1", | ||
"kind": "Deployment", | ||
"metadata": { | ||
"labels": { | ||
"purpose": "demonstrate-command" | ||
}, | ||
"name": "my-deployment" | ||
[ | ||
{ | ||
"alertMessage": "Deployment: my-deployment has: test-volume as hostPath volume", | ||
"fixPaths": [ | ||
{ | ||
"path": "spec.template.spec.containers[0].volumeMounts[0].readOnly", | ||
"value": "true" | ||
} | ||
}] | ||
} | ||
}, { | ||
"alertMessage": "Deployment: my-deployment has: test-volume as hostPath volume", | ||
"deletePaths": [], | ||
"failedPaths": [], | ||
"fixPaths": [{ | ||
"path": "spec.template.spec.containers[0].volumeMounts[1].readOnly", | ||
"value": "true" | ||
}], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 7, | ||
"alertObject": { | ||
"k8sApiObjects": [{ | ||
"apiVersion": "apps/v1", | ||
"kind": "Deployment", | ||
"metadata": { | ||
"labels": { | ||
"purpose": "demonstrate-command" | ||
}, | ||
"name": "my-deployment" | ||
], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 7, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "apps/v1", | ||
"kind": "Deployment", | ||
"metadata": { | ||
"labels": { | ||
"purpose": "demonstrate-command" | ||
}, | ||
"name": "my-deployment" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"alertMessage": "Deployment: my-deployment has: test-volume as hostPath volume", | ||
"fixPaths": [ | ||
{ | ||
"path": "spec.template.spec.containers[0].volumeMounts[1].readOnly", | ||
"value": "true" | ||
} | ||
}] | ||
], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 7, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "apps/v1", | ||
"kind": "Deployment", | ||
"metadata": { | ||
"labels": { | ||
"purpose": "demonstrate-command" | ||
}, | ||
"name": "my-deployment" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}] | ||
] |