Skip to content

Updated example tokens in swarm docs#6867

Merged
thaJeztah merged 1 commit intomasterfrom
update-swarm-docs
Apr 2, 2026
Merged

Updated example tokens in swarm docs#6867
thaJeztah merged 1 commit intomasterfrom
update-swarm-docs

Conversation

@vallieres
Copy link
Copy Markdown
Contributor

@vallieres vallieres commented Mar 18, 2026

- What I did
Updated old Swarm keys

- How I did it
Manually

- How to verify it
It's only documentation

- Human readable description for the release notes

Removed tokens that looked too much like real Swarm secrets and triggered security tooling

- A picture of a cute animal (not mandatory but encouraged)

@vallieres vallieres requested review from a team and thaJeztah as code owners March 18, 2026 19:06
@vallieres vallieres requested a review from dvdksn March 18, 2026 19:06
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment; also looks like your commit is missing a DCO sign-off causing the DCO check to fail;


We require all commit messages to have a Signed-off-by line with your name
and e-mail (see "Sign your work"
in the CONTRIBUTING.md in this repository), which looks something like:

Signed-off-by: YourFirsName YourLastName <yourname@example.org>

There is no need to open a new pull request, but to fix this (and make CI pass),
you need to amend the commit(s) in this pull request, and "force push" the amended
commit.

Unfortunately, it's not possible to do so through GitHub's web UI, so this needs
to be done through the git commandline.

You can find some instructions in the output of the DCO check (which can be found
in the "checks" tab on this pull request), as well as in the Moby contributing guide.

Steps to do so "roughly" come down to:

  1. Set your name and e-mail in git's configuration:

    git config --global user.name "YourFirstName YourLastName"
    git config --global user.email "yourname@example.org"

    (Make sure to use your real name (not your GitHub username/handle) and e-mail)

  2. Clone your fork locally

  3. Check out the branch associated with this pull request

  4. Sign-off and amend the existing commit(s)

    git commit --amend --no-edit --signoff

    If your pull request contains multiple commits, either squash the commits (if
    needed) or sign-off each individual commit.

  5. Force push your branch to GitHub (using the --force or --force-with-lease flags) to update the pull request.

Let me know if you need help or more detailed instructions!

```console
$ docker swarm join \
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
--token SWMTKN-1-aaa \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use this as replacement; that still shows the "expected" format, and that the token has two components separated by a hyphen (49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv, 8vxv8rssmk743ojnwacrr2e7c), but we truncate the last part (...) which ... probably should make it invalid, so not flagged by scanners

--token SWMTKN-1-aabbccdd00112233aabbccdd00112233aabbccdd00112233aa-aabbccdd00112233...\

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or alternatively, something like this is pretty common. "Middle-out" truncation 😂

Suggested change
--token SWMTKN-1-aaa \
--token SWMTKN-1-49nj1cm***r2e7c \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I wondered if we should keep the "two hyphens after SWMTKN-1-" to make clear; yes, you need the whole token (till the very end!)

Prevent security scanners from detecting them as eaked secrets.

Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: Alexandre Vallières-Lagacé <alexandre.valliereslagace@docker.com>
Signed-off-by: Alexandre Vallières-Lagacé <alexandre@vallier.es>
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I squashed the commits; oh @vallieres I noticed you pushed to a branch in this repository; we normally don't allow that, and use pull requests from forks (I guess you have write access through the security team 😅)

@thaJeztah thaJeztah changed the title Updated Swarm Docs Updated example tokens in swarm docs Apr 2, 2026
@thaJeztah
Copy link
Copy Markdown
Member

LOL; I doubt this will reduce noise though; looks like CoPilot at least is really eager on flagging "secrets", so also flagging example passwords, and fixtures used in our tests 🫠

I'm surprised the format it's matching for Swarm tokens doesn't follow the format, and only seems to check the prefix? The only thing missing is an EICAR somewhere; guess we can add it to complete our bingo card!

Screenshot 2026-04-02 at 15 38 35

@thaJeztah thaJeztah merged commit 7639343 into master Apr 2, 2026
119 of 121 checks passed
@thaJeztah thaJeztah deleted the update-swarm-docs branch April 2, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants