Skip to content

Commit 12c5ec3

Browse files
committed
Switch rhel license to use azure vault
1 parent d366019 commit 12c5ec3

File tree

4 files changed

+17
-35
lines changed

4 files changed

+17
-35
lines changed

.github/workflows/build-base-images.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ jobs:
188188
BUILD_OS=${{ matrix.image }}
189189
IC_VERSION=${{ needs.checks.outputs.ic_version }}
190190
secret-files: |
191-
nginx-repo.crt=./nginx-repo.crt
192-
nginx-repo.key=./nginx-repo.key
191+
nginx-repo.crt=nginx-repo.crt
192+
nginx-repo.key=nginx-repo.key
193193
194194
- name: Clean up secrets
195195
run: |
@@ -226,6 +226,7 @@ jobs:
226226
echo "::add-mask::$PLUS_CREDS"
227227
echo $PLUS_CREDS | jq -r '.crt' > nginx-repo.crt
228228
echo $PLUS_CREDS | jq -r '.key' > nginx-repo.key
229+
az keyvault secret show --name rhel-creds --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv > rhel_license
229230
230231
- name: Docker Buildx
231232
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
@@ -280,12 +281,11 @@ jobs:
280281
IC_VERSION=${{ needs.checks.outputs.ic_version }}
281282
NAP_MODULES=${{ matrix.nap_modules }}
282283
secret-files: |
283-
nginx-repo.crt=./nginx-repo.crt
284-
nginx-repo.key=./nginx-repo.key
285-
secrets: |
286-
${{ contains(matrix.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
284+
nginx-repo.crt=nginx-repo.crt
285+
nginx-repo.key=nginx-repo.key
286+
${{ contains(matrix.image, 'ubi') && 'rhel_license=rhel_license' || '' }}
287287
288288
- name: Clean up secrets
289289
run: |
290-
rm -f nginx-repo.crt nginx-repo.key
290+
rm -f nginx-repo.crt nginx-repo.key rhel_license
291291
if: always()

.github/workflows/build-plus.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ jobs:
175175
secret-files: |
176176
nginx-repo.crt=nginx-repo.crt
177177
nginx-repo.key=nginx-repo.key
178-
secrets: |
179-
${{ inputs.nap-modules != '' && contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
178+
${{ inputs.nap-modules != '' && contains(inputs.image, 'ubi') && 'rhel_license=rhel_license' || '' }}
180179
if: ${{ inputs.authenticated && steps.images_exist.outputs.base_exists != 'true' }}
181180

182181
- name: Debug values
@@ -221,8 +220,7 @@ jobs:
221220
secret-files: |
222221
nginx-repo.crt=nginx-repo.crt
223222
nginx-repo.key=nginx-repo.key
224-
secrets: |
225-
${{ contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
223+
${{ contains(inputs.image, 'ubi') && 'rhel_license=rhel_license' || '' }}
226224
if: ${{ steps.images_exist.outputs.base_exists != 'true' || steps.images_exist.outputs.target_exists != 'true' }}
227225

228226
- name: Make directory for security scan results
@@ -245,5 +243,5 @@ jobs:
245243

246244
- name: Clean up secrets
247245
run: |
248-
rm -f nginx-repo.crt nginx-repo.key
246+
rm -f nginx-repo.crt nginx-repo.key rhel_license
249247
if: always()

.github/workflows/build-single-image.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,7 @@ jobs:
9595
echo "::add-mask::$PLUS_CREDS"
9696
echo $PLUS_CREDS | jq -r '.crt' > nginx-repo.crt
9797
echo $PLUS_CREDS | jq -r '.key' > nginx-repo.key
98-
if: ${{ contains(inputs.target, 'plus') }}
99-
100-
- name: Setup plus credentials
101-
run: |
102-
if [[ "${{ inputs.target }}" =~ ubi ]]; then
103-
printf '%s\n' "${RHEL}" > rhel_license
104-
fi
105-
env:
106-
RHEL: ${{ secrets.RHEL_LICENSE }}
98+
az keyvault secret show --name rhel-creds --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv > rhel_license
10799
if: ${{ contains(inputs.target, 'plus') }}
108100

109101
- name: Fetch Cached Binary Artifacts
@@ -121,14 +113,6 @@ jobs:
121113
env:
122114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123115
GOPATH: ${{ steps.vars.outputs.go_path }}
124-
AWS_PRODUCT_CODE: ${{ secrets.AWS_PRODUCT_CODE }}
125-
AWS_PUB_KEY: ${{ secrets.AWS_PUB_KEY }}
126-
AWS_NAP_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_DOS_PRODUCT_CODE }}
127-
AWS_NAP_DOS_PUB_KEY: ${{ secrets.AWS_NAP_DOS_PUB_KEY }}
128-
AWS_NAP_WAF_PRODUCT_CODE: ${{ secrets.AWS_NAP_WAF_PRODUCT_CODE }}
129-
AWS_NAP_WAF_PUB_KEY: ${{ secrets.AWS_NAP_WAF_PUB_KEY }}
130-
AWS_NAP_WAF_DOS_PRODUCT_CODE: ${{ secrets.AWS_NAP_WAF_DOS_PRODUCT_CODE }}
131-
AWS_NAP_WAF_DOS_PUB_KEY: ${{ secrets.AWS_NAP_WAF_DOS_PUB_KEY }}
132116
GORELEASER_CURRENT_TAG: "v${{ steps.vars.outputs.ic_version }}"
133117
if: ${{ steps.binary-cache.outputs.binary_cache_hit != 'true' }}
134118

@@ -159,5 +143,5 @@ jobs:
159143

160144
- name: Clean up secrets
161145
run: |
162-
rm -f nginx-repo.crt nginx-repo.key
146+
rm -f nginx-repo.crt nginx-repo.key rhel_license
163147
if: always()

.github/workflows/setup-smoke.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
echo "PLUS_JWT=$PLUS_JWT" >> $GITHUB_OUTPUT
8181
echo $PLUS_CREDS | jq -r '.crt' > nginx-repo.crt
8282
echo $PLUS_CREDS | jq -r '.key' > nginx-repo.key
83+
az keyvault secret show --name rhel-creds --vault-name ${{ secrets.NIC_KEYVAULT_NAME }} --query value -o tsv > rhel_license
8384
if: ${{ inputs.authenticated }}
8485

8586
- name: Authenticate to Google Cloud
@@ -166,10 +167,9 @@ jobs:
166167
${{ contains(inputs.image, 'nap') && format('NAP_MODULES={0}', steps.nap_modules.outputs.modules) || '' }}
167168
${{ contains(inputs.marker, 'appprotect') && 'DEBIAN_VERSION=buster-slim' || '' }}
168169
secret-files: |
169-
nginx-repo.crt=./nginx-repo.crt
170-
nginx-repo.key=./nginx-repo.key
171-
secrets: |
172-
${{ contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
170+
nginx-repo.crt=nginx-repo.crt
171+
nginx-repo.key=nginx-repo.key
172+
${{ contains(inputs.image, 'ubi') && 'rhel_license=rhel_license' || '' }}
173173
if: ${{ !inputs.authenticated }}
174174

175175
- name: Generate WAF v5 tgz from JSON
@@ -202,5 +202,5 @@ jobs:
202202

203203
- name: Clean up secrets
204204
run: |
205-
rm -f nginx-repo.crt nginx-repo.key
205+
rm -f nginx-repo.crt nginx-repo.key rhel_license
206206
if: always()

0 commit comments

Comments
 (0)