Skip to content

fixed Create proxy and websocket configuration configmap for wrongsecrets-balancer #252 #758

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v5.0.0
hooks:
- id: check-yaml
exclude: ^(helm/wrongsecrets-ctf-party/templates/|helm/test.tmp.yaml|azure/k8s/)
Expand All @@ -12,7 +12,7 @@ repos:
exclude: ^(src/test/resources/yourkey.txt|src/test/resources/secondkey.txt)
- id: trailing-whitespace
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.71.0
rev: v1.96.2
hooks:
- id: terraform_fmt
- id: terraform_tflint
Expand All @@ -32,7 +32,7 @@ repos:
- "--args=--only=terraform_workspace_remote"
- id: terraform_docs
- repo: https://github.com/norwoodj/helm-docs
rev: v1.2.0
rev: v1.14.2
hooks:
- id: helm-docs
args:
Expand All @@ -46,7 +46,7 @@ repos:
# A base filename makes it relative to each chart directory found
- --template-files=README.md.gotmpl
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
rev: v9.18.0
hooks:
- id: commitlint
stages: [commit-msg]
4 changes: 2 additions & 2 deletions aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Note that you might have to do some manual cleanups after that.

The documentation below is auto-generated to give insight on what's created via Terraform.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -240,4 +240,4 @@ The documentation below is auto-generated to give insight on what's created via
| <a name="output_load_balancer_controller_role_arn"></a> [load\_balancer\_controller\_role\_arn](#output\_load\_balancer\_controller\_role\_arn) | Load balancer controller role arn |
| <a name="output_secrets_manager_secret_name"></a> [secrets\_manager\_secret\_name](#output\_secrets\_manager\_secret\_name) | The name of the secrets manager secret |
| <a name="output_state_bucket_name"></a> [state\_bucket\_name](#output\_state\_bucket\_name) | Terraform s3 state bucket name |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions aws/shared-state/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Terraform documentation
The documentation below is auto-generated to give insight on what's created via Terraform.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -38,4 +38,4 @@ No modules.
|------|-------------|
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | Name of the terraform state bucket |
| <a name="output_s3_bucket_name"></a> [s3\_bucket\_name](#output\_s3\_bucket\_name) | Name of the terraform state bucket |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Note that you might have to do some manual cleanups after that.

The documentation below is auto-generated to give insight on what's created via Terraform.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -213,4 +213,4 @@ No modules.
| <a name="output_tenant_id"></a> [tenant\_id](#output\_tenant\_id) | Azure tenant ID |
| <a name="output_vault_name"></a> [vault\_name](#output\_vault\_name) | Vault name |
| <a name="output_vault_uri"></a> [vault\_uri](#output\_vault\_uri) | Vault URI |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions azure/shared-state/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Terraform documentation
The documentation below is auto-generated to give insight on what's created via Terraform.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -42,4 +42,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_storage_account_name"></a> [storage\_account\_name](#output\_storage\_account\_name) | The generated storage account name |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions gcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Note that you might have to do some manual cleanups after that.

The documentation below is auto-generated to give insight on what's created via Terraform.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -203,4 +203,4 @@ No modules.
| <a name="output_kubernetes_cluster_name"></a> [kubernetes\_cluster\_name](#output\_kubernetes\_cluster\_name) | GKE Cluster Name |
| <a name="output_project_id"></a> [project\_id](#output\_project\_id) | GCloud Project ID |
| <a name="output_region"></a> [region](#output\_region) | GCloud Region |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions gcp/shared-state/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Terraform documentation
The documentation below is auto-generated to give insight on what's created via Terraform.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand Down Expand Up @@ -40,4 +40,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_bucket"></a> [bucket](#output\_bucket) | Terraform backend storage bucket |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,32 @@ data:
"affinity": {{ .Values.wrongsecrets.affinity | toJson }},
"tolerations": {{ .Values.wrongsecrets.tolerations | toJson }},
"runtimeClassName": {{ .Values.wrongsecrets.runtimeClassName | toJson }}
},
"websocket": {
"servicename1:8080": [
"incomingurl1",
"incomingurl2",
"incomingurl3"
],
"serviname2:3000": [
"incomingurl4",
"incomingurl5"
]
},
"proxy": {
"servicename1:8080": [
"incomingurl6",
"incomingurl7"
],
"servicename2:3000": [
"incomingurl8withwildcard"
],
"servicename3(CTFD)": [
"incomingurl9",
"incomingurl10"
],
"servicename4(grafana)": [
"incomingurl10"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@ spec:
securityContext:
{{- omit .Values.balancer.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.balancer.volumeMounts }}
volumeMounts:
{{- toYaml .Values.balancer.volumeMounts | nindent 12 }}
{{- end }}
- name: proxy-config
mountPath: /etc/config
resources:
{{- toYaml .Values.balancer.resources | nindent 12 }}
volumes:
- name: proxy-config
configMap:
name: proxy-config
{{- if .Values.balancer.volumes }}
volumes:
{{- toYaml .Values.balancer.volumes | nindent 8 }}
{{- toYaml .Values.balancer.volumes | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-config
data:
# Example, adjust according to your needs
websocket: |
servicename1:8080:
incomingurl1
incomingurl2
incomingurl3
servicename2:3000
incomingurl4
incomingurl5
proxy: |
servicename1:8080:
incomingurl6
incomingurl7
servicename2:3000:
incomingurl8withwildcard
servicename3(CTFD):
incomingurl9
incomingurl10
servicename4(grafana):
incomingurl11
18 changes: 18 additions & 0 deletions wrongsecrets-balancer/src/proxy/proxy-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-config
data:
proxy-config.yaml: |
websocket:
servicename1:8080:
- /guaclite
- /files/socket.io/
servicename2:3000:
- /another-path
proxy:
servicename1:8080:
- /path1
- /path2
servicename2:3000:
- /another-path
Loading
Loading