Skip to content

PBM-1268 Securely Store CLI Credentials using systemd#348

Merged
rasika-chivate merged 30 commits intomainfrom
PBM-1268-Securely-Store-CLI-Credentials-using-systemd
Apr 2, 2026
Merged

PBM-1268 Securely Store CLI Credentials using systemd#348
rasika-chivate merged 30 commits intomainfrom
PBM-1268-Securely-Store-CLI-Credentials-using-systemd

Conversation

@rasika-chivate
Copy link
Copy Markdown
Collaborator

Securely Store PBM Agent and CLI Credentials using systemd Service Credentials.

For a deeper dive into the details, check out the ticket here:

Explore the ticket for PBM-1268 and get all the insights you need!

@rasika-chivate rasika-chivate temporarily deployed to PBM-1268-Securely-Store-CLI-Credentials-using-systemd - pbm-docs PR #348 March 19, 2026 09:47 — with Render Destroyed
@rasika-chivate rasika-chivate temporarily deployed to PBM-1268-Securely-Store-CLI-Credentials-using-systemd - pbm-docs PR #348 March 19, 2026 10:45 — with Render Destroyed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation for securing PBM agent/CLI credentials using systemd’s encrypted service credentials, and surfaces that guidance from the existing authentication docs.

Changes:

  • Add a new install guide describing how to encrypt PBM connection configuration with systemd-creds and load it via LoadCredentialEncrypted.
  • Link the new guide into the MkDocs navigation under “Set up and configure”.
  • Add a security warning to discourage plaintext credential storage in environment files.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
mkdocs-base.yml Adds the new systemd-credentials guide to the left-nav.
docs/install/secure-credentials-systemd.md New procedural documentation for using systemd encrypted credentials with pbm-agent.
docs/install/configure-authentication.md Adds a warning recommending systemd credentials over plaintext env vars.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rasika-chivate rasika-chivate temporarily deployed to PBM-1268-Securely-Store-CLI-Credentials-using-systemd - pbm-docs PR #348 March 20, 2026 08:30 — with Render Destroyed
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

@rasika-chivate I've opened a new pull request, #349, to work on those changes. Once the pull request is ready, I'll request review from you.

@rasika-chivate rasika-chivate temporarily deployed to PBM-1268-Securely-Store-CLI-Credentials-using-systemd - pbm-docs PR #348 April 1, 2026 06:10 — with Render Destroyed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@rasika-chivate Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ced89b67-97cd-4958-9fef-150addf7608f

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@rasika-chivate Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ced89b67-97cd-4958-9fef-150addf7608f

Sorry for the inconvenience!

3 similar comments
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@rasika-chivate Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ced89b67-97cd-4958-9fef-150addf7608f

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@rasika-chivate Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ced89b67-97cd-4958-9fef-150addf7608f

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@rasika-chivate Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ced89b67-97cd-4958-9fef-150addf7608f

Sorry for the inconvenience!

@rasika-chivate rasika-chivate requested a review from Copilot April 1, 2026 06:11
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@rasika-chivate Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: ced89b67-97cd-4958-9fef-150addf7608f

Sorry for the inconvenience!

…s to other credentials

Agent-Logs-Url: https://github.com/percona/pbm-docs/sessions/67e80530-fa05-4022-bb93-dc886f07bd31

Co-authored-by: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

[Service]
LoadCredentialEncrypted=pbm_connection.yaml:/path/to/pbm_connection.yaml.cred
PrivateMounts=yes
ExecStart=/usr/bin/pbm-agent -f %d/pbm_connection.yaml
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Step 4 references an “earlier How to find the environment file section”, but that section doesn’t exist on this page. Please either link directly to the relevant section in configure-authentication.md (or another page), or rephrase/remove the reference so the instructions are self-contained.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

Removed the reference to the non-existent section. Step 4 now directly lists the distro-specific paths: /lib/systemd/system/pbm-agent.service for Debian/Ubuntu and /usr/lib/systemd/system/pbm-agent.service for RHEL-based distributions. Committed in 46db4f5.

Comment on lines +77 to +81
4. Edit the systemd unit file (for example, `/lib/systemd/system/pbm-agent.service` or `/usr/lib/systemd/system/pbm-agent.service`, depending on your distribution; see the earlier *How to find the environment file* section) and in the `[Service]` section, add the `LoadCredentialEncrypted` and `PrivateMounts` directives:

```
[Service]
LoadCredentialEncrypted=pbm_connection.yaml:/path/to/pbm_connection.yaml.cred
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The wording “Securely delete the plain text file” is stronger than what shred can guarantee on some filesystems (e.g., copy-on-write / journaling). Consider softening this to “remove”/“best-effort overwrite” and/or add a brief note that secure deletion depends on filesystem/storage characteristics.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

@rasika-chivate rasika-chivate temporarily deployed to PBM-1268-Securely-Store-CLI-Credentials-using-systemd - pbm-docs PR #348 April 1, 2026 06:26 — with Render Destroyed
Storing credentials in plaintext significantly increases the risk of compromise. Secrets placed in configuration files or environment variables can be exposed through:

- File access
- Process inspection (e.g., `ps`, `/proc`)
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.

should this be fixed according to Vale's suggestion?

Copy link
Copy Markdown
Contributor

@radoslawszulgo radoslawszulgo left a comment

Choose a reason for hiding this comment

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

looks good to me.

@rasika-chivate rasika-chivate merged commit b12ddc0 into main Apr 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants