Skip to content

Commit

Permalink
Add repeaters to sqli
Browse files Browse the repository at this point in the history
  • Loading branch information
rielas committed Feb 11, 2025
1 parent 05e2007 commit fb60276
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
31 changes: 20 additions & 11 deletions charts/sqli/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{{- $repeaterIDs := (or (and (hasKey .Values "global") (hasKey .Values.global "repeaterIDs") .Values.global.repeaterIDs) (list .Values.repeaterID)) }}
{{- $token := (or (and (hasKey .Values "global") (hasKey .Values.global "token") .Values.global.token) .Values.token) }}
{{- $cluster := (or (and (hasKey .Values "global") (hasKey .Values.global "cluster") .Values.global.cluster) .Values.cluster) }}
{{- $timeout := (or (and (hasKey .Values "global") (hasKey .Values.global "timeout") .Values.global.timeout) .Values.timeout "30000") }}
{{- $repeaterImageTag := (or (and (hasKey .Values "global") (hasKey .Values.global "repeaterImageTag") .Values.global.repeaterImageTag) .Values.repeaterImageTag "latest") }}

---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -113,28 +119,31 @@ spec:
# command: ["sh", "-c", "curl -k -s http://sqli/Less-1/?id=12"]
# initialDelaySeconds: 120
# periodSeconds: 60
{{- if and .Values.repeaterID .Values.token .Values.cluster }}
- name: repeater
image: brightsec/cli{{ if ne .Values.repeaterImageTag "" }}:{{ .Values.repeaterImageTag }}{{ else }}:latest{{ end }}
{{- if and $token $cluster }}
{{- range $index, $repeaterID := $repeaterIDs }}
- name: repeater-{{ $index }}
image: brightsec/cli:{{ $repeaterImageTag }}
command: ["bright-cli", "repeater"]
args:
- "--token=$(TOKEN)"
- "--id=$(REPEATER_ID)"
- "--cluster=$(CLUSTER)"
- "--timeout=$(TIMEOUT)"
- "--token=$(TOKEN)"
- "--id=$(REPEATER_ID)"
- "--cluster=$(CLUSTER)"
- "--timeout=$(TIMEOUT)"
- "--log-level=verbose"
resources:
requests:
cpu: 200m
memory: 100Mi
env:
- name: REPEATER_ID
value: "{{ .Values.repeaterID }}"
value: "{{ $repeaterID }}"
- name: TOKEN
value: "{{ .Values.token }}"
value: "{{ $token }}"
- name: CLUSTER
value: "{{ .Values.cluster }}"
value: "{{ $cluster }}"
- name: TIMEOUT
value: "{{ .Values.timeout | default "30000" }}"
value: "{{ $timeout }}"
{{- end }}
{{- end }}
restartPolicy: Always

Expand Down
3 changes: 2 additions & 1 deletion charts/sqli/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if not (and .Values.repeaterID .Values.token .Values.cluster) }}
{{- $repeaterIDs := (or (and (hasKey .Values "global") (hasKey .Values.global "repeaterIDs") .Values.global.repeaterIDs) (list .Values.repeaterID)) }}
{{- if eq (len $repeaterIDs) 0 }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down

0 comments on commit fb60276

Please sign in to comment.