Skip to content

Commit b46598a

Browse files
authored
Bump to xamarin/xamarin-android-tools/main@479931ce; packageSources (#796)
Context: https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610 Context: https://azure.microsoft.com/en-us/resources/3-ways-to-mitigate-risk-using-private-package-feeds/ Context: https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/12676/ncident-help-for-Substitution-attack-risk-from-multiple-package-feeds Changes: dotnet/android-tools@26d65d9...479931c * dotnet/android-tools@479931c [build] Move global.json file to root directory (#106) * dotnet/android-tools@63510cf: [ci] Update packageSources in NuGet.config (#105) * dotnet/android-tools@83ed0a4: Bump ta xamarin/LibZipSharp/1.0.22@9f563dd1 (#104) * dotnet/android-tools@8ea78a4: Add Microsoft.Android.Build.BaseTasks project (#101) * dotnet/android-tools@b2d9fdf: [NDK] Locate and select only compatible NDK versions (#103) * dotnet/android-tools@5ff1702: [tests] Use dotnet test to run AndroidSdk-Tests (#102) * dotnet/android-tools@ad80a42: [ci] Use the new "main" default branch (#100) There is a Package Substitution Attack inherent in NuGet, whereby if multiple package sources provide packages with the same name, it is *indeterminate* which package source will provide the package. For example, consider the [`XliffTasks` package][0], currently provided from the [`dotnet-eng`][1] feed, and *not* present in the NuGet.org feed. If a "hostile attacker" submits an `XliffTasks` package to NuGet.org, then we don't know, and cannot control, whether the build will use the "hostile" `XliffTasks` package from NuGet.org or the "desired" package from `dotnet-eng`. There are two ways to prevent this attack: 1. Use `//packageSources/clear` and have *only one* `//packageSources/add` entry in `NuGet.config` 2. Use `//packageSources/clear` and *fully trust* every `//packageSources/add` entry in `NuGet.config`. `NuGet.org` *cannot* be a trusted source, nor can any feed location which allows "anyone" to add new packages, nor can a feed which itself contains [upstream sources][2]. As the `XliffTasks` package is *not* in `NuGet.org`, option (1) isn't an option. Go with option (2), using the existing `dotnet-eng` source and the new *trusted* [`dotnet-public`][3] package source. [0]: https://github.com/dotnet/xliff-tasks [1]: https://dev.azure.com/dnceng/public/_packaging?_a=feed&feed=dotnet-eng [2]: https://docs.microsoft.com/en-us/azure/devops/artifacts/concepts/upstream-sources?view=azure-devops [3]: https://dev.azure.com/dnceng/public/_packaging?_a=feed&feed=dotnet-public
1 parent ee7b6bb commit b46598a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

NuGet.Config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
-->
77
<configuration>
88
<packageSources>
9+
<clear />
10+
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
911
<!-- For XliffTasks -->
1012
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
1113
</packageSources>

build-tools/automation/azure-pipelines.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ pr:
1616

1717
# Global variables
1818
variables:
19+
RunningOnCI: true
20+
Build.Configuration: Release
1921
DotNetCoreVersion: 3.1.300
20-
HostedMac: Hosted Mac Internal
22+
HostedMacImage: macOS-10.15
2123
HostedWinVS2019: Hosted Windows 2019 with VS2019
2224

2325
jobs:
@@ -91,7 +93,8 @@ jobs:
9193

9294
- job: mac_build
9395
displayName: Mac - Mono
94-
pool: $(HostedMac)
96+
pool:
97+
vmImage: $(HostedMacImage)
9598
timeoutInMinutes: 20
9699
workspace:
97100
clean: all
@@ -140,7 +143,8 @@ jobs:
140143

141144
- job: mac_dotnet_build
142145
displayName: Mac - .NET Core
143-
pool: $(HostedMac)
146+
pool:
147+
vmImage: $(HostedMacImage)
144148
timeoutInMinutes: 20
145149
workspace:
146150
clean: all

build-tools/automation/templates/install-dependencies.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ steps:
66
displayName: Use .NET Core $(DotNetCoreVersion)
77
inputs:
88
version: $(DotNetCoreVersion)
9-
10-
- script: |
11-
dotnet tool install --global boots
12-
boots --stable Mono
13-
displayName: Install Mono-Stable
14-
condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))

0 commit comments

Comments
 (0)