Repository navigation
Address CLI configuration-source threat model follow-ups - #21682
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21682Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21682" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Removing the size-limit test leaves successful acquisition of valid configurations larger than 4 MiB without regression coverage, while the retained test exercises only about 70 KiB.
1 open issue
3 files not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/NewCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs: Generated file
What changed in this PR
This PR makes source trust explicit across Aspire CLI configuration, template, and package-source workflows, while keeping configuration validation focused on correctness rather than security guarantees.
Changes:
- Adds a shared localized warning on stderr while preserving existing consent prompts and automation flags.
- Removes the configuration size and Git file-mode restrictions, retaining direct blob reads and configuration validation.
- Updates documentation, localization resources, interaction tests, and SHA-1/SHA-256 end-to-end coverage.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Templating/TemplateEngineFactoryGitTests.cs | Tests warnings before fresh and cached template acquisition. |
| tests/Aspire.Cli.Tests/Snapshots/ConfigSourceServiceTests.Materialize_PersistsDefaultPathAndOmitsUnspecifiedRef.verified.json | Records default-path persistence and omitted ref. |
| tests/Aspire.Cli.Tests/Configuration/ConfigSourceServiceTests.cs | Tests warning timing, deduplication, and persistence. |
| tests/Aspire.Cli.Tests/Configuration/ConfigSourceServiceGitTests.cs | Updates coverage for relaxed blob validation. |
| tests/Aspire.Cli.Tests/Commands/NewCommandTests.cs | Verifies explicit package-source warnings. |
| tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.SourceManagement.cs | Verifies warnings alongside consent behavior. |
| tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.ConfiguredGitSources.cs | Updates warning expectations for repository failures. |
| tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.ConfiguredGitSourceObjects.cs | Updates warning expectations across Git-source scenarios. |
| tests/Aspire.Cli.Tests/Commands/AddCommandTests.cs | Verifies warnings precede package discovery. |
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/ConfigSourceTestContext.cs | Supports selecting the Git object format. |
| tests/Aspire.Cli.EndToEnd.Tests/CustomTemplateTests.cs | Updates terminal expectations for separate warning and prompt. |
| tests/Aspire.Cli.EndToEnd.Tests/ConfigSourceTests.cs | Adds SHA-256 creation and refresh coverage. |
| src/Aspire.Cli/Templating/TemplateEngineFactory.cs | Warns before Git-backed template discovery. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.zh-Hant.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.zh-Hans.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.tr.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.ru.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.pt-BR.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.pl.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.ko.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.ja.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.it.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.fr.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.es.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.de.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/SharedCommandStrings.cs.xlf | Adds the shared warning localization entry. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.zh-Hant.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.zh-Hans.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.tr.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.ru.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.pt-BR.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.pl.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.ko.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.ja.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.it.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.fr.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.es.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.de.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/NewCommandStrings.cs.xlf | Updates the separate trust-confirmation wording. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hant.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hans.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.tr.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ru.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pt-BR.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pl.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ko.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ja.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.it.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.fr.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.es.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.de.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.cs.xlf | Aligns validation messages with relaxed restrictions. |
| src/Aspire.Cli/Resources/SharedCommandStrings.resx | Defines the shared source-trust warning. |
| src/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs | Exposes the shared warning resource. |
| src/Aspire.Cli/Resources/NewCommandStrings.resx | Separates trust confirmation from warning text. |
| src/Aspire.Cli/Resources/NewCommandStrings.Designer.cs | Synchronizes resource documentation comments. |
| src/Aspire.Cli/Resources/ConfigSourceStrings.resx | Updates configuration validation errors. |
| src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs | Synchronizes validation-message documentation. |
| src/Aspire.Cli/Configuration/ConfigSourceService.cs | Adds warnings and removes size and file-mode restrictions. |
| src/Aspire.Cli/Commands/TemplateManagementCommand.cs | Warns before template-source confirmation. |
| src/Aspire.Cli/Commands/NewCommand.cs | Warns for explicit package sources. |
| src/Aspire.Cli/Commands/AddCommand.cs | Warns for explicit package sources. |
| docs/specs/git-templating.md | Documents source trust and warning behavior. |
| docs/specs/cli-config-sources.md | Clarifies trust, blob validation, and recursive-source restrictions. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The added trust warning breaks a symlink-discovery test on symlink-capable hosts, and removing the 4 MiB limit lacks replacement real-Git regression coverage.
1 open issue
1 resolved since last review
3 files not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/NewCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs: Generated file
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
The added trust warning breaks the symlink-rejection test when symlink creation succeeds, and acquisition of valid configurations larger than 4 MiB lacks regression coverage.
3 files not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/NewCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs: Generated file
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Only compilation was reported, leaving terminal interactions and Git interoperability in the revised consent flow and SHA-256 creation/refresh scenarios unverified pending Linux/Docker E2E testing.
3 files not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/NewCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs: Generated file
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Removing the size-limit test leaves no regression coverage proving that a valid configuration source larger than 4 MiB is accepted and parsed correctly.
No open issues 🎉
1 resolved since last review
3 files not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/NewCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs: Generated file
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… policy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Handle the development URL prompt after interactive template selection and align consent assertions and snapshots with persisted opt-outs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
a86cb52 to
151bf96
Compare
Tests selector3 / 100 PR test projects · 4 PR jobs, from 68 changed files. Selected PR test projects (3 / 100)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🔧 🔧 🔧 🔧 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
The changed consent/template-picker flows and SHA-256 creation/refresh scenarios were only compiled, leaving their Linux/Docker runtime behavior unvalidated pending a successful source-build E2E run.
No open issues 🎉
3 files not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/NewCommandStrings.Designer.cs: Generated filesrc/Aspire.Cli/Resources/SharedCommandStrings.Designer.cs: Generated file
Review effort: Balanced
Ankit Jain (radical)
left a comment
There was a problem hiding this comment.
[automated] Approving with two nonblocking follow-ups: regression coverage for configurations larger than 4 MiB, and clarification of the memory-consumption tradeoff.
Could we add a real-Git success test for valid configuration larger than 4 MiB, with a setting near the end verified through acquisition and materialization? This would cover the newly supported input range; the retained large-content test exercises about 70 KiB. This also follows up on the existing coverage request: #21682 (comment).
I have left the memory-consumption question inline. The symlink explanation addresses my earlier question.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Pull request created: #2034
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2034 targeting Adds the shared "Only use sources you trust" warning note to the Note This draft PR needs human review before merging. |


Description
Follow up on the configuration-source threat-model review by making source trust explicit and keeping configuration validation focused on correctness rather than treating it as a security boundary.
aspire newandaspire add.User-facing usage
With an initialization source configured, these existing commands display the shared warning:
The same wording is used when accepting template repositories and explicit package sources.
--yesand--use-config-sourceretain their existing behavior; they do not suppress the warning.Existing command-help excerpts (no options were added):
Security considerations
These changes implement follow-ups from the configuration-source threat-model review; they do not claim final security approval or add source-signing/attestation guarantees. Configuration sources and referenced templates, package feeds, and documentation must be trusted by the user. Content can execute code or influence AI agents.
Retained repository/path, Git-object, JSON, and configuration-shape checks enforce correctness, not source trust. Removing file-mode rejection does not enable symlink traversal: symlink-mode blob contents are validated directly as configuration.
Validation
Passed: 992 tests, 0 failures, 2 skipped.
Passed: localization regeneration, 0 warnings/errors.
Passed: E2E project compilation, 0 warnings/errors.
Linux/Docker E2E tests were not executed because Docker is unavailable in the local environment.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?