Skip to content

Commit 74e489c

Browse files
author
jsf9k
committed
2 parents 1d9c993 + d911247 commit 74e489c

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

.github/workflows/build.yml

+40-8
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
permissions:
179179
# actions/checkout needs this to fetch code
180180
contents: read
181-
runs-on: ubuntu-latest
181+
runs-on: ubuntu-${{ startsWith(matrix.architecture, 'arm') && '24.04-arm' || 'latest' }}
182182
strategy:
183183
fail-fast: false
184184
matrix:
@@ -204,13 +204,10 @@ jobs:
204204
scenario:
205205
- default
206206
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 }}
214211
- id: harden-runner
215212
name: Harden the runner
216213
uses: step-security/harden-runner@v2
@@ -250,11 +247,46 @@ jobs:
250247
aws-region: ${{ env.AWS_DEFAULT_REGION }}
251248
role-to-assume: ${{ secrets.TEST_ROLE_TO_ASSUME }}
252249
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') }}
253278
- name: Run molecule tests
254279
run: >-
255280
molecule test
256281
--platform-name ${{ matrix.platform }}-${{ matrix.architecture }}
257282
--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') }}
258290
- name: Setup tmate debug session
259291
uses: mxschmitt/action-tmate@v3
260292
if: env.RUN_TMATE

0 commit comments

Comments
 (0)