-
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 #471 from kubescape/C-0012-hot-fix
add check for env values for wl
- Loading branch information
Showing
5 changed files
with
158 additions
and
5 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
26 changes: 26 additions & 0 deletions
26
rules/rule-credentials-in-env-var/test/deployment/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,26 @@ | ||
[ | ||
{ | ||
"alertMessage": "Deployment: test2 has sensitive information in environment variables", | ||
"failedPaths": [ | ||
"spec.template.spec.containers[1].env[1].name" | ||
], | ||
"fixPaths": [], | ||
"ruleStatus": "", | ||
"packagename": "armo_builtins", | ||
"alertScore": 9, | ||
"alertObject": { | ||
"k8sApiObjects": [ | ||
{ | ||
"apiVersion": "apps/v1", | ||
"kind": "Deployment", | ||
"metadata": { | ||
"labels": { | ||
"app": "audit-pod" | ||
}, | ||
"name": "test2" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] |
36 changes: 36 additions & 0 deletions
36
rules/rule-credentials-in-env-var/test/deployment/input/deployment.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,36 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: default | ||
name: test2 | ||
labels: | ||
app: audit-pod | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: audit-pod | ||
template: | ||
metadata: | ||
labels: | ||
app: audit-pod | ||
spec : | ||
containers : | ||
- | ||
name : test-container | ||
env : | ||
- | ||
name : random | ||
value : "Hello from the environment" | ||
image : hashicorp/http-echo:0.2.3 | ||
securityContext : | ||
allowPrivilegeEscalation : true | ||
- | ||
name : test-container2 | ||
env : | ||
- | ||
name : bla | ||
value : "Hello from the environment" | ||
- name : some-name | ||
value : JWT | ||
image : hashicorp/http-echo:0.2.3 |
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