KubiScan icon indicating copy to clipboard operation
KubiScan copied to clipboard

Added a Static Scan For KubiScan

Open regevnoam1 opened this issue 1 year ago • 1 comments

Implemented Changes

Major Enhancements: Combined File Support: Added support for processing combined JSON/YAML files, enabling the tool to handle aggregated input files that consolidate various Kubernetes resource definitions.

Minor Fixes:

Command-Line Switch Improvements: Fixed the -rp -d switch functionality. CVE File Update: Updated the CVE file to prevent from the program to crash.

Usage Example

To utilize the new combined file support, run the following command: python3 ./KubiScan.py -f /path/to/file/KubiScan/filename.json -rr (or filename.yaml -rr)

Added Images in which format you should create the json or yaml file. image image (1)

regevnoam1 avatar Sep 25 '24 09:09 regevnoam1

Code Snippet template for creating the static file:

For JSON:

echo "[" > combined.json
kubectl get roles --all-namespaces -o json >> combined.json
echo "," >> combined.json
kubectl get rolebindings --all-namespaces -o json >> combined.json
echo "," >> combined.json
kubectl get clusterroles -o json >> combined.json
echo "," >> combined.json
kubectl get clusterrolebindings -o json >> combined.json
echo "," >> combined.json
kubectl get secrets --all-namespaces -o json >> combined.json
echo "," >> combined.json
kubectl get pods --all-namespaces -o json >> combined.json
echo "]" >> combined.json

For YAML:

echo "---" > combined.yaml
kubectl get roles --all-namespaces -o yaml>> combined.yaml
echo "---" >> combined.yaml
kubectl get rolebindings --all-namespaces -o yaml>> combined.yaml
echo "---" >> combined.yaml
kubectl get clusterroles -o yaml>> combined.yaml
echo "---" >> combined.yaml
kubectl get clusterrolebindings -o yaml>> combined.yaml
echo "---" >> combined.yaml
kubectl get secrets --all-namespaces -o yaml>> combined.yaml
echo "---" >> combined.yaml
kubectl get pods --all-namespaces -o yaml>> combined.yaml

regevnoam1 avatar Sep 25 '24 09:09 regevnoam1

New feature for #28

g3rzi avatar Nov 11 '24 05:11 g3rzi