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