Repository navigation
Harden credential store file permissions - #1526
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ea18fbf5-c89f-4955-bd1d-4dfb4c44cdb7
Bhavesh Bhati (bhaveshbhati)
requested review from
UnyieldingAvocado,
mishrarish and
triptijain2112
as code owners
October 7, 2026 12:22
Collaborator
|
Bhavesh Bhati (@bhaveshbhati) Please update PR description related to changes made |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The required corresponding issue and documented approach approval are missing from the PR metadata.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Hardens local Azure DevOps credential storage permissions on POSIX systems.
Changes:
- Restricts configuration directories to
0700. - Restricts PAT files to
0600. - Adds permission and credential-persistence tests.
| File | Description |
|---|---|
dev/common/config.py |
Creates and hardens the config directory. |
dev/common/credential_store.py |
Secures PAT writes and updates warnings. |
tests/latest/common/test_config.py |
Tests directory permissions. |
tests/latest/common/test_credential_store.py |
Tests PAT permissions and persistence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| _UNSET = object() | ||
|
|
||
|
|
||
| def _ensure_private_config_dir(config_dir): |
added 2 commits
October 14, 2026 13:55
Harden existing PAT files before truncating them and add regression coverage for permission failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 43a1d6f4-47fa-405f-a4dc-fb6b93b44ae8
Update the organization list only after credential deletion succeeds, so permission-hardening failures leave the stored PAT discoverable for a later retry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 43a1d6f4-47fa-405f-a4dc-fb6b93b44ae8
triptijain2112
approved these changes
Oct 15, 2026
mishrarish
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Please make sure the code is following contribution guidelines in CONTRIBUTING.md
Summary
PAT-file permission hardening affects only the Linux file-fallback path. Configuration-directory creation is cross-platform, with explicit 0700 enforcement limited to POSIX systems.
Changes
0700.AZURE_DEVOPS_EXT_CONFIG_DIR.personalAccessTokensfiles with permissions0600.0600before truncating or rewriting them.