Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(tool): add netstat,Like "netstat -antup" command. #99

Merged
merged 3 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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|✔||
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var BannerContainerTpl = BannerHeader + `
%s
vi <file> 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 <path> (get|post) <uri> [<data>] Make request to K8s api-server.
Expand Down
2 changes: 2 additions & 0 deletions pkg/tool/kubectl/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"os"
"regexp"
"strings"
"time"

"github.com/cdk-team/CDK/conf"
"github.com/cdk-team/CDK/pkg/errors"
Expand Down Expand Up @@ -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)
Expand Down
Loading