@@ -178,7 +178,7 @@ jobs:
178
178
permissions :
179
179
# actions/checkout needs this to fetch code
180
180
contents : read
181
- runs-on : ubuntu-latest
181
+ runs-on : ubuntu-${{ startsWith(matrix.architecture, 'arm') && '24.04-arm' || ' latest' }}
182
182
strategy :
183
183
fail-fast : false
184
184
matrix :
@@ -201,13 +201,10 @@ jobs:
201
201
scenario :
202
202
- default
203
203
steps :
204
- # With this task in place the GitHub runners run out of
205
- # resources and crash. See cisagov/skeleton-ansible-role#211
206
- # for more details.
207
- # - uses: GitHubSecurityLab/actions-permissions/monitor@v1
208
- # with:
209
- # # Uses the organization variable unless overridden
210
- # config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
204
+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
205
+ with :
206
+ # Uses the organization variable unless overridden
207
+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
211
208
- id : harden-runner
212
209
name : Harden the runner
213
210
uses : step-security/harden-runner@v2
@@ -247,11 +244,46 @@ jobs:
247
244
aws-region : ${{ env.AWS_DEFAULT_REGION }}
248
245
role-to-assume : ${{ secrets.TEST_ROLE_TO_ASSUME }}
249
246
role-duration-seconds : 3600
247
+ # Disabling the unix-chkpwd AppArmor profile is necessary when
248
+ # running Molecule tests against Fedora 40 and 41; otherwise,
249
+ # the privileged container cannot successfully run sudo and
250
+ # hence Ansible is unable to do anything. See
251
+ # fedora-cloud/docker-brew-fedora#117 for more details.
252
+ #
253
+ # Purging firefox is currently necessary because the
254
+ # installation available on the GitHub runner instance provides
255
+ # two conflicting AppArmor profiles:
256
+ # /etc/apparmor.d/usr.bin.firefox and /etc/apparmor.d/firefox.
257
+ # This conflict causes the aa-disable /usr/sbin/unix_chkpwd
258
+ # command to fail.
259
+ #
260
+ # Purging passt is currently necessary because the installation
261
+ # available on the GitHub runner instance contains a wonky
262
+ # AppArmor file (/etc/apparmor.d/abstractions/passt) that causes
263
+ # the aa-disable command to fail.
264
+ #
265
+ # TODO: Remove the apt-get purge and systemctl reload commands
266
+ # when possible. See cisagov/skeleton-ansible-role#215 for more
267
+ # details.
268
+ - name : Disable unix-chkpwd AppArmor profile
269
+ run : |
270
+ sudo apt-get purge firefox passt
271
+ sudo systemctl reload apparmor.service
272
+ sudo apt-get install apparmor-utils
273
+ sudo aa-disable /usr/sbin/unix_chkpwd
274
+ if : ${{ startsWith(matrix.platform, 'fedora') }}
250
275
- name : Run molecule tests
251
276
run : >-
252
277
molecule test
253
278
--platform-name ${{ matrix.platform }}-${{ matrix.architecture }}
254
279
--scenario-name ${{ matrix.scenario }}
280
+ # TODO: Remove the apt-get install command when possible. See
281
+ # cisagov/skeleton-ansible-role#215 for more details.
282
+ - name : Re-enable unix-chkpwd AppArmor profile
283
+ run : |
284
+ sudo aa-enforce /usr/sbin/unix_chkpwd
285
+ sudo apt-get install firefox passt
286
+ if : ${{ startsWith(matrix.platform, 'fedora') }}
255
287
- name : Setup tmate debug session
256
288
uses : mxschmitt/action-tmate@v3
257
289
if : env.RUN_TMATE
0 commit comments