Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oscap scan found 2 issues in sshd configuration override files #174

Merged
merged 2 commits into from
Feb 19, 2024
Merged

oscap scan found 2 issues in sshd configuration override files #174

merged 2 commits into from
Feb 19, 2024

Conversation

bbaassssiiee
Copy link
Member

Overall Review of Changes:

  • We like full control over PermitRootLogin and X11Forwarding.
  • Therefore we should fix all config files.

Issue Fixes:

Enhancements:

How has this been tested?:

---

- name: Security Audit
  hosts: all
  become: true
  gather_facts: true

  pre_tasks:

    - name: Install packages
      ansible.builtin.package:
        state: present
        name:
          - openscap-scanner
          - scap-security-guide

  post_tasks:

    - name: Run CIS oscap scan and create /tmp/report.html
      ansible.builtin.command:
        oscap xccdf eval --profile cis \
          --report /tmp/report.html \
          /usr/share/xml/scap/ssg/content/ssg-almalinux9-ds.xml
      changed_when: true
      no_log: false
      register: scan_return
      failed_when: scan_return.stdout is not defined

    - name: Set permissions
      ansible.builtin.file:
        path: /tmp/report.html
        owner: "{{ ansible_ssh_user }}"
        mode: '0600'

Copy link
Member

@uk-bolly uk-bolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch and update
thanks

@uk-bolly uk-bolly merged commit 03e2a28 into ansible-lockdown:devel Feb 19, 2024
4 checks passed
@uk-bolly uk-bolly mentioned this pull request Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants