Skip to content

Commit 758ff4c

Browse files
committed
KX-18441 Sign DLLs using short-lived access tokens
1 parent de81200 commit 758ff4c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.azuredevops/pipelines/build-and-release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ stages:
4747
feedsToUse: select
4848
restoreArguments: --locked-mode
4949

50+
- task: GetAzureAuthToken@5
51+
name: KeyVaultToken
52+
displayName: Get token to code signing certificate
53+
inputs:
54+
ServiceConnection: Code signer
55+
AccessScopes: https://vault.azure.net/.default
56+
5057
- task: DotNetCoreCLI@2
5158
displayName: Build
5259
inputs:
@@ -55,7 +62,7 @@ stages:
5562
configuration: ${{ variables.Configuration }}
5663
arguments: --no-restore
5764
env:
58-
AuthenticodeClientSecret: $(AuthenticodeClientSecret)
65+
AuthenticodeAccessToken: $(KeyVaultToken.AuthToken)
5966
# Roll-forward behavior set for AzureSignTool dotnet tool (see .config\dotnet-tools.json) which requires .Net 6.0 runtime
6067
DOTNET_ROLL_FORWARD: Major
6168

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<RootNamespace>Kentico.Xperience.RepoTemplate</RootNamespace>
3434

3535
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
36-
<TimestampServerUrl>http://timestamp.digicert.com</TimestampServerUrl>
3736
</PropertyGroup>
3837

3938
<PropertyGroup Condition=" $(Configuration) == 'Release' ">

Directory.build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
2-
<Target Name="SignAssemblyWithAuthenticodeSignature" AfterTargets="AfterBuild" Condition="'$(MSBuildProjectFullPath.Contains(&quot;node_modules&quot;))' == 'false' And $(Configuration) == 'Release' And $(SIGN_FILE) != 'false'">
2+
<Target Name="SignAssemblyWithAuthenticodeSignature" AfterTargets="AfterBuild" Condition="'$(MSBuildProjectFullPath.Contains(&quot;node_modules&quot;))' == 'false' And $(Configuration) == 'Release' And $(SIGN_FILE) == 'true'">
33
<PropertyGroup>
44
<XmlSerializersTargetPath>$(TargetDir)$(TargetName).XmlSerializers.dll</XmlSerializersTargetPath>
55
</PropertyGroup>
@@ -9,6 +9,6 @@
99
<AssemblyToSign Include="$(XmlSerializersTargetPath)" Condition="Exists('$(XmlSerializersTargetPath)')" />
1010
</ItemGroup>
1111

12-
<Exec Command="dotnet AzureSignTool sign --azure-key-vault-url $(AuthenticodeKeyVaultUrl) --azure-key-vault-tenant-id $(AuthenticodeTenantId) --azure-key-vault-client-id $(AuthenticodeClientId) --azure-key-vault-client-secret $(AuthenticodeClientSecret) --azure-key-vault-certificate $(AuthenticodeCertificateName) --timestamp-rfc3161 $(TimestampServerUrl) --skip-signed %(AssemblyToSign.Identity)" />
12+
<Exec Command="dotnet AzureSignTool sign --azure-key-vault-url $(AuthenticodeKeyVaultUrl) --azure-key-vault-accesstoken $(AuthenticodeAccessToken) --azure-key-vault-certificate $(AuthenticodeCertificateName) --timestamp-rfc3161 $(TimestampServerUrl) --skip-signed %(AssemblyToSign.Identity)" />
1313
</Target>
1414
</Project>

0 commit comments

Comments
 (0)