You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/codeql-analysis.yml
+3-3
Original file line number
Diff line number
Diff line change
@@ -46,11 +46,11 @@ jobs:
46
46
# If you wish to specify custom queries, you can do so here or in a config file.
47
47
# By default, queries listed here will override any specified in a config file.
48
48
# Prefix the list here with "+" to use these queries and those in the config file.
49
-
49
+
50
50
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51
51
# queries: security-extended,security-and-quality
52
52
53
-
53
+
54
54
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55
55
# If this step fails, then you should remove it and run the build manually (see below)
56
56
- name: Autobuild
@@ -59,7 +59,7 @@ jobs:
59
59
# ℹ️ Command-line programs to run using the OS shell.
60
60
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
61
61
62
-
# If the Autobuild fails above, remove it and uncomment the following three lines.
62
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
63
63
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
Make sure you have an active account at AWS for which you have configured the credentials on the system where you will execute the steps below. In this example we stored the credentials under an aws profile as `awsuser`.
21
21
@@ -55,6 +55,7 @@ Your EKS cluster should be visible in [EU-West-1](https://eu-west-1.console.aws.
55
55
Are you done playing? Please run `terraform destroy` twice to clean up.
56
56
57
57
### Test it
58
+
58
59
When you have completed the installation steps, you can do `kubectl port-forward service/wrongsecrets-balancer 3000:3000` and then go to [http://localhost:3000](http://localhost:3000).
59
60
60
61
Want to know how well your cluster is holding up? Check with
@@ -64,14 +65,33 @@ Want to know how well your cluster is holding up? Check with
64
65
kubectl top pods
65
66
```
66
67
68
+
### Configuring CTFd
69
+
70
+
You can use the [Juiceshop CTF CLI](https://github.com/juice-shop/juice-shop-ctf) to generate CTFd configuration files.
juice-shop-ctf #choose ctfd and https://wrongsecrets-ctf.herokuapp.com as domain. No trailing slash! The key is 'test', by default feel free to enable hints. We do not support snippets or links/urls to code or hints.
77
+
```
78
+
79
+
Now visit the CTFd instance and setup your CTF. If you haven't set up a load balancer/ingress, the you can use `kubectl port-forward -n ctfd $(kubectl get pods --namespace ctfd -l "app.kubernetes.io/name=ctfd,app.kubernetes.io/instance=ctfd" -o jsonpath="{.items[0].metadata.name}") 8000:8000` and go to `localhost:8000` to visit CTFd.
80
+
81
+
_!!NOTE:_**The following can be dangerous if you use CTFd `>= 3.5.0` with wrongsecrets `< 1.5.11`. Check the `challenges.json` and make sure it's 1-indexed - a 0-indexed file will break CTFd!**_/NOTE!!_
82
+
83
+
Then use the administrative backup function to import the zipfile you created with the juice-shop-ctf command.
84
+
After that you will still need to override the flags with their actual values if you do use the 2-domain configuration.
85
+
Want to setup your own? You can! Watch out for people finding your key though, so secure it properly: make sure the running container with the actual ctf-key is not exposed to the audience, similar to our heroku container.
86
+
67
87
### Clean it up
68
88
69
89
When you're done:
70
90
71
91
1. Kill the port forward.
72
92
2. Run the cleanup script: `cleanup-aws-autoscaling-and-helm.sh`
73
93
3. Run `terraform destroy` to clean up the infrastructure.
74
-
1. If you've deployed the `shared-state` s3 bucket, also `cd shared-state` and `terraform destroy` there.
94
+
1. If you've deployed the `shared-state` s3 bucket, also `cd shared-state` and `terraform destroy` there.
75
95
4. Run `unset KUBECONFIG` to unset the KUBECONFIG env var.
76
96
5. Run `rm ~/.kube/wrongsecrets` to remove the kubeconfig file.
77
97
6. Run `rm terraform.tfstate*` to remove local state files.
@@ -96,6 +116,7 @@ Do the following:
96
116
Note that you might have to do some manual cleanups after that.
97
117
98
118
## Terraform documentation
119
+
99
120
The documentation below is auto-generated to give insight on what's created via Terraform.
100
121
101
122
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
@@ -120,41 +141,52 @@ The documentation below is auto-generated to give insight on what's created via
|[aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones)| data source |
145
173
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity)| data source |
174
+
|[aws_iam_policy_document.assume_role_for_secret_reader](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
146
175
|[aws_iam_policy_document.assume_role_with_oidc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
147
176
|[aws_iam_policy_document.secret_manager](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
177
+
|[aws_iam_policy_document.state_user_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
148
178
|[aws_iam_policy_document.user_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
149
179
|[aws_iam_policy_document.user_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
180
+
|[aws_iam_policy_document.user_secret_reader](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document)| data source |
150
181
|[http_http.ip](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http)| data source |
151
182
152
183
## Inputs
153
184
154
185
| Name | Description | Type | Default | Required |
| <aname="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name)| The EKS cluster name |`string`|`"wrongsecrets-exercise-cluster"`| no |
157
-
| <aname="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version)| The EKS cluster version to use |`string`|`"1.22"`| no |
188
+
| <aname="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version)| The EKS cluster version to use |`string`|`"1.23"`| no |
189
+
| <aname="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 |
158
190
| <aname="input_region"></a> [region](#input\_region)| The AWS region to use |`string`|`"eu-west-1"`| no |
0 commit comments