cdk-team / CDK

📦 Make security testing of K8s, Docker, and Containerd easier.
https://github.com/cdk-team/CDK/wiki
Apache License 2.0
3.94k stars 544 forks source link

[PERF TODO] Log and output more elegance. #47

Open neargle opened 2 years ago

neargle commented 2 years ago

Requirement:

neargle commented 2 years ago

cdk output not all in stdout:

➜  cdk ./cdk_linux_amd64_thin_upx eva > /tmp/1
2022/05/18 10:33:51 current dir: /root/cdk
2022/05/18 10:33:51 current user: root uid: 0 gid: 0 home: /root
2022/05/18 10:33:51 hostname: VM-4-6-ubuntu
2022/05/18 10:33:51 debian ubuntu 20.04 kernel: 5.4.0-65-generic
2022/05/18 10:33:51 sensitive env found:
    SSH_CLIENT=113.116.63.243 36890 22
2022/05/18 10:33:51 sensitive env found:
    SSH_CONNECTION=113.116.63.243 36890 10.0.4.6 22
2022/05/18 10:33:51 sensitive env found:
    SSH_TTY=/dev/pts/1
2022/05/18 10:33:51 service found in process:
    800 1   sshd
2022/05/18 10:33:51 service found in process:
    845 1   dockerd
2022/05/18 10:33:51 service found in process:
    1431    845 docker-proxy
2022/05/18 10:33:51 service found in process:
    65871   1   docker
2022/05/18 10:33:51 service found in process:
    65896   845 docker-proxy
2022/05/18 10:33:51 service found in process:
    3141627 800 sshd
2022/05/18 10:33:51 service found in process:
    3143372 800 sshd
2022/05/18 10:33:51 available commands:
    curl,wget,nc,netcat,kubectl,docker,find,ps,python3,php,node,npm,apt,dpkg,apache2,ssh,git,vi,capsh,mount,fdisk,gcc,g++,make,base64,python2,python2.7,perl,sudo
2022/05/18 10:33:51 Capabilities hex of Caps(CapInh|CapPrm|CapEff|CapBnd|CapAmb):
2022/05/18 10:33:51 net.ipv4.conf.all.route_localnet = 0
2022/05/18 10:33:51 checking if api-server allows system:anonymous request.
2022/05/18 10:33:52 failed to dial Alibaba Cloud API.
2022/05/18 10:33:53 failed to dial Azure API.
2022/05/18 10:33:53 failed to dial Google Cloud API.
2022/05/18 10:33:54 failed to dial OpenStack API.
2022/05/18 10:33:55 failed to dial Amazon Web Services (AWS) API.
2022/05/18 10:33:56 failed to dial ucloud API.