Skip to content

[release/10.1xx] Backport CFSClean network isolation fixes - #12665

Merged
jonathanpeppers merged 4 commits into
release/10.0.1xxfrom
jonathanpeppers-release-cfsclean-audit
Sep 4, 2026
Merged

[release/10.1xx] Backport CFSClean network isolation fixes#12665
jonathanpeppers merged 4 commits into
release/10.0.1xxfrom
jonathanpeppers-release-cfsclean-audit

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

Backports the complete CFSClean/network-isolation set needed by release/10.0.1xx:

The commits remain separate and in dependency order.

Release compatibility

The #12643 cherry-pick produced modify/delete conflicts for two main-only files that do not exist on this release branch:

  • build-tools/automation/azure-pipelines-internal.yaml
  • src/Xamarin.Android.Tools.AndroidSdk/SdkManager.Packages.cs

Both paths remain absent. The first would invent dnceng/internal topology not used by this release branch; the second upstream change was comment-only. The release-applicable shared build-tools/automation/azure-pipelines.yaml policy change was retained unchanged.

CFSClean2 and CFSClean3 are intentionally not listed because they are supplied centrally by PerPipelineRequiredConfig. Retaining Permissive allows required Android SDK/NDK traffic; DefaultDeny Google SDK/NDK telemetry is not a failure for this change.

Validation

  • Microsoft.Android.Sdk.Analysis.Tests: 16 passed, 1 skipped
  • git diff --check origin/release/10.0.1xx...HEAD
  • DevDiv 12278 (Xamarin.Android-PR): build 15200544 — queued on PR merge ref refs/pull/12665/merge
  • DevDiv 11410 (Xamarin.Android): build 15200531 — queued on trusted branch jonathanpeppers-release-cfsclean-audit

Azure results and network-isolation evidence will be updated when both runs complete.

dependabot Bot and others added 4 commits September 3, 2026 11:23
Bumps [external/debugger-libs](https://github.com/mono/debugger-libs) from `f257277` to `e7fbb71`.
- [Commits](mono/debugger-libs@f257277...e7fbb71)

---
updated-dependencies:
- dependency-name: external/debugger-libs
  dependency-version: e7fbb713d156d11193ed404783ad6fe9c4042a6d
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Roslyn analyzer tests acquire `Microsoft.NETCore.App.Ref` at test runtime. The testing library ignored the repository `NuGet.config` and contacted public NuGet infrastructure, producing CFS network-isolation violations on `main`.

Copy the repository NuGet configuration beside the test assembly and configure the analyzer, code-fix, and refactoring verifier types to use it. Runtime reference package acquisition now uses the approved Azure Artifacts feeds already defined by the repository.

The reported `ci.dot.net` and `shavamanifest*.azureedge.net` destinations are aliases associated with the same Azure Front Door event as the `testhost.exe` NuGet request. `asmconfigfiles-prod.azure-api.net` is intentionally unchanged because it originates from the pipeline-injected Geneva `ConfigDownloader.exe` and requires infrastructure remediation outside this repository.

Validation: `dotnet test src\Microsoft.Android.Sdk.Analysis\Tests\Microsoft.Android.Sdk.Analysis.Tests.csproj -c Release -p:RestoreConfigFile=NuGet.config` (16 passed, 1 skipped). A fresh temporary package cache confirmed `Microsoft.NETCore.App.Ref.3.1.0.nupkg` was acquired through the copied approved-feed configuration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- set `networkIsolationPolicy: Permissive,CFSClean` in the shared DevDiv production/PR pipeline entry point
- set the same policy in the separate dnceng/internal production pipeline entry point
- retain `Permissive` so Android SDK/NDK traffic remains available
- rely on centrally required `CFSClean2` and `CFSClean3` instead of listing them in repository YAML
- replace `capital P` with `uppercase P` in an sdkmanager parsing comment to avoid a PoliCheck geopolitical false positive without changing behavior

| Definition | YAML entry point | 1ES template path |
| --- | --- | --- |
| DevDiv `11410` — Xamarin.Android | `build-tools/automation/azure-pipelines.yaml` | Official |
| DevDiv `12278` — Xamarin.Android-PR | `build-tools/automation/azure-pipelines.yaml` | Unofficial |
| dnceng/internal `1644` — dotnet-android-internal | `build-tools/automation/azure-pipelines-internal.yaml` | Official |

The dnceng/internal definition is independent of the DevDiv definitions, so both YAML entry points require an explicit setting. `dotnet-android-tools-official` (`1596`) belongs to the separate `dotnet-android-tools` repository and is not in scope. Public, nightly, API-docs, and Renovate definitions are also unchanged.

This PR is opened from a branch in the main `dotnet/android` repository so trusted/full definitions can validate the submitted commit. The earlier fork PR was closed.

S360 tracks Xamarin.Android (`devdiv/11410`) and Xamarin.Android-PR (`devdiv/12278`). Direct `api.nuget.org` access is classified as a `CFSClean` violation. This change applies the policy without weakening it or adding a public-NuGet allowlist.

Final commit: `b63ae9fd6`.

The pipeline validation builds below ran against implementation commit `2cc30f604c5742141d9cccff57311614362e99c2`; the final commit changes only comment wording to resolve the resulting PoliCheck false positive.

- [Xamarin.Android build 15184305](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=15184305&view=results): `Permissive` and `CFSClean` came from `PipelineArguments`; `CFSClean2` and `CFSClean3` came from `PerPipelineRequiredConfig`. Windows Android preparation succeeded. The run reached a 20-minute Mac .NET timeout after its build/tests had otherwise succeeded; its PoliCheck failure is addressed by the final comment-only commit.
- [Xamarin.Android-PR build 15184306](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=15184306&view=results): the same policy/source composition was applied. `Prepare Solution` downloaded 15 Android archives from `dl.google.com`, including `android-ndk-r28c-windows.zip`, and completed successfully with no network-isolation block. Its PoliCheck failure is addressed by the final comment-only commit.
- [dotnet-android-internal build 3064262](https://dev.azure.com/dnceng/internal/_build/results?buildId=3064262&view=results): the same policy/source composition was applied. Its Linux Android archive cache restored successfully, and `make jenkins` actively built native Android targets with the cached SDK CMake and NDK Clang toolchain with no network-isolation or acquisition errors.

Expanded `Start Network Isolation` logs for all three definitions report:

`Policies=[(Permissive:PipelineArguments), (CFSClean:PipelineArguments), ... (CFSClean2:PerPipelineRequiredConfig), (CFSClean3:PerPipelineRequiredConfig)]`

The policy composition and required Android dependency acquisition checks pass; the final comment-only fix removes the observed PoliCheck false positive.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…12544)

## Summary

- update the test Xamarin.Build.Download pin from 0.11.4 to 0.11.6
- expose `XamarinBuildDownloadGoogleMavenRepository` repository-wide through the shared Azure Pipelines variables template
- route eligible Google Maven downloads through dnceng's `dotnet-public-maven` feed
- directly pin the Google Play Services test that would otherwise resolve XBD 0.11.4 transitively

The XBD implementation only rewrites URLs beginning with `https://dl.google.com/dl/android/maven2/`; Android SDK/NDK and partial ZIP URLs such as `dl-ssl.google.com/android/repository/...` remain unchanged.

## Validation

- parsed the shared pipeline variables YAML
- verified an uppercase Azure Pipelines-style environment variable reaches nested `dotnet msbuild` as `$(XamarinBuildDownloadGoogleMavenRepository)`
- built `xa-prep-tasks` and `Xamarin.ProjectTools`
- inspected the relevant NuGet dependency graphs to identify transitive XBD consumers
- migrated Xamarin.Build.Download 0.11.6 through the quarantine feed and verified it is available on dnceng `dotnet-public`

Implementation reference: dotnet/android-libraries@4fe06d5

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 16:25

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.

🟢 Approval recommended

The changes are consistent and self-contained, and the updated test/pipeline configuration correctly routes network-dependent operations through approved feeds while preserving required traffic.

Pull request overview

This PR backports a set of CI/test infrastructure changes to ensure the release/10.1xx branch remains compatible with CFSClean network isolation requirements, avoiding direct access to public NuGet infrastructure while keeping required Android SDK/NDK traffic functional.

Changes:

  • Configure Roslyn analyzer tests to acquire reference assemblies using the repository NuGet.config (copied to test output and consumed via ReferenceAssemblies).
  • Enable networkIsolationPolicy: Permissive,CFSClean in the shared DevDiv pipeline entry point.
  • Update/pin Xamarin.Build.Download usage and add a pipeline variable to support routing eligible Google Maven downloads through the mirror feed.
File summaries
File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs Bumps the test pin for Xamarin.Build.Download to 0.11.6.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs Directly pins Xamarin.Build.Download in a test project’s PackageReferences to avoid relying on transitive resolution.
src/Microsoft.Android.Sdk.Analysis/Tests/Verifiers/CSharpVerifierHelper.cs Introduces a shared DefaultReferenceAssemblies configured to use a copied NuGet.config at test runtime.
src/Microsoft.Android.Sdk.Analysis/Tests/Verifiers/CSharpCodeRefactoringVerifier`1+Test.cs Applies the shared DefaultReferenceAssemblies to refactoring verifier tests.
src/Microsoft.Android.Sdk.Analysis/Tests/Verifiers/CSharpCodeFixVerifier`2+Test.cs Applies the shared DefaultReferenceAssemblies to code-fix verifier tests.
src/Microsoft.Android.Sdk.Analysis/Tests/Verifiers/CSharpAnalyzerVerifier`1+Test.cs Applies the shared DefaultReferenceAssemblies to analyzer verifier tests.
src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj Copies the repository NuGet.config into test output so the verifier helpers can consume it.
build-tools/automation/yaml-templates/variables.yaml Adds a pipeline variable pointing to the dotnet-public-maven mirror feed for XBD Google Maven support.
build-tools/automation/azure-pipelines.yaml Enables networkIsolationPolicy: Permissive,CFSClean in the shared pipeline settings.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Sep 3, 2026
@jonathanpeppers
jonathanpeppers merged commit 31d151e into release/10.0.1xx Sep 4, 2026
2 of 3 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-release-cfsclean-audit branch September 4, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants