Skip to content

Commit d911247

Browse files
authored
Merge pull request #174 from cisagov/lineage/skeleton
⚠️ CONFLICT! Lineage pull request for: skeleton
2 parents e1f935b + 9fa02ef commit d911247

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 8 deletions
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:
@@ -201,13 +201,10 @@ jobs:
201201
scenario:
202202
- default
203203
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 }}
211208
- id: harden-runner
212209
name: Harden the runner
213210
uses: step-security/harden-runner@v2
@@ -247,11 +244,46 @@ jobs:
247244
aws-region: ${{ env.AWS_DEFAULT_REGION }}
248245
role-to-assume: ${{ secrets.TEST_ROLE_TO_ASSUME }}
249246
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') }}
250275
- name: Run molecule tests
251276
run: >-
252277
molecule test
253278
--platform-name ${{ matrix.platform }}-${{ matrix.architecture }}
254279
--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') }}
255287
- name: Setup tmate debug session
256288
uses: mxschmitt/action-tmate@v3
257289
if: env.RUN_TMATE

0 commit comments

Comments
 (0)