Skip to content

Commit abcab5c

Browse files
committed
Fix Ubuntu 24.04 SSH hardening
Signed-off-by: Martin Schurz <[email protected]>
1 parent 9ebc603 commit abcab5c

File tree

13 files changed

+18
-16
lines changed

13 files changed

+18
-16
lines changed

.config/ansible-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ exclude_paths:
88
- .ansible/ # somehow someone decided that the cache directory should be renamed
99
# add all waivers individually, since exclude_files does not support globs
1010
- molecule/os_hardening/waivers.yaml
11-
- molecule/ssh_hardening_bsd/waivers_freebsd13.yaml
12-
- molecule/ssh_hardening_bsd/waivers_freebsd14.yaml
13-
- molecule/ssh_hardening_bsd/waivers_openbsd7.yaml
11+
- molecule/ssh_hardening_vm/waivers_freebsd13.yaml
12+
- molecule/ssh_hardening_vm/waivers_freebsd14.yaml
13+
- molecule/ssh_hardening_vm/waivers_openbsd7.yaml
1414

1515
mock_roles:
1616
- geerlingguy.git

.github/workflows/ssh_hardening_bsd.yml renamed to .github/workflows/ssh_hardening_vm.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
name: "devsec.ssh_hardening BSD"
2+
name: "devsec.ssh_hardening VM"
33
on: # yamllint disable-line rule:truthy
44
workflow_dispatch:
55
push:
66
branches: [master]
77
paths:
88
- 'roles/ssh_hardening/**'
9-
- 'molecule/ssh_hardening_bsd/**'
10-
- '.github/workflows/ssh_hardening_bsd.yml'
9+
- 'molecule/ssh_hardening_vm/**'
10+
- '.github/workflows/ssh_hardening_vm.yml'
1111
- 'requirements.txt'
1212
pull_request:
1313
branches: [master]
1414
paths:
1515
- 'roles/ssh_hardening/**'
16-
- 'molecule/ssh_hardening_bsd/**'
17-
- '.github/workflows/ssh_hardening_bsd.yml'
16+
- 'molecule/ssh_hardening_vm/**'
17+
- '.github/workflows/ssh_hardening_vm.yml'
1818
- 'requirements.txt'
1919
schedule:
2020
- cron: '0 6 * * 5'
@@ -36,9 +36,10 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
molecule_distro:
39-
- openbsd7
40-
- freebsd13
41-
- freebsd14
39+
- generic/openbsd7
40+
- generic/freebsd13
41+
- generic/freebsd14
42+
- cloud-image/ubuntu-24.04
4243
steps:
4344
- name: Checkout repo
4445
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -47,10 +48,10 @@ jobs:
4748
submodules: true
4849

4950
- name: Update Vagrant Box
50-
run: vagrant box update --box generic/${{ matrix.molecule_distro }} || true
51+
run: vagrant box update --box ${{ matrix.molecule_distro }} || true
5152

5253
- name: Test with molecule
53-
run: molecule test -s ssh_hardening_bsd
54+
run: molecule test -s ssh_hardening_vm
5455
env:
5556
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
5657
working-directory: ansible_collections/devsec/hardening

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![devsec.os_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening.yml)
44
[![devsec.os_hardening VM](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening_vm.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/os_hardening_vm.yml)
55
[![devsec.ssh_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening.yml)
6-
[![devsec.ssh_hardening BSD](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_bsd.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_bsd.yml)
6+
[![devsec.ssh_hardening VM](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_vm.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_vm.yml)
77
[![devsec.ssh_hardening with custom tests](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_custom_tests.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/ssh_hardening_custom_tests.yml)
88
[![devsec.nginx_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/nginx_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/nginx_hardening.yml)
99
[![devsec.mysql_hardening](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/mysql_hardening.yml/badge.svg)](https://github.com/dev-sec/ansible-collection-hardening/actions/workflows/mysql_hardening.yml)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

molecule/ssh_hardening_bsd/verify.yml renamed to molecule/ssh_hardening_vm/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
ansible.builtin.command: >
3737
docker run --rm
3838
--volume {{ molecule_ephemeral_directory }}:{{ molecule_ephemeral_directory }}
39-
--volume ./waivers_{{ lookup('env', 'MOLECULE_DISTRO') }}.yaml:/waivers.yaml
39+
--volume ./waivers_{{ lookup('env', 'MOLECULE_DISTRO') | regex_replace('^.*/', '') }}.yaml:/waivers.yaml
4040
docker.io/cincproject/auditor exec
4141
--ssh-config-file={{ molecule_ephemeral_directory }}/ssh-config
4242
-t ssh://{{ lookup('env', 'USER') }}

0 commit comments

Comments
 (0)