Added managed identities for ACR container pulls (#3463)

* Update vsts.yaml for Azure Pipelines

* Update vsts.yaml

* Update azure identity versions

* Use the non-deprecated bouncy castle library.

update other outdated deps as well

* fix warnings

---------

Co-authored-by: timtay-microsoft <timtay@microsoft.com>
This commit is contained in:
Eric Wolz 2024-06-20 16:40:53 -07:00 коммит произвёл GitHub
Родитель 5be210c3af
Коммит 14a3512424
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -49,7 +49,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net451' "> <ItemGroup Condition=" '$(TargetFramework)' != 'net451' ">
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.1.3" /> <PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.1.3" />
<PackageReference Include="Azure.Identity" Version="1.11.2" /> <PackageReference Include="Azure.Identity" Version="1.12.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(AZURE_IOT_LOCALPACKAGES)' == '' "> <ItemGroup Condition=" '$(AZURE_IOT_LOCALPACKAGES)' == '' ">

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Azure.Core" Version="1.36.0" /> <PackageReference Include="Azure.Core" Version="1.40.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" /> <PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -7,8 +7,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Azure.Core" Version="1.39.0" /> <PackageReference Include="Azure.Core" Version="1.40.0" />
<PackageReference Include="Azure.Identity" Version="1.11.2" /> <PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" /> <PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -6,7 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BouncyCastle" Version="1.8.9"> <PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0">
<NoWarn>NU1701</NoWarn> <NoWarn>NU1701</NoWarn>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -69,7 +69,7 @@ namespace Microsoft.Azure.Devices.Provisioning.Service.Samples
X509Name issuerName, X509Name issuerName,
AsymmetricKeyParameter privateSigningKey) AsymmetricKeyParameter privateSigningKey)
{ {
var randomGenerator = new CryptoApiRandomGenerator(); using var randomGenerator = new CryptoApiRandomGenerator();
var random = new SecureRandom(randomGenerator); var random = new SecureRandom(randomGenerator);
var certGenerator = new X509V3CertificateGenerator(); var certGenerator = new X509V3CertificateGenerator();
@ -92,11 +92,11 @@ namespace Microsoft.Azure.Devices.Provisioning.Service.Samples
certGenerator.SetNotAfter(notAfter); certGenerator.SetNotAfter(notAfter);
certGenerator.AddExtension( certGenerator.AddExtension(
X509Extensions.ExtendedKeyUsage, X509Extensions.ExtendedKeyUsage,
true, true,
ExtendedKeyUsage.GetInstance(new DerSequence(KeyPurposeID.IdKPClientAuth))); ExtendedKeyUsage.GetInstance(new DerSequence(KeyPurposeID.id_kp_clientAuth)));
ISignatureFactory signatureFactory = ISignatureFactory signatureFactory =
new Asn1SignatureFactory("SHA256WITHECDSA", privateSigningKey, random); new Asn1SignatureFactory("SHA256WITHECDSA", privateSigningKey, random);
Org.BouncyCastle.X509.X509Certificate certificate = certGenerator.Generate(signatureFactory); Org.BouncyCastle.X509.X509Certificate certificate = certGenerator.Generate(signatureFactory);

Просмотреть файл

@ -77,7 +77,7 @@ jobs:
SHOULD_RUN: ${{ eq(variables['testNet80'], 'True') }} SHOULD_RUN: ${{ eq(variables['testNet80'], 'True') }}
pool: pool:
# If this is changed, don't forget to update supported_platforms.md in the root directory. That document outlines what OS we test on and should stay up to date. # If this is changed, don't forget to update supported_platforms.md in the root directory. That document outlines what OS we test on and should stay up to date.
vmImage: ubuntu-20.04 name: 'sdk-net--ubuntu-20'
steps: steps:
- task: PowerShell@2 - task: PowerShell@2
displayName: 'Print vars' displayName: 'Print vars'