|
2 | 2 |
|
3 | 3 | # See: https://learn.microsoft.com/en-us/azure/security/fundamentals/azure-ca-details?tabs=certificate-authority-chains
|
4 | 4 | declare -a CERTIFICATES=(
|
5 |
| - "Microsoft RSA TLS CA 01=https://crt.sh/?d=3124375355" |
6 |
| - "Microsoft RSA TLS CA 02=https://crt.sh/?d=3124375356" |
7 |
| - "Microsoft Azure RSA TLS Issuing CA 03=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
8 |
| - "Microsoft Azure RSA TLS Issuing CA 04=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
9 |
| - "Microsoft Azure RSA TLS Issuing CA 07=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
10 |
| - "Microsoft Azure RSA TLS Issuing CA 08=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
11 |
| - "Microsoft Azure TLS Issuing CA 01=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2001.cer" |
12 |
| - "Microsoft Azure TLS Issuing CA 02=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2002.cer" |
13 |
| - "Microsoft Azure TLS Issuing CA 05=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2005.cer" |
14 |
| - "Microsoft Azure TLS Issuing CA 06=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2006.cer" |
| 5 | + "Microsoft RSA TLS CA 01=https://crt.sh/?d=3124375355" |
| 6 | + "Microsoft RSA TLS CA 02=https://crt.sh/?d=3124375356" |
| 7 | + "Microsoft Azure RSA TLS Issuing CA 03=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
| 8 | + "Microsoft Azure RSA TLS Issuing CA 04=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
| 9 | + "Microsoft Azure RSA TLS Issuing CA 07=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
| 10 | + "Microsoft Azure RSA TLS Issuing CA 08=https://www.microsoft.com/pkiops/certs/Microsoft%20Azure%20RSA%20TLS%20Issuing%20CA%2003%20-%20xsign.crt" |
| 11 | + "Microsoft Azure TLS Issuing CA 01=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2001.cer" |
| 12 | + "Microsoft Azure TLS Issuing CA 02=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2002.cer" |
| 13 | + "Microsoft Azure TLS Issuing CA 05=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2005.cer" |
| 14 | + "Microsoft Azure TLS Issuing CA 06=https://www.microsoft.com/pki/certs/Microsoft%20Azure%20TLS%20Issuing%20CA%2006.cer" |
15 | 15 | )
|
16 | 16 |
|
17 | 17 | CONTENT="var Certificates = []string{"
|
18 | 18 |
|
19 | 19 | for CERT in "${CERTIFICATES[@]}"; do
|
20 |
| - IFS="=" read -r NAME URL <<< "$CERT" |
21 |
| - echo "Downloading certificate: $NAME" |
22 |
| - PEM=$(curl -sSL "$URL" | openssl x509 -outform PEM) |
23 |
| - echo "$PEM" |
| 20 | + IFS="=" read -r NAME URL <<<"$CERT" |
| 21 | + echo "Downloading certificate: $NAME" |
| 22 | + PEM=$(curl -sSL "$URL" | openssl x509 -outform PEM) |
| 23 | + echo "$PEM" |
24 | 24 |
|
25 |
| - CONTENT+="\n// $NAME\n\`$PEM\`," |
| 25 | + CONTENT+="\n// $NAME\n\`$PEM\`," |
26 | 26 | done
|
27 | 27 |
|
28 | 28 | CONTENT+="\n}"
|
29 | 29 |
|
30 | 30 | sed -i '/var Certificates = /,$d' azureidentity.go
|
31 | 31 | # shellcheck disable=SC2059
|
32 |
| -printf "$CONTENT" >> azureidentity.go |
| 32 | +printf "$CONTENT" >>azureidentity.go |
33 | 33 | gofmt -w azureidentity.go
|
0 commit comments