Skip to content

Commit bdfd80c

Browse files
authored
Merge pull request #666 from OWASP/update-k8s
update k8s to 1.30 on all platforms
2 parents 6d23ee0 + 11902e7 commit bdfd80c

27 files changed

+114
-108
lines changed

.github/workflows/minikube-k8s-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
- name: Start minikube
2424
uses: medyagh/setup-minikube@master
2525
with:
26-
minikube-version: 1.31.2
26+
minikube-version: 1.33.1
2727
driver: docker
28-
kubernetes-version: v1.28.1
28+
kubernetes-version: v1.30.0
2929
- name: test script
3030
run: |
3131
eval $(minikube docker-env)
@@ -48,9 +48,9 @@ jobs:
4848
- name: Start minikube
4949
uses: medyagh/setup-minikube@master
5050
with:
51-
minikube-version: 1.31.2
51+
minikube-version: 1.33.1
5252
driver: docker
53-
kubernetes-version: v1.28.1
53+
kubernetes-version: v1.30.0
5454
- name: test script
5555
run: |
5656
eval $(minikube docker-env)

aws/.terraform.lock.hcl

Lines changed: 23 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ The documentation below is auto-generated to give insight on what's created via
205205
| Name | Description | Type | Default | Required |
206206
|------|-------------|------|---------|:--------:|
207207
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | The EKS cluster name | `string` | `"wrongsecrets-exercise-cluster"` | no |
208-
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The EKS cluster version to use | `string` | `"1.28"` | no |
208+
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The EKS cluster version to use | `string` | `"1.30"` | no |
209209
| <a name="input_extra_allowed_ip_ranges"></a> [extra\_allowed\_ip\_ranges](#input\_extra\_allowed\_ip\_ranges) | Allowed IP ranges in addition to creator IP | `list(string)` | `[]` | no |
210210
| <a name="input_region"></a> [region](#input\_region) | The AWS region to use | `string` | `"eu-west-1"` | no |
211211
| <a name="input_state_bucket_arn"></a> [state\_bucket\_arn](#input\_state\_bucket\_arn) | ARN of the state bucket to grant access to the s3 user | `string` | n/a | yes |

aws/build-and-deploy-aws.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ else
137137
fi
138138

139139
echo "App password is ${APP_PASSWORD}"
140+
echo "executing helm install of wrongsecrets"
140141
helm upgrade --install wrongsecrets ../helm/wrongsecrets-ctf-party \
141142
--set="balancer.env.K8S_ENV=aws" \
143+
--set="balancer.tag=1.9.0alpha5-cloud" \
142144
--set="balancer.env.IRSA_ROLE=${IRSA_ROLE_ARN}" \
143145
--set="balancer.env.REACT_APP_ACCESS_PASSWORD=${APP_PASSWORD}" \
144146
--set="balancer.env.REACT_APP_S3_BUCKET_URL=s3://${STATE_BUCKET}" \
@@ -152,7 +154,7 @@ export HELM_EXPERIMENTAL_OCI=1
152154
kubectl create namespace ctfd
153155

154156
# Double base64 encoding to prevent weird character errors in ctfd
155-
helm upgrade --install ctfd -n ctfd oci://ghcr.io/bman46/ctfd/ctfd \
157+
helm upgrade --install ctfd -n ctfd oci://ghcr.io/bman46/ctfd/ctfd --version 0.6.3\
156158
--set="redis.auth.password=$(openssl rand -base64 24 | base64)" \
157159
--set="mariadb.auth.rootPassword=$(openssl rand -base64 24 | base64)" \
158160
--set="mariadb.auth.password=$(openssl rand -base64 24 | base64)" \

aws/shared-state/.terraform.lock.hcl

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aws/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variable "region" {
77
variable "cluster_version" {
88
description = "The EKS cluster version to use"
99
type = string
10-
default = "1.28"
10+
default = "1.30"
1111
}
1212

1313
variable "cluster_name" {

azure/README.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Please note that this setup relies on bash scripts that have been tested in MacO
2121

2222
## Installation
2323

24-
**Note-I**: We create resources in `east us` by default. You can set the region by editing `terraform.tfvars`.
24+
**Note-I**: We create resources in `east us` by default. You can set the region by editing [`terraform.tfvars`](./terraform.tfvars).
2525

2626
**Note-II**: The cluster you create has its access bound to the public IP of the creator. In other words: the cluster you create with this code has its access bound to your public IP-address if you apply it locally. If you switched to a different network, you'll need to run `terraform apply` again to update the firewall rules.
2727

@@ -43,34 +43,24 @@ terraform init
4343
terraform apply
4444
```
4545

46-
The storage account name should be in the output. Please use that to configure the Terraform backend in `main.tf` by uncommenting the part on the `backend "azurerm"` inside the `terraform` block. Assign the `storage_account_name` to the one from the output.
46+
The storage account name should be in the output. Please use that to configure the Terraform backend in [`main.tf`](./main.tf) by uncommenting the part on the `backend "azurerm"` inside the `terraform` block. Assign the `storage_account_name` to the one from the output.
4747

4848
**Note**: You'll need to follow the description [below](#wrongsecrets-ctf-party) in step 1 for the "existing resource group" i.e., use the `azurerm_resource_group.default` resource.
4949

5050
### WrongSecrets-ctf-party
5151

52-
1. Set either a new resource group or use an existing resource group in `main.tf` (it defaults to the existing `OWASP-Projects` resource group). Note that you'll need to find/replace references to "azurerm_resource_group.default" to "arurerm_resource_group.default" if you want to create a new one.
52+
1. Set either a new resource group or use an existing resource group in [`main.tf`](main.tf) (it defaults to the existing `OWASP-Projects` resource group). Note that you'll need to find/replace references to `azurerm_resource_group.default` to `data.arurerm_resource_group.default` if you want to create a new one.
5353
2. check whether you have the right project by doing `az account show` (after `az login`). Want to set the project as your default? Use `az account set --subscription <.id here>`.
5454
3. If not yet enabled, register the required services for the subscription, run:
55-
- `az provider register --namespace Microsoft.ContainerService`
56-
- `az provider register --namespace Microsoft.KeyVault`
57-
- `az provider register --namespace Microsoft.ManagedIdentity`
55+
```shell
56+
az provider register --namespace Microsoft.ContainerService
57+
az provider register --namespace Microsoft.KeyVault
58+
az provider register --namespace Microsoft.ManagedIdentity
59+
```
5860
4. Run `terraform init` (if required, use `tfenv` to select TF 0.14.0 or higher )
5961
5. Run `terraform plan` to see what will be created (optional).
6062
6. Run `terraform apply`. Note: the apply will take 5 to 20 minutes depending on the speed of the Azure backplane.
61-
7. Go to the values of the helm chart and replace the wrongsecrets.config with this:
62-
63-
```yaml
64-
K8S_ENV: "azure"
65-
```
66-
67-
and replace the value of wrongsecrets.env having the name 'K8S_ENV' with this:
68-
69-
```yaml
70-
value: "azure"
71-
```
72-
73-
8. Run `./build-and-deploy-azure.sh`. Your kubeconfig file will automatically be updated.
63+
7. Run `./build-and-deploy-azure.sh`. Your kubeconfig file will automatically be updated.
7464

7565
Your AKS cluster should be visible in your resource group. Want a different region? You can modify `terraform.tfvars` or input it directly using the `region` variable in plan/apply.
7666

@@ -206,7 +196,7 @@ No modules.
206196
| Name | Description | Type | Default | Required |
207197
|------|-------------|------|---------|:--------:|
208198
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | The AKS cluster name | `string` | `"wrongsecrets-exercise-cluster"` | no |
209-
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The AKS cluster version to use | `string` | `"1.27"` | no |
199+
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The AKS cluster version to use | `string` | `"1.30"` | no |
210200
| <a name="input_region"></a> [region](#input\_region) | The Azure region to use | `string` | `"East US"` | no |
211201

212202
## Outputs

azure/build-and-deploy-azure.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ esac
3232

3333
echo "This is a script to bootstrap the configuration. You need to have installed: helm, kubectl, vault, grep, cat, sed, envsubst, and azure cli, and is only tested on mac, Debian and Ubuntu"
3434

35+
echo "obtaining the shared state locally, if you use shared state you will see an error below, there is no problem in that case"
3536
# The storage account to store the terraform state file
3637
export AZ_STORAGE_ACCOUNT="$(terraform -chdir=./shared-state output -raw storage_account_name)"
3738

@@ -152,6 +153,7 @@ echo "You can find the app password in password.txt"
152153

153154
helm upgrade --install wrongsecrets ../helm/wrongsecrets-ctf-party \
154155
--set="balancer.env.K8S_ENV=azure" \
156+
--set="balancer.tag=1.9.0alpha5-cloud" \
155157
--set="balancer.env.REACT_APP_AZ_BLOB_URL=https://${AZ_STORAGE_ACCOUNT}.blob.core.windows.net/tfstate" \
156158
--set="balancer.env.REACT_APP_ACCESS_PASSWORD=${APP_PASSWORD}" \
157159
--set="balancer.env.REACT_APP_CREATE_TEAM_HMAC_KEY=${CREATE_TEAM_HMAC}" \

azure/shared-state/.terraform.lock.hcl

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

azure/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variable "region" {
77
variable "cluster_version" {
88
description = "The AKS cluster version to use"
99
type = string
10-
default = "1.27"
10+
default = "1.30"
1111
}
1212

1313
variable "cluster_name" {

0 commit comments

Comments
 (0)