aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.66k stars 578 forks source link

How to get result to a file by using `docker run` ? #476

Closed NickYan7 closed 2 years ago

NickYan7 commented 2 years ago

What are you trying to achieve

To get a report file, or redirect result to a file when I use kube-hunter by docker run.

Minimal example (if applicable)

Nice job! And how can I redirect the result when I use docker to deploy the kube-hunter? Such as I execute docker run -it --rm --network host xxx/kube-hunter, the --log-file is not work... If I execute docker run -it --rm --network host xxx/kube-hunter > ./result.txt, it won't accept the any parameter so that I can't use kube-hunter by option 2 (Interface Scaning).

I also tried echo 2 | docker run -it --rm --network host xxx/kube-hunter > ./scan_result.txt, it is not work although... πŸ˜‚ Screenshot 2021-08-24 δΈ‹εˆ3 12 15

Check this please, thanks a lot

@milindchawre

NickYan7 commented 2 years ago

Fine, I work out finally... To get the result by executing docker run, we can execute the command without --rm, then execute docker logs.

such as: docker run --name kube-test -it --network host xxx/kube-hunter then: docker logs kube-test