Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Using more than one rule in a Group or User Match block? #207

Closed
paulbrowne opened this issue Mar 13, 2019 · 2 comments
Closed

Using more than one rule in a Group or User Match block? #207

paulbrowne opened this issue Mar 13, 2019 · 2 comments
Assignees
Labels

Comments

@paulbrowne
Copy link

paulbrowne commented Mar 13, 2019

Describe the bug
This may not be be a bug per se, I'm just slightly confused about how to specify more than 1 rule in a MatchGroup block using the ssh_server_match_group role variable, as specifying this as a list fails with e.g.

fatal: [10.0.10.19]: FAILED! => {"changed": false, "msg": "AttributeError: 'list' object has no attribute 'splitlines'"}

Expected behavior
ssh_server_match_group rules accepts a list of rules to apply in the MatchGroup block

**Example Playbook**
---
- hosts: Bastion
  gather_facts: true
  become: true
  roles:
    - role: ssh-hardening
      ssh_allow_groups: 'centos'
      ssh_use_pam: true
      sftp_enabled: true
      sftp_chroot: true 
      ssh_server_match_group:
        - group: '{{ rsyslog_rundeck_group }}'
          rules:
            - 'AllowTcpForwarding yes'
            - 'PermitTTY no'

OS / Environment
CentOS7.6 inventory tagets

**Ansible Version**
ansible 2.7.8
  config file = /home/pfb29/.ansible.cfg
  configured module search path = [u'/home/pfb29/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/pfb29/.virtualenvs/openstackclient/lib/python2.7/site-packages/ansible
  executable location = /home/pfb29/.virtualenvs/openstackclient/bin/ansible
  python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

Role Version
dev-sec.ssh-hardening.6.0.0

@rndmh3ro rndmh3ro self-assigned this Mar 15, 2019
@rndmh3ro rndmh3ro added the bug label Mar 15, 2019
@rndmh3ro
Copy link
Member

Thanks @paulbrowne, that's definitely a bug. I created PR #208 to fix this.

rndmh3ro added a commit that referenced this issue Mar 20, 2019
fix multiple match rules not working #207
@rndmh3ro
Copy link
Member

Should be fixed by #208

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants