Open regevnoam1 opened 2 weeks ago
Code Snippet template for creating the static file:
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
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
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.