-
Notifications
You must be signed in to change notification settings - Fork 179
Improve Kubeaudit documentation #1867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: the secureCodeBox authors | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| In this example we execute an kubeaudit scan against the intentional vulnerable [juice-shop](https://github.com/juice-shop/juice-shop) | ||
|
|
||
| #### Initialize juice-shop in cluster | ||
|
|
||
| Before executing the scan, make sure to setup juice-shop | ||
|
|
||
| ```bash | ||
| helm upgrade --install juice-shop secureCodeBox/juice-shop --wait | ||
| ``` | ||
|
|
||
| After that you can execute the scan in this directory: | ||
| ```bash | ||
| kubectl apply -f scan.yaml | ||
| ``` | ||
|
|
||
| #### Troubleshooting: | ||
| <b> Make sure to install juice-shop in the same namespace as the scanner!</b> | ||
Zero3141 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| If you juice-shop runs in, e.g., the `kubeaudit-tests` namespace, install the chart and run the scan there too | ||
| ```bash | ||
| # Install HelmChart in kubeaudit-tests namespace | ||
| helm upgrade --install kubeaudit secureCodeBox/kubeaudit -n kubeaudit-tests | ||
| # Run scan in kubeaudit-tests namespace | ||
| kubectl apply -f scan.yaml -n kubeaudit-tests | ||
| ``` | ||
| Also, you must adjust the namespace in the scan.yaml with the `-n` flag. | ||
|
|
||
| Alternatively, you can set the scope of kubeaudit to cluster: | ||
| ```bash | ||
| helm upgrade --install kubeaudit secureCodeBox/kubeaudit -n kubeaudit-tests --set="kubeauditScope=cluster" | ||
| ``` | ||
This file contains hidden or 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,51 @@ | ||
| [{ | ||
| "name": "Namespace \"default\" is missing a Default Deny NetworkPolicy", | ||
| "identified_at": "2023-08-22T12:32:05Z", | ||
| "description": "Namespace is missing a default deny ingress and egress NetworkPolicy.", | ||
| "category": "No Default Deny NetworkPolicy", | ||
| "location": "namespace://default", | ||
| "osi_layer": "NOT_APPLICABLE", | ||
| "severity": "MEDIUM", | ||
| "attributes": { | ||
| "Namespace": "default" | ||
| }, | ||
| "id": "8243db55-e6a1-41fd-97a5-3d7b1736886a", | ||
| "parsed_at": "2023-08-22T12:32:11.395Z" | ||
| }, { | ||
| "name": "Default ServiceAccount uses Automounted Service Account Token", | ||
| "identified_at": "2023-08-22T12:32:05Z", | ||
| "description": "Default service account with token mounted. automountServiceAccountToken should be set to 'false' on either the ServiceAccount or on the PodSpec or a non-default service account should be used.", | ||
| "category": "Automounted ServiceAccount Token", | ||
| "location": null, | ||
| "osi_layer": "NOT_APPLICABLE", | ||
| "severity": "LOW", | ||
| "attributes": {}, | ||
| "id": "5ed793ce-e8c0-4abb-aaf7-2031356b9996", | ||
| "parsed_at": "2023-08-22T12:32:11.395Z" | ||
| }, { | ||
| "name": "NonRoot User not enforced for Container", | ||
| "identified_at": "2023-08-22T12:32:05Z", | ||
| "description": "runAsNonRoot should be set to true or runAsUser should be set to a value > 0 either in the container SecurityContext or PodSecurityContext.", | ||
| "category": "Non Root User Not Enforced", | ||
| "location": "container://juice-shop", | ||
| "osi_layer": "NOT_APPLICABLE", | ||
| "severity": "MEDIUM", | ||
| "attributes": { | ||
| "container": "juice-shop" | ||
| }, | ||
| "id": "6162326e-8d0c-463f-9b0c-147cf04a7a1f", | ||
| "parsed_at": "2023-08-22T12:32:11.395Z" | ||
| }, { | ||
| "name": "Container Uses a non ReadOnly Root Filesystem", | ||
| "identified_at": "2023-08-22T12:32:05Z", | ||
| "description": "readOnlyRootFilesystem is not set in container SecurityContext. It should be set to 'true'.", | ||
| "category": "Non ReadOnly Root Filesystem", | ||
| "location": "container://juice-shop", | ||
| "osi_layer": "NOT_APPLICABLE", | ||
| "severity": "LOW", | ||
| "attributes": { | ||
| "container": "juice-shop" | ||
| }, | ||
| "id": "ea9d6b4a-365b-4fce-99b7-05b0e442db2a", | ||
| "parsed_at": "2023-08-22T12:32:11.395Z" | ||
| }] |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -10,4 +10,4 @@ spec: | |
| scanType: "kubeaudit" | ||
| parameters: | ||
| - "-n" | ||
| - "juice-shop" | ||
| - "default" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.