Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[FEATURE] Declare sensitive variables and redact config output by default

未关闭
#14,356 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, go, yaml
领域
cli, security

调研方向

Start with the docker compose config implementation and its interpolation and extension-field handling, then identify configuration and CLI tests covering resolved output and redaction. Compare candidate declaration syntax and compatibility behavior with existing --quiet and --no-interpolate options. The work is done when sensitive fields redact resolved values by default, an explicit flag restores full output, runtime behavior is unchanged, and tests cover propagation, compatibility, and failure cases.

由索引模型根据 Issue 内容生成。

描述

kind/feature status/0-triage
Problem

docker compose config can print credentials resolved from environment variables. When its output is shared in support tickets, CI logs, or AI coding-agent conversations, those credentials can be accidentally disclosed. This has repeatedly required credential rotation in my workflow.

Existing options such as --quiet and --no-interpolate are helpful, but do not provide the resolved configuration with selective redaction.

Could Compose allow explicitly marking variables as sensitive?

Example configuration

Proposed syntax, not currently supported:

x-sensitive-variables:
  - DB_PASSWORD

services:
  app:
    image: example/app
    environment:
      APP_ENV: production
      DATABASE_URL: "postgresql://app:${DB_PASSWORD}@db/app"

  db:
    image: postgres:17
    environment:
      POSTGRES_PASSWORD: "${DB_PASSWORD}"
Expected behavior

docker compose config would redact sensitive values by default:

# Relevant output excerpt
services:
  app:
    environment:
      APP_ENV: production
      DATABASE_URL: "<redacted>"
  db:
    environment:
      POSTGRES_PASSWORD: "<redacted>"

Sensitivity would propagate through interpolation: any field containing a marked variable would have its entire resulting value redacted, regardless of the field's name.

An explicit flag, such as docker compose config --show-sensitive, would reveal resolved values. Container runtime behavior would remain unchanged.

Question

Would maintainers consider this feature? What declaration syntax and compatibility approach would you prefer, given that older Compose versions would ignore an x- extension and scripts may depend on fully resolved output?

AI disclosure: I used OpenAI Codex to research existing options and help draft this proposal. The request is based on my own workflow.

主要语言
Go
星标
38.4k
派生
5.9k
平均合并
2 天 2 小时
30 天内合并 PR
66

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/compose 的其他 Issue

查看 docker/compose 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。