Skip to content

Commit

Permalink
Merge pull request #29 from ansible-lockdown/devel
Browse files Browse the repository at this point in the history
Final v1r7 release to main
  • Loading branch information
uk-bolly authored Mar 14, 2024
2 parents bc480b7 + 17cafc0 commit 8db5472
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 137 deletions.
119 changes: 0 additions & 119 deletions .config/.secrets.baseline

This file was deleted.

6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
*.retry
.cache
.vagrant
vagrantfile
Vagrantfile
tests/*redhat-subscription
tests/Dockerfile
*.iso
*.box
packer_cache
delete*
ignore*
test_inv
# temp remove doc while this is built up
doc/
# VSCode
.vscode

Expand Down Expand Up @@ -45,4 +46,3 @@ benchparse/

# GitHub Action/Workflow files
.github/
.DS_Store
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ repos:
rev: v1.4.0
hooks:
- id: detect-secrets
args: [ '--baseline', '.config/.secrets.baseline' ]

- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
rev: v8.18.2
hooks:
- id: gitleaks
args: ['--baseline-path', '.config/.gitleaks-report.json']

- repo: https://github.com/ansible-community/ansible-lint
rev: v6.21.1
rev: v24.2.0
hooks:
- id: ansible-lint
name: Ansible-lint
Expand All @@ -61,6 +59,6 @@ repos:
- ansible-core>=2.10.1

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0 # or higher tag
rev: v1.35.1 # or higher tag
hooks:
- id: yamllint
8 changes: 7 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Based on Stig v1r7 - Jan 2023

- ansible version updated to 2.10.1 minimum
- updates to pre-commit config
- gitignore updated

## Release 0.9.1

- yamllint update
Expand All @@ -15,7 +21,7 @@ Issues
- thanks to @kfiresmith
- #11
- #12
- thanks to €aelx-rowe
- thanks to @alex-rowe
- #13

## Release 0.9.0
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ galaxy_info:
license: MIT
role_name: ubuntu20_stig
namespace: mindpointgroup
min_ansible_version: 2.9.0
min_ansible_version: 2.10.1
platforms:
- name: Ubuntu
versions:
Expand Down
3 changes: 2 additions & 1 deletion site.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

- hosts: all # noqa: name[play]
- name: Run Ubuntu20-stig remediation role
hosts: all
become: true

roles:
Expand Down
2 changes: 1 addition & 1 deletion tasks/fix-cat1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
- name: "HIGH | UBTU-20-010048 | PATCH | The Ubuntu operating system must be configured so that remote X connections are disabled, unless to fulfill documented and validated mission requirements."
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?(\s+|)X11Forwarding'
regexp: '^#?X11Forwarding'
line: "X11Forwarding no"
notify: restart sshd
when:
Expand Down
17 changes: 12 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
---

- name: Gather distribution info
ansible.builtin.setup:
gather_subset: distribution,!all,!min
when:
- ansible_distribution is not defined
- name: Check OS version and family
ansible.builtin.assert:
that: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version_compare('20', '==')
msg: "This role can only be run against Ubuntu 20. {{ ansible_distribution }} {{ ansible_distribution_major_version }} is not supported."
tags:
- always

- name: Check ansible version
ansible.builtin.assert:
that: ansible_version.full is version_compare(min_ansible_version, '>=')
fail_msg: "You must use Ansible {{ min_ansible_version }} or greater"
success_msg: "This role is running a supported version of ansible {{ ansible_version.full }} >= {{ min_ansible_version }}"
tags:
- always

Expand Down
2 changes: 1 addition & 1 deletion tasks/parse_etc_passwd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
vars:
ld_passwd_regex: >-
^(?P<id>[^:]*):(?P<password>[^:]*):(?P<uid>[^:]*):(?P<gid>[^:]*):(?P<gecos>[^:]*):(?P<dir>[^:]*):(?P<shell>[^:]*)
ld_passwd_yaml: |
ld_passwd_yaml: | # pragma: allowlist secret
id: >-4
\g<id>
password: >-4
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

# vars file for .
min_ansible_version: 2.10.1

# Used to control warning summary
warn_control_list: ""
Expand Down

0 comments on commit 8db5472

Please sign in to comment.