@@ -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 :
@@ -200,13 +200,10 @@ jobs:
200200 scenario :
201201 - default
202202 steps :
203- # With this task in place the GitHub runners run out of
204- # resources and crash. See cisagov/skeleton-ansible-role#211
205- # for more details.
206- # - uses: GitHubSecurityLab/actions-permissions/monitor@v1
207- # with:
208- # # Uses the organization variable unless overridden
209- # config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
203+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
204+ with :
205+ # Uses the organization variable unless overridden
206+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
210207 - id : harden-runner
211208 name : Harden the runner
212209 uses : step-security/harden-runner@v2
@@ -238,11 +235,46 @@ jobs:
238235 uses : docker/setup-qemu-action@v3
239236 - name : Set up Docker Buildx
240237 uses : docker/setup-buildx-action@v3
238+ # Disabling the unix-chkpwd AppArmor profile is necessary when
239+ # running Molecule tests against Fedora 40 and 41; otherwise,
240+ # the privileged container cannot successfully run sudo and
241+ # hence Ansible is unable to do anything. See
242+ # fedora-cloud/docker-brew-fedora#117 for more details.
243+ #
244+ # Purging firefox is currently necessary because the
245+ # installation available on the GitHub runner instance provides
246+ # two conflicting AppArmor profiles:
247+ # /etc/apparmor.d/usr.bin.firefox and /etc/apparmor.d/firefox.
248+ # This conflict causes the aa-disable /usr/sbin/unix_chkpwd
249+ # command to fail.
250+ #
251+ # Purging passt is currently necessary because the installation
252+ # available on the GitHub runner instance contains a wonky
253+ # AppArmor file (/etc/apparmor.d/abstractions/passt) that causes
254+ # the aa-disable command to fail.
255+ #
256+ # TODO: Remove the apt-get purge and systemctl reload commands
257+ # when possible. See cisagov/skeleton-ansible-role#215 for more
258+ # details.
259+ - name : Disable unix-chkpwd AppArmor profile
260+ run : |
261+ sudo apt-get purge firefox passt
262+ sudo systemctl reload apparmor.service
263+ sudo apt-get install apparmor-utils
264+ sudo aa-disable /usr/sbin/unix_chkpwd
265+ if : ${{ startsWith(matrix.platform, 'fedora') }}
241266 - name : Run molecule tests
242267 run : >-
243268 molecule test
244269 --platform-name ${{ matrix.platform }}-${{ matrix.architecture }}
245270 --scenario-name ${{ matrix.scenario }}
271+ # TODO: Remove the apt-get install command when possible. See
272+ # cisagov/skeleton-ansible-role#215 for more details.
273+ - name : Re-enable unix-chkpwd AppArmor profile
274+ run : |
275+ sudo aa-enforce /usr/sbin/unix_chkpwd
276+ sudo apt-get install firefox passt
277+ if : ${{ startsWith(matrix.platform, 'fedora') }}
246278 - name : Setup tmate debug session
247279 uses : mxschmitt/action-tmate@v3
248280 if : env.RUN_TMATE
0 commit comments