forked from cmancone/akeyless-action
-
Notifications
You must be signed in to change notification settings - Fork 4
138 lines (125 loc) · 5.89 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
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 Environment Variables
run: echo "Your environment secret is ${{ env.my_static_secret }}"
- name: Fetch dynamic secret from Akleyless
id: fetch-secrets
uses: ./
with:
access-id: ${{ secrets.AKEYLESS_ACCESS_ID }}
dynamic-secrets: '{"/DevTools/live-azure-ad":"akelyess_payload"}'
parse-dynamic-secrets: true
- name: Check Outputs
run: |
echo 'ENTIRE OUTPUT'
echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}'
echo 'ID'
echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.id'
echo 'TTL_IN_MINUTES'
echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.ttl_in_minutes'
echo 'MSG'
echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.msg'
echo 'SECRET'
echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret_appId'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret_displayName'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret_keyId'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret_secretText'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret_tenantId'
- name: Check Environment Variables
run: |
echo 'ID'
echo '${{ env.id }}'
echo 'TTL_IN_MINUTES'
echo '${{ env.ttl_in_minutes }}'
echo 'MSG'
echo '${{ env.msg }}'
echo 'SECRET'
echo '${{ env.secret }}'
# echo '${{ env.secret_appId }}'
# echo '${{ env.secret_displayName }}'
# echo '${{ env.secret_keyId }}'
# echo '${{ env.secret_secretText }}'
# echo '${{ env.secret_tenantId }}'
# - name: Read Secrets
# run: |
# echo 'ID'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.id'
# echo 'TTL_IN_MINUTES'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.ttl_in_minutes'
# echo 'MSG'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.msg'
# echo 'SECRET'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret.appId'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret.displayName'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret.keyId'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret.secretText'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq '.secret.tenantId'
# - name: Read Secrets
# run: |
# echo 'ID'
# echo '${{ env.id }}'
# echo 'TTL_IN_MINUTES'
# echo '${{ env.ttl_in_minutes }}'
# echo 'MSG'
# echo '${{ env.msg }}'
# echo 'SECRET'
# echo '${{ env.secret }}'
# echo '${{ env.secret.appId }}'
# echo '${{ env.secret.displayName }}'
# echo '${{ env.secret.keyId }}'
# echo '${{ env.secret.secretText }}'
# echo '${{ env.secret.tenantId }}'
# - name: Read Secrets
# run: |
# echo 'ID'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.id'
# echo 'TTL_IN_MINUTES'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.ttl_in_minutes'
# echo 'MSG'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.msg'
# echo 'SECRET'
# echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.secret'
# # echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.secret.appId'
# # echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.secret.displayName'
# # echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.secret.keyId'
# # echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.secret.secretText'
# # echo '${{ steps.fetch-secrets.outputs.akelyess_payload }}' | jq -r '.secret.tenantId'
# - name: Download 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'