Skip to content

Add warning against using weak SHA-1 File Catalog - #27805

Open
Anam Navied (anamnavi) wants to merge 4 commits into
PowerShell:masterfrom
anamnavi:cataloghelper-version-warning
Open

Add warning against using weak SHA-1 File Catalog#27805
Anam Navied (anamnavi) wants to merge 4 commits into
PowerShell:masterfrom
anamnavi:cataloghelper-version-warning

Conversation

@anamnavi

@anamnavi Anam Navied (anamnavi) commented Aug 10, 2026

Copy link
Copy Markdown
Member

PR Summary

Add warning against using weak SHA-1 File Catalog

PR Context

PR Checklist

Copilot AI lite review requested due to automatic review settings August 10, 2026 19:47
@anamnavi
Anam Navied (anamnavi) requested a review from a team as a code owner August 10, 2026 19:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

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.

Pull request overview

This PR adds an advisory warning when New-FileCatalog/Test-FileCatalog operate on legacy catalog version 1 (SHA-1), encouraging use of catalog version 2 (SHA-256) without breaking compatibility.

Changes:

  • Added a helper to emit a warning when the catalog version indicates SHA-1 (legacy v1).
  • Invoked the warning during both catalog generation and validation flows.
  • Added a new localized resource string for the warning text.

Reviewed changes

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

File Description
src/System.Management.Automation/security/CatalogHelper.cs Adds and invokes a warning helper for legacy (v1/SHA-1) catalogs during generate/validate operations.
src/System.Management.Automation/resources/CatalogStrings.resx Introduces the user-facing warning string used by the cmdlet warning stream.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/System.Management.Automation/security/CatalogHelper.cs
Comment thread src/System.Management.Automation/resources/CatalogStrings.resx Outdated
Comment thread src/System.Management.Automation/security/CatalogHelper.cs

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.

LGTM!

Comment thread src/System.Management.Automation/resources/CatalogStrings.resx Outdated
<value>Catalog version is not valid. We only support catalog version {0} and version {1}.</value>
</data>
<data name="WeakCatalogHashAlgorithm" xml:space="preserve">
<value>'{0}' is a version 1 catalog that uses SHA1. Consider regenerating this catalog with -CatalogVersion 2.</value>

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.

Suggested change
<value>'{0}' is a version 1 catalog that uses SHA1. Consider regenerating this catalog with -CatalogVersion 2.</value>
<value>'{0}' is a version 1 catalog that uses SHA1. Consider regenerating this catalog with '-CatalogVersion 2'.</value>

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.

5 participants