Skip to content

Fix Ubuntu 24.04 SSH hardening #4

Fix Ubuntu 24.04 SSH hardening

Fix Ubuntu 24.04 SSH hardening #4

---
name: "devsec.ssh_hardening VM"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches: [master]
paths:
- 'roles/ssh_hardening/**'
- 'molecule/ssh_hardening_vm/**'
- '.github/workflows/ssh_hardening_vm.yml'
- 'requirements.txt'
pull_request:
branches: [master]
paths:
- 'roles/ssh_hardening/**'
- 'molecule/ssh_hardening_vm/**'
- '.github/workflows/ssh_hardening_vm.yml'
- 'requirements.txt'
schedule:
- cron: '0 6 * * 5'
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.number || github.sha
}}
cancel-in-progress: true
jobs:
build:
runs-on: self-hosted
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: false
matrix:
molecule_distro:
- generic/openbsd7
- generic/freebsd13
- generic/freebsd14
- cloud-image/ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
path: ansible_collections/devsec/hardening
submodules: true
- name: Install dependencies
run: |
source ~/.venv/ansible-collection-hardening/bin/activate
python -m pip install --no-cache-dir --upgrade pip
pip install -r requirements.txt
pip install python-vagrant
working-directory: ansible_collections/devsec/hardening
- name: Update Vagrant Box
run: |
vagrant box update --box ${{ matrix.molecule_distro }} || true
- name: Test with molecule
run: |
source ~/.venv/ansible-collection-hardening/bin/activate
molecule test -s ssh_hardening_vm
env:
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
working-directory: ansible_collections/devsec/hardening