File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ parameters :
2
+ - name : connectionName
3
+ type : string
4
+ default : sonic-dev-connection
5
+ - name : kevaultName
6
+ type : string
7
+ default : sonic-kv
8
+ - name : certificateName
9
+ type : string
10
+ default : sonic-secure-boot
11
+
12
+ steps :
13
+ - task : AzureKeyVault@2
14
+ inputs :
15
+ connectedServiceName : ${{ parameters.connectionName }}
16
+ keyVaultName : ${{ parameters.kevaultName }}
17
+ secretsFilter : ${{ parameters.certificateName }}
18
+
19
+ - script : |
20
+ set -e
21
+ TMP_FILE=$(mktemp)
22
+ echo "$CERTIFICATE" | base64 -d > $TMP_FILE
23
+ sudo mkdir -p /etc/certificates
24
+ mkdir -p $(Build.StagingDirectory)/target
25
+ # Save the public key
26
+ openssl pkcs12 -in $TMP_FILE -clcerts --nokeys -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN CERTIFICATE\)/\1/" > $(SIGNING_CERT)
27
+ # Save the private key
28
+ openssl pkcs12 -in $TMP_FILE -nocerts -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN PRIVATE KEY\)/\1/" | sudo tee $(SIGNING_KEY) 1>/dev/null
29
+ ls -lt $(SIGNING_CERT) $(SIGNING_KEY)
30
+ rm $TMP_FILE
31
+ env :
32
+ CERTIFICATE : $(${{ parameters.certificateName }})
33
+ displayName : " Save certificate"
Original file line number Diff line number Diff line change @@ -22,10 +22,17 @@ resources:
22
22
name : Cisco-8000-sonic/platform-cisco-8000
23
23
endpoint : cisco-connection
24
24
25
+
25
26
variables :
26
27
- group : SONIC-AKV-STROAGE-1
27
28
- name : StorageSASKey
28
29
value : $(sonicstorage-SasToken)
30
+ - name : SONIC_ENABLE_SECUREBOOT_SIGNATURE
31
+ value : y
32
+ - name : SIGNING_KEY
33
+ value : /etc/certificates/sonic-secure-boot-private.pem
34
+ - name : SIGNING_CERT
35
+ value : $(Build.StagingDirectory)/target/sonic-secure-boot-public.pem
29
36
30
37
stages :
31
38
- stage : Build
@@ -41,6 +48,7 @@ stages:
41
48
parameters :
42
49
buildOptions : ' USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
43
50
preSteps :
51
+ - template : azure-pipelines-download-certificate.yml
44
52
- checkout : self
45
53
submodules : recursive
46
54
path : s
@@ -90,5 +98,10 @@ stages:
90
98
StorageSASKey: $(StorageSASKey)
91
99
condition: ne(variables['Build.Reason'], 'PullRequest')
92
100
displayName: "Override cisco sai packages"
101
+ - script : |
102
+ echo "SONIC_ENABLE_SECUREBOOT_SIGNATURE := y" >> rules/config.user
103
+ echo "SIGNING_KEY := $(SIGNING_KEY)" >> rules/config.user
104
+ echo "SIGNING_CERT := $(SIGNING_CERT)" >> rules/config.user
105
+ displayName: "Enable secure boot signature"
93
106
jobGroups :
94
107
- name : cisco-8000
You can’t perform that action at this time.
0 commit comments