From b4071e3f0a1c12e6c1365f0fdcb75a5ed1660720 Mon Sep 17 00:00:00 2001 From: neargle Date: Sat, 6 Apr 2024 15:00:48 +0800 Subject: [PATCH 1/2] fix(eva): long standing timeout in discovery k8s apiserver with sa, error msg: GET, ...connection timed out --- pkg/tool/kubectl/common.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/tool/kubectl/common.go b/pkg/tool/kubectl/common.go index 3940a4f..bcaa132 100644 --- a/pkg/tool/kubectl/common.go +++ b/pkg/tool/kubectl/common.go @@ -26,6 +26,7 @@ import ( "os" "regexp" "strings" + "time" "github.com/cdk-team/CDK/conf" "github.com/cdk-team/CDK/pkg/errors" @@ -139,6 +140,7 @@ func ServerAccountRequest(opts K8sRequestOption) (string, error) { Transport: &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, }, + Timeout: time.Second * 3, } var request *http.Request opts.Method = strings.ToUpper(opts.Method) From aafe2a4e3f93fe2b61683e312937e7061cc4d8cc Mon Sep 17 00:00:00 2001 From: neargle-sandbox-win-tbook Date: Sat, 18 May 2024 16:12:37 +0800 Subject: [PATCH 2/2] feat(tool docs): add netstat document --- README.md | 1 + pkg/cli/banner.go | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index bc1b793..3f2310c 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,7 @@ cdk ps |---|---|---|---| |nc|TCP Tunnel|✔|[link](https://github.com/cdk-team/CDK/wiki/Tool:-nc)| |ps|Process Information|✔|[link](https://github.com/cdk-team/CDK/wiki/Tool:-ps)| +|netstat|Like "netstat -antup" command|✔|| |ifconfig|Network Information|✔|[link](https://github.com/cdk-team/CDK/wiki/Tool:-ifconfig)| |vi|Edit Files|✔|[link](https://github.com/cdk-team/CDK/wiki/Tool:-vi)| |ectl|Unauthorized enumeration of ectd keys|✔|| diff --git a/pkg/cli/banner.go b/pkg/cli/banner.go index 6c61a98..1503943 100644 --- a/pkg/cli/banner.go +++ b/pkg/cli/banner.go @@ -59,6 +59,7 @@ var BannerContainerTpl = BannerHeader + ` %s vi Edit files in container like "vi" command. ps Show process information like "ps -ef" command. + netstat Like "netstat -antup" command. nc [options] Create TCP tunnel. ifconfig Show network information. kcurl (get|post) [] Make request to K8s api-server.