mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-04-16 01:28:26 +00:00
docs(kubernetes): add docs about kubernetes in tutorials page (#4288)
Co-authored-by: Sergio <sergio@prowler.com>
This commit is contained in:
20
docs/tutorials/kubernetes/in-cluster.md
Normal file
20
docs/tutorials/kubernetes/in-cluster.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# In-Cluster Execution
|
||||
|
||||
For in-cluster execution, you can use the supplied yaml files inside `/kubernetes`:
|
||||
|
||||
* [job.yaml](https://github.com/prowler-cloud/prowler/blob/master/kubernetes/job.yaml)
|
||||
* [prowler-role.yaml](https://github.com/prowler-cloud/prowler/blob/master/kubernetes/prowler-role.yaml)
|
||||
* [prowler-rolebinding.yaml](https://github.com/prowler-cloud/prowler/blob/master/kubernetes/prowler-rolebinding.yaml)
|
||||
|
||||
They can be used to run Prowler as a job within a new Prowler namespace:
|
||||
|
||||
```console
|
||||
kubectl apply -f kubernetes/job.yaml
|
||||
kubectl apply -f kubernetes/prowler-role.yaml
|
||||
kubectl apply -f kubernetes/prowler-rolebinding.yaml
|
||||
kubectl get pods --namespace prowler-ns --> prowler-XXXXX
|
||||
kubectl logs prowler-XXXXX --namespace prowler-ns
|
||||
```
|
||||
|
||||
???+ note
|
||||
By default, `prowler` will scan all namespaces in your active Kubernetes context. Use the [`--namespace`](https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/kubernetes/namespace/) flag to specify the namespace(s) to be scanned.
|
||||
23
docs/tutorials/kubernetes/misc.md
Normal file
23
docs/tutorials/kubernetes/misc.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Miscellaneous
|
||||
|
||||
## Context Filtering
|
||||
|
||||
Prowler will scan the active Kubernetes context by default.
|
||||
|
||||
To specify the Kubernetes context to be scanned, use the `--context` flag followed by the desired context name. For example:
|
||||
|
||||
```console
|
||||
prowler --context my-context
|
||||
```
|
||||
|
||||
This will ensure that Prowler scans the specified context/cluster for vulnerabilities and misconfigurations.
|
||||
|
||||
## Namespace Filtering
|
||||
|
||||
By default, `prowler` will scan all namespaces in the context you specify.
|
||||
|
||||
To specify the namespace(s) to be scanned, use the `--namespace` flag followed by the desired namespace(s) separated by spaces. For example:
|
||||
|
||||
```console
|
||||
prowler --namespace namespace1 namespace2
|
||||
```
|
||||
15
docs/tutorials/kubernetes/outside-cluster.md
Normal file
15
docs/tutorials/kubernetes/outside-cluster.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Non in-cluster execution
|
||||
|
||||
For non in-cluster execution, you can provide the location of the [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) file with the following argument:
|
||||
|
||||
```console
|
||||
prowler kubernetes --kubeconfig-file /path/to/kubeconfig
|
||||
```
|
||||
???+ note
|
||||
If no `--kubeconfig-file` is provided, Prowler will use the default KubeConfig file location (`~/.kube/config`).
|
||||
|
||||
???+ note
|
||||
`prowler` will scan the active Kubernetes context by default. Use the [`--context`](https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/kubernetes/context/) flag to specify the context to be scanned.
|
||||
|
||||
???+ note
|
||||
By default, `prowler` will scan all namespaces in your active Kubernetes context. Use the [`--namespace`](https://docs.prowler.com/projects/prowler-open-source/en/latest/tutorials/kubernetes/namespace/) flag to specify the namespace(s) to be scanned.
|
||||
Reference in New Issue
Block a user