Skip to content

Commit

Permalink
Merge pull request dev-sec#279 from kostasns/fix_amazon_build
Browse files Browse the repository at this point in the history
fix: Amazon linux build
  • Loading branch information
rndmh3ro committed May 8, 2020
2 parents d7343be + 936d758 commit eef6e11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/opensshd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ LogLevel {{ sshd_log_level }}
UseLogin no
{% endif %}
{% if sshd_version is version('7.5', '<') %}
UsePrivilegeSeparation {% if (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version <= '6') or (ansible_facts.os_family in ['Oracle Linux', 'RedHat'] and ansible_facts.distribution_major_version <= '6') -%}{{ssh_ps53}}{% else %}{{ssh_ps59}}{% endif %}
UsePrivilegeSeparation {% if (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version <= '6') or (ansible_facts.os_family in ['Oracle Linux', 'RedHat'] and ansible_facts.distribution_major_version <= '6' and not ansible_facts.distribution == 'Amazon') -%}{{ssh_ps53}}{% else %}{{ssh_ps59}}{% endif %}
{% endif %}

LoginGraceTime 30s
Expand Down
4 changes: 3 additions & 1 deletion tests/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
- file: path="/var/run/sshd" state=directory
- name: create ssh host keys
command: "ssh-keygen -A"
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or ansible_facts.distribution == "Fedora"
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or
ansible_facts.distribution == "Fedora" or
ansible_facts.distribution == "Amazon"

roles:
- ansible-ssh-hardening
4 changes: 3 additions & 1 deletion tests/default_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
- file: path="/var/run/sshd" state=directory
- name: create ssh host keys
command: "ssh-keygen -A"
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or ansible_facts.distribution == "Fedora"
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or
ansible_facts.distribution == "Fedora" or
ansible_facts.distribution == "Amazon"

roles:
- ansible-ssh-hardening
Expand Down

0 comments on commit eef6e11

Please sign in to comment.