Skip to content

CKS: private registry credentials are written to the node logs, and special characters break node setup #14917

In review

Description

@bhouse-nexthop

Problem

When a CKS cluster is created with a private registry (dockerregistryurl, dockerregistryusername,
dockerregistrypassword):

  1. Every worker and control node runs /opt/bin/setup-containerd from its cloud-config as
    bash -x /opt/bin/setup-containerd. The trace prints each line of the script with its values filled in, so the
    registry user name and password (in plain text, and as the base64 auth string) are written to
    /var/log/cloud-init-output.log on every node.
  2. The registry URL, user name and password are put into the cloud-config by plain text substitution. A double quote,
    backslash, $ or newline in them breaks the generated script or the YAML. The control node template is rendered
    by cloud-init as a Jinja template, so {{, {% or {# in any of these values makes the rendering fail; cloud-init
    then drops the whole cloud-config and the control node is never set up.

/opt/bin/setup-containerd is also mode 0755, and the containerd config it writes the credentials into is 0644.

Steps to reproduce

  1. Create a CKS cluster with a private registry.
  2. On a worker node, sudo grep -c auth /var/log/cloud-init-output.log finds the traced lines with the base64 auth
    string (username/password in plain text on 4.22).
  3. With {{ in the password, the control node does not come up.

Expected

No registry credential in the node logs or in files other users can read, and any character in the registry values
gets to containerd unchanged.

Activity

  1. added this to the 4.22.3 milestone on Dec 2, 2026
  2. github-actions commented on Dec 3, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    When a CKS cluster is created with a private registry, the node setup script runs under bash -x, so the registry user name, password and base64 auth string are written to /var/log/cloud-init-output.log on every node. The same values are substituted as plain text into cloud-config, so quotes, backslashes, $, newlines or Jinja markers in them break node setup. The containerd config that holds the credentials is also world-readable. Open PR #14918 is linked.

    Security handling: this report describes credential exposure in node logs and file permissions. SECURITY.md asks that suspected vulnerabilities be reported privately to security@apache.org and not in public issues. Maintainers should decide whether this report stays public and whether type:security applies.

    📊 Assessment

    Dimension Value Reasoning
    Type type:security Registry credentials are logged and stored with loose permissions
    Component component:cks Node bootstrap and cloud-config rendering
    Severity n/a Not assessed here; depends on the security review above
    Labels type:security, component:cks Based on the issue text
    Coding agent Needs more info Fix touches credential handling and templating; a security review should confirm the change before it is written

    🔗 Similar issues

    💡 Notes and suggestions
    • Reproduction: create a CKS cluster with a private registry, then search /var/log/cloud-init-output.log on a node for the registry's auth string.
    • Any fix should also cover logs that already exist on nodes. The reporter does not say whether they plan to rotate the registry credential.
    • The reporter's test with {{ in the password shows the cloud-config is dropped. Test this case in the fix.

    Generated by Daily Issue Triage · copilot · haiku55 · ~11 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions