Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECURITY] Microsoft.Sbom.Targets nuget for package SBOM #26093

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<!-- NuGet package SBOM -->
<GenerateSBOM>true</GenerateSBOM>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
<MicrosoftDotNetBuildTasksWorkloadsPackageVersion>9.0.0-beta.24623.3</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
<MicrosoftDotNetHelixSdkPackageVersion>9.0.0-beta.24623.3</MicrosoftDotNetHelixSdkPackageVersion>
<MicroBuildPluginsSwixBuildDotnetPackageVersion>1.1.87-gba258badda</MicroBuildPluginsSwixBuildDotnetPackageVersion>
<!-- Security SBOM targets-->
<MicrosoftSbomTargetsPackageVersion>3.0.0</MicrosoftSbomTargetsPackageVersion>
<MicrosoftDotNetRemoteExecutorPackageVersion>9.0.0-beta.24623.3</MicrosoftDotNetRemoteExecutorPackageVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>9.0.0-beta.24623.3</MicrosoftDotNetXUnitExtensionsPackageVersion>
</PropertyGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/Controls/Foldable/src/Controls.Foldable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
<Description>Foldable or multi-screen device support for .NET Multi-platform App UI (.NET MAUI) apps.</Description>
</PropertyGroup>
<Import Project="$(MauiSrcDirectory)MultiTargeting.targets" />
<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Comment on lines +27 to +30
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this can be moved to the Directory.Build.targets (or some other better file @rmarinho?) and then just include if the IsPackable property is true?

@rmarinho probably can quickly say what the best option here is now with all the arcade fanciness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. This is something I wasn't sure where to place. Sorry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmarinho probably can quickly say what the best option here is now with all the arcade fanciness.

Sure waiting for input.

Copy link
Member

Choose a reason for hiding this comment

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

yap I agree we should maybe add to the NugetVersion targets ?

https://github.com/dotnet/maui/blob/main/eng/NuGetVersions.targets#L312

</ItemGroup>
<ItemGroup Condition=" '$(UseMaui)' != 'true' ">
<ProjectReference Include="..\..\..\Graphics\src\Graphics\Graphics.csproj" PrivateAssets="all" />
<ProjectReference Include="..\..\..\Controls\src\Core\Controls.Core.csproj" PrivateAssets="all" />
Expand Down
8 changes: 8 additions & 0 deletions src/Controls/Maps/src/Controls.Maps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
</PropertyGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<PropertyGroup>
<!-- NuGet package information -->
<IsPackable>True</IsPackable>
Expand Down
7 changes: 7 additions & 0 deletions src/Controls/src/Core.Design/Controls.Core.Design.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
<Compile Include="VisualDesignTypeConverter.cs" />
<Reference Include="System.Xaml" />
</ItemGroup>
<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.DesignTools.Extensibility" Version="17.5.33428.366" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/Controls/src/Core/Controls.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
Expand Down
8 changes: 8 additions & 0 deletions src/Controls/src/NuGet/Controls.NuGet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
<ProjectReference Include="..\..\..\SingleProject\Resizetizer\src\Resizetizer.csproj" />
</ItemGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Import Project="$(MauiSrcDirectory)Workload\Shared\LibraryPacks.targets" />

</Project>
8 changes: 8 additions & 0 deletions src/Controls/src/Xaml/Controls.Xaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
<ProjectReference Include="..\..\..\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/Core/maps/src/Maps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@

<Import Project="$(MauiSrcDirectory)MultiTargeting.targets" />

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<PackageReference Include="Xamarin.GooglePlayServices.Maps" Version="$(XamarinGooglePlayServicesMaps)" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/Core/src/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<ProjectReference Include="..\..\Graphics\src\Graphics\Graphics.csproj" />
<PackageReference Include="System.Numerics.Vectors" Condition="$(TargetFramework.StartsWith('netstandard'))" />
<PackageReference Include="System.Text.Json" Condition="$(TargetFramework.StartsWith('netstandard'))" />
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<PackageReference Include="Microsoft.WindowsAppSDK" />
Expand Down
7 changes: 7 additions & 0 deletions src/Essentials/src/Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
<Compile Include="**\*.shared.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Include="**\*.shared.*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) ">
<PackageReference Include="System.Numerics.Vectors" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<NoWarn>$(NoWarn);RS0041</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp.Views.Gtk3" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/Graphics/src/Graphics.Skia.WPF/Graphics.Skia.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
</PropertyGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp.Views.WPF" />
</ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions src/Graphics/src/Graphics.Skia/Graphics.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
<Description>.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. This package contains additional graphics and drawing APIs for using the SkiaSharp graphics engine with .NET MAUI Graphics.</Description>
</PropertyGroup>

<ItemGroup>
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/Graphics/src/Graphics.Win2D/Graphics.Win2D.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.Graphics.Win2D" />
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/Graphics/src/Graphics/Graphics.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" Condition="$(TargetFramework.StartsWith('netstandard'))" />
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
Expand Down
5 changes: 5 additions & 0 deletions src/Graphics/src/Text.Markdig/Graphics.Text.Markdig.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

<ItemGroup>
<PackageReference Include="Markdig" Version="0.31.0" />
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/SingleProject/Resizetizer/src/Resizetizer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" PrivateAssets="all" />
<!-- Security SBOM targets -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="$(MicrosoftSbomTargetsPackageVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Import Project="ResizetizerPackages.projitems" />
Expand Down
Loading