forked from cmancone/akeyless-action
-
Notifications
You must be signed in to change notification settings - Fork 4
166 lines (143 loc) · 6.31 KB
/
dynamic-azure-codesign.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: 'AzureSignTool & Dynamic Secret'
# Docs => https://docs.akeyless.io/docs/azure-ad-dynamic-secrets
# Using AzureSignTool https://learn.microsoft.com/en-us/windows/msix/desktop/cicd-keyvault
on:
workflow_dispatch:
push:
branches:
- aad-tests
paths:
- 'src/**/*'
- '.github/workflows/dynamic-azure-codesign.yml'
jobs:
code_sign:
runs-on: windows-latest
name: Code Signing
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: Fetch static secret from AKeyless
# id: fetch-static-secrets
# uses: ./
# with:
# access-id: ${{ secrets.AKEYLESS_ACCESS_ID }}
# static-secrets: '{"/DevTools/my-static-secret":"my_static_secret"}'
# - name: Verify Static Secret Job Outputs
# run: echo "Your output secret is ${{ steps.fetch-static-secrets.outputs.my_static_secret }}"
# - name: Verify Static Secret Env Value
# run: echo "Your environment secret is ${{ env.my_static_secret }}"
# PREFIXED TESTS
# - name: Prefixed, Unparsed
# id: job-one
# uses: ./
# with:
# access-id: ${{ secrets.AKEYLESS_ACCESS_ID }}
# dynamic-secrets: '{"/DevTools/live-azure-ad":"aad_payload"}'
# parse-dynamic-secrets: false
# export-secrets-to-environment: true
# - name: Verify Outputs
# run: |
# echo 'outputs.aad_payload'
# echo '${{ steps.job-one.outputs.aad_payload }}'
# echo 'outputs.aad_payload via jq'
# echo '${{ steps.job-one.outputs.aad_payload }}' | jq '.secret'
# - name: Verify env vars
# run: |
# echo 'env.aad_payload'
# echo '${{ env.aad_payload }}'
# echo 'env.aad_payload via jq'
# echo '${{ env.aad_payload }}' | jq '.secret'
- name: Prefixed and Parsed
id: job-two
uses: ./
with:
access-id: ${{ secrets.AKEYLESS_ACCESS_ID }}
dynamic-secrets: '{"/DevTools/live-azure-ad":"aad_payload"}'
parse-dynamic-secrets: true
export-secrets-to-environment: false
# - name: Verify Outputs
# run: |
# echo 'ENTIRE OUTPUT'
# echo '${{ steps.job-two.outputs.aad_payload }}'
# echo 'ID'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.id'
# echo 'TTL_IN_MINUTES'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.ttl_in_minutes'
# echo 'MSG'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.msg'
# echo 'SECRET'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret'
# # echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret_appId'
# # echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret_displayName'
# # echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret_keyId'
# # echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret_secretText'
# # echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret_tenantId'
# - name: Read Secrets
# run: |
# echo 'ID'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.id'
# echo 'TTL_IN_MINUTES'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.ttl_in_minutes'
# echo 'MSG'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.msg'
# echo 'SECRET'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret.appId'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret.displayName'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret.keyId'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret.secretText'
# echo '${{ steps.job-two.outputs.aad_payload }}' | jq '.secret.tenantId'
# UNPREFIXED TESTS
# - name: Unprefixed, Unparsed
# id: job-three
# uses: ./
# with:
# access-id: ${{ secrets.AKEYLESS_ACCESS_ID }}
# dynamic-secrets: '{"/DevTools/live-azure-ad":""}'
# parse-dynamic-secrets: false
# export-secrets-to-environment: false
# - name: Verify Outputs
# run: |
# echo 'ENTIRE OUTPUT'
# echo '${{ steps.job-three.outputs.aad_payload }}'
# echo 'ID'
# echo '${{ steps.job-three.outputs.aad_payload }}' | jq '.id'
# echo 'TTL_IN_MINUTES'
# echo '${{ steps.job-three.outputs.aad_payload }}' | jq '.ttl_in_minutes'
# echo 'MSG'
# echo '${{ steps.job-three.outputs.aad_payload }}' | jq '.msg'
# echo 'SECRET'
# echo '${{ steps.job-three.outputs.aad_payload }}' | jq '.secret'
# - name: Unprefixed, Parsed
# id: job-four
# uses: ./
# with:
# access-id: ${{ secrets.AKEYLESS_ACCESS_ID }}
# dynamic-secrets: '{"/DevTools/live-azure-ad":""}'
# parse-dynamic-secrets: true
# export-secrets-to-environment: false
# - name: Verify Outputs
# run: |
# echo 'ENTIRE OUTPUT'
# echo '${{ steps.job-four.outputs.aad_payload }}'
# echo 'ID'
# echo '${{ steps.job-four.outputs.aad_payload }}' | jq '.id'
# echo 'TTL_IN_MINUTES'
# echo '${{ steps.job-four.outputs.aad_payload }}' | jq '.ttl_in_minutes'
# echo 'MSG'
# echo '${{ steps.job-four.outputs.aad_payload }}' | jq '.msg'
# echo 'SECRET'
# echo '${{ steps.job-four.outputs.aad_payload }}' | jq '.secret'
# - name: Download Example File to Sign
# run: Invoke-WebRequest "https://dvlup.blob.core.windows.net/general-app-files/MSIs/MicrosoftStoreServicesSDK.msi" -OutFile '${{ github.workspace }}\MicrosoftStoreServicesSDK.msi'
# - name: Install AzureSignTool
# id: install-signtool
# run: dotnet tool install --global AzureSignTool
# - name: Sign File
# id: use-signtool
# run: |
# azuresigntool sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}"-kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.digicert.com -v '${{ github.workspace }}\MicrosoftStoreServicesSDK.msi'