Skip to content

Commit

Permalink
Added managed identities for ACR container pulls (#3463)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
ericwolz and timtay-microsoft authored Jun 20, 2024
1 parent 5be210c commit 14a3512
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion e2e/test/E2ETests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net451' ">
<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 Condition=" '$(AZURE_IOT_LOCALPACKAGES)' == '' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Core" Version="1.36.0" />
<PackageReference Include="Azure.Core" Version="1.40.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Core" Version="1.39.0" />
<PackageReference Include="Azure.Identity" Version="1.11.2" />
<PackageReference Include="Azure.Core" Version="1.40.0" />
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle" Version="1.8.9">
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0">
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static X509Certificate2 GenerateAndSignCertificate(
X509Name issuerName,
AsymmetricKeyParameter privateSigningKey)
{
var randomGenerator = new CryptoApiRandomGenerator();
using var randomGenerator = new CryptoApiRandomGenerator();
var random = new SecureRandom(randomGenerator);
var certGenerator = new X509V3CertificateGenerator();

Expand All @@ -92,11 +92,11 @@ private static X509Certificate2 GenerateAndSignCertificate(
certGenerator.SetNotAfter(notAfter);

certGenerator.AddExtension(
X509Extensions.ExtendedKeyUsage,
true,
ExtendedKeyUsage.GetInstance(new DerSequence(KeyPurposeID.IdKPClientAuth)));
X509Extensions.ExtendedKeyUsage,
true,
ExtendedKeyUsage.GetInstance(new DerSequence(KeyPurposeID.id_kp_clientAuth)));

ISignatureFactory signatureFactory =
ISignatureFactory signatureFactory =
new Asn1SignatureFactory("SHA256WITHECDSA", privateSigningKey, random);

Org.BouncyCastle.X509.X509Certificate certificate = certGenerator.Generate(signatureFactory);
Expand Down
2 changes: 1 addition & 1 deletion vsts/vsts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
SHOULD_RUN: ${{ eq(variables['testNet80'], 'True') }}
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.
vmImage: ubuntu-20.04
name: 'sdk-net--ubuntu-20'
steps:
- task: PowerShell@2
displayName: 'Print vars'
Expand Down

0 comments on commit 14a3512

Please sign in to comment.