@@ -177,7 +177,7 @@ jobs:
177177 permissions :
178178 # actions/checkout needs this to fetch code
179179 contents : read
180- runs-on : ubuntu-latest
180+ runs-on : ubuntu-${{ startsWith(matrix.architecture, 'arm') && '24.04-arm' || ' latest' }}
181181 strategy :
182182 fail-fast : false
183183 matrix :
@@ -224,13 +224,10 @@ jobs:
224224 - disable_stub_resolver
225225 - specify_resolv_conf_target
226226 steps :
227- # With this task in place the GitHub runners run out of
228- # resources and crash. See cisagov/skeleton-ansible-role#211
229- # for more details.
230- # - uses: GitHubSecurityLab/actions-permissions/monitor@v1
231- # with:
232- # # Uses the organization variable unless overridden
233- # config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
227+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
228+ with :
229+ # Uses the organization variable unless overridden
230+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
234231 - id : harden-runner
235232 name : Harden the runner
236233 uses : step-security/harden-runner@v2
@@ -262,11 +259,46 @@ jobs:
262259 uses : docker/setup-qemu-action@v3
263260 - name : Set up Docker Buildx
264261 uses : docker/setup-buildx-action@v3
262+ # Disabling the unix-chkpwd AppArmor profile is necessary when
263+ # running Molecule tests against Fedora 40 and 41; otherwise,
264+ # the privileged container cannot successfully run sudo and
265+ # hence Ansible is unable to do anything. See
266+ # fedora-cloud/docker-brew-fedora#117 for more details.
267+ #
268+ # Purging firefox is currently necessary because the
269+ # installation available on the GitHub runner instance provides
270+ # two conflicting AppArmor profiles:
271+ # /etc/apparmor.d/usr.bin.firefox and /etc/apparmor.d/firefox.
272+ # This conflict causes the aa-disable /usr/sbin/unix_chkpwd
273+ # command to fail.
274+ #
275+ # Purging passt is currently necessary because the installation
276+ # available on the GitHub runner instance contains a wonky
277+ # AppArmor file (/etc/apparmor.d/abstractions/passt) that causes
278+ # the aa-disable command to fail.
279+ #
280+ # TODO: Remove the apt-get purge and systemctl reload commands
281+ # when possible. See cisagov/skeleton-ansible-role#215 for more
282+ # details.
283+ - name : Disable unix-chkpwd AppArmor profile
284+ run : |
285+ sudo apt-get purge firefox passt
286+ sudo systemctl reload apparmor.service
287+ sudo apt-get install apparmor-utils
288+ sudo aa-disable /usr/sbin/unix_chkpwd
289+ if : ${{ startsWith(matrix.platform, 'fedora') }}
265290 - name : Run molecule tests
266291 run : >-
267292 molecule test
268293 --platform-name ${{ matrix.platform }}-${{ matrix.architecture }}
269294 --scenario-name ${{ matrix.scenario }}
295+ # TODO: Remove the apt-get install command when possible. See
296+ # cisagov/skeleton-ansible-role#215 for more details.
297+ - name : Re-enable unix-chkpwd AppArmor profile
298+ run : |
299+ sudo aa-enforce /usr/sbin/unix_chkpwd
300+ sudo apt-get install firefox passt
301+ if : ${{ startsWith(matrix.platform, 'fedora') }}
270302 - name : Setup tmate debug session
271303 uses : mxschmitt/action-tmate@v3
272304 if : env.RUN_TMATE
0 commit comments