1
+ # Author: Madhu Akula
2
+ # This program has been created as part of Kubernetes Goat
3
+ # Kubernetes Goat setup and manage vulnerable infrastructure
4
+
5
+ # Checking kubectl setup
6
+ try {
7
+ kubectl.exe version > $null 2>&1
8
+ Write-Host " kubectl.exe setup looks good."
9
+ } catch {
10
+ Write-Host " Error: Could not find kubectl.exe or another error happened, please check kubectl.exe setup."
11
+ exit
12
+ }
13
+
14
+ # Deprecated helm2 scenario
15
+ # Checking helm2 setup
16
+ # try {
17
+ # helm2 --help > $null 2>&1
18
+ # Write-Host "helm2 setup looks good."
19
+ # } catch {
20
+ # Write-Host "Error: Could not find helm2, please check helm2 setup."
21
+ # exit
22
+ # }
23
+ #
24
+ # # helm2 setup
25
+ # Write-Host "setting up helm2 rbac account and initialise tiller"
26
+ # kubectl apply -f scenarios/helm2-rbac/setup.yaml
27
+ # helm2 init --service-account tiller
28
+ #
29
+ # # wait for tiller service to ready
30
+ # Write-Host "waiting for helm2 tiller service to be active."
31
+ # Start-Sleep -Seconds 50
32
+
33
+ # deploying insecure-rbac scenario
34
+ Write-Host " deploying insecure super admin scenario"
35
+ kubectl.exe apply -f scenarios/ insecure- rbac/ setup.yaml
36
+
37
+ # deploying helm chart to verify the setup
38
+ Write-Host " deploying helm chart metadata-db scenario"
39
+ helm install metadata- db scenarios/ metadata- db/
40
+
41
+ # setup the scenarios/configurations
42
+ Write-Host ' deploying the vulnerable scenarios manifests'
43
+ kubectl.exe apply -f scenarios/ batch- check/ job.yaml
44
+ kubectl.exe apply -f scenarios/ build-code / deployment.yaml
45
+ kubectl.exe apply -f scenarios/ cache- store/ deployment.yaml
46
+ kubectl.exe apply -f scenarios/ health- check/ deployment.yaml
47
+ kubectl.exe apply -f scenarios/ hunger- check/ deployment.yaml
48
+ kubectl.exe apply -f scenarios/ internal- proxy/ deployment.yaml
49
+ kubectl.exe apply -f scenarios/ kubernetes- goat- home/ deployment.yaml
50
+ kubectl.exe apply -f scenarios/ poor- registry/ deployment.yaml
51
+ kubectl.exe apply -f scenarios/ system- monitor/ deployment.yaml
52
+ kubectl.exe apply -f scenarios/ hidden - in- layers/ deployment.yaml
53
+
54
+ Write-Host ' Successfully deployed Kubernetes Goat. Have fun learning Kubernetes Security!'
55
+ Write-Host ' Ensure pods are in running status before running access-kubernetes-goat.sh script'
56
+ Write-Host ' Now run the bash access-kubernetes-goat.sh to access the Kubernetes Goat environment.'
0 commit comments