Skip to content

[ci] Enable CFSClean network isolation - #12643

Merged
jonathanpeppers merged 5 commits into
mainfrom
jonathanpeppers-enable-android-cfsclean
Sep 2, 2026
Merged

jonathanpeppers merged 5 commits into
mainfrom
jonathanpeppers-enable-android-cfsclean

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • 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

Pipeline coverage

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.

SFI / CFS rationale

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.

Validation evidence

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: 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: 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: 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.

jonathanpeppers and others added 3 commits September 2, 2026 09:00
Explicitly compose CFSClean with Permissive and the existing CFSClean2/CFSClean3 policies for the shared production and PR pipeline definition.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the network isolation policy in the pipeline's existing settings map so Azure template expansion accepts it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
List only Permissive and CFSClean in repository YAML so CFSClean2 and CFSClean3 continue to come from PerPipelineRequiredConfig.

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

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 change is a minimal, targeted pipeline configuration update and matches existing usage of networkIsolationPolicy in the repo with no correctness issues found.

Pull request overview

This PR updates the shared 1ES pipeline entrypoint to explicitly enable the CFSClean network isolation policy (while retaining Permissive) for the Xamarin.Android production and PR Azure DevOps definitions that extend this template.

Changes:

  • Add settings.networkIsolationPolicy: Permissive,CFSClean to the shared build-tools/automation/azure-pipelines.yaml pipeline configuration.
File summaries
File Description
build-tools/automation/azure-pipelines.yaml Explicitly sets the 1ES networkIsolationPolicy to include CFSClean while keeping Permissive.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Apply Permissive and CFSClean at the dnceng/internal 1ES settings boundary while retaining centrally required CFSClean2 and CFSClean3.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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 2, 2026
Use uppercase terminology in the sdkmanager parsing comment while preserving its meaning.

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

// Match section headers case-insensitively: the classic sdkmanager emits
// "Available Packages:" (capital P) while the newer Android CLI replacement
// "Available Packages:" (uppercase P) while the newer Android CLI replacement

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a PoliCheck warning, but ugh I wanted this a separate PR and copilot put it here.

Just a comment, but it's fine, I guess.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@jonathanpeppers
jonathanpeppers merged commit 8eac8ed into main Sep 2, 2026
20 of 44 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-enable-android-cfsclean branch September 2, 2026 21:08
jonathanpeppers added a commit that referenced this pull request Sep 4, 2026
## Summary

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

- #10803 / `1e4bbd9c501098d18c2306d74c2117b725553f8b` — update `mono/debugger-libs` to remove its nested `api.nuget.org` override and use the approved `dotnet-tools` feed
- #12520 / `7c7d207aa8b73eb8e733a9269c5d7e131587096b` — route Roslyn analyzer test reference acquisition through the repository `NuGet.config`
- #12643 / `8eac8ed475d33470319e8ced1040e866c9f01467` — enable `networkIsolationPolicy: Permissive,CFSClean` in the shared DevDiv production/PR pipeline
- #12544 / `adb7d10d80907604727cd415fbb184a33fd0e3d2` — route Xamarin.Build.Download Google Maven requests through `dotnet-public-maven`, update XBD to 0.11.6, and directly pin the transitive test consumer

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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