Skip to content

Commit

Permalink
修复 auto_escape bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Drun1baby committed Dec 12, 2024
1 parent 18a45fd commit 6ecc021
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/task/auto_escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/cdk-team/CDK/pkg/exploit/persistence"
"log"

"github.com/cdk-team/CDK/conf"
"github.com/cdk-team/CDK/pkg/cli"
"github.com/cdk-team/CDK/pkg/evaluate"
"github.com/cdk-team/CDK/pkg/plugin"
Expand Down Expand Up @@ -109,7 +108,13 @@ func autoEscape(shellCommand string) bool {
// 4. check k8s anonymous login
fmt.Printf("\n[Auto Escape - K8s API Server]\n")
anonymousLogin := evaluate.CheckK8sAnonymousLogin()
privServiceAccount := evaluate.CheckPrivilegedK8sServiceAccount(conf.K8sSATokenDefaultPath)
defaultAccountInfo := GetDefaultK8SAccountInfo()

Check failure on line 111 in pkg/task/auto_escape.go

View workflow job for this annotation

GitHub Actions / Buildable and Runable

undefined: GetDefaultK8SAccountInfo
kubernetesAddress := GetKubernetesAddress()

Check failure on line 112 in pkg/task/auto_escape.go

View workflow job for this annotation

GitHub Actions / Buildable and Runable

undefined: GetKubernetesAddress

privServiceAccount := evaluate.CheckPrivilegedK8sServiceAccount(
CheckPrivilegedK8sServiceAccount(defaultAccountInfo, kubernetesAddress),

Check failure on line 115 in pkg/task/auto_escape.go

View workflow job for this annotation

GitHub Actions / Buildable and Runable

undefined: CheckPrivilegedK8sServiceAccount
)

k8sExploit = privServiceAccount || anonymousLogin

if !k8sExploit {
Expand Down

0 comments on commit 6ecc021

Please sign in to comment.