ComplianceAsCode / ComplianceAsCode/content

ansible-role-rhel8-cis fails to apply with issues with "Limit Password Reuse: password-auth"

Open
#10,757 5 comments 0 reactions 1 assignee Claimed by @marcusburghardt View on GitHub
Ansible CIS RHEL8 triaged
Dominant language
Shell
Stars
2.8k
Forks
828
Avg merge
3d 8m
Merged PRs (30d)
80

Description

#### Description of problem:

TASK [RedHatOfficial.rhel8_cis : Limit Password Reuse: password-auth - Check if any custom profile with the same name was already created] *****************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'authselect_current_profile is not match(\"custom/\")' failed. The error was: error while evaluating conditional (authselect_current_profile is not match(\"custom/\")): 'authselect_current_profile' is undefined. 'authselect_current_profile' is undefined\n\nThe error appears to be in '/root/.ansible/roles/RedHatOfficial.rhel8_cis/tasks/main.yml': line 2179, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n - authselect_current_profile is not match(\"custom/\")\n - name: \"Limit Password Reuse: password-auth - Check if any custom profile with the same name was already created\"\n ^ here\nThis one looks easy to fix. It seems that there is a value started\nwith a quote, and the YAML parser is expecting to see the line ended\nwith the same kind of quote. For instance:\n\n when: \"ok\" in result.stdout\n\nCould be written as:\n\n when: '\"ok\" in result.stdout'\n\nOr equivalently:\n\n when: \"'ok' in result.stdout\"\n"}

#### SCAP Security Guide Version:

Latest version from GitHub

#### Operating System Version:

RHEL 8.8

#### Steps to Reproduce:

1. execute command ansible-galaxy install RedHatOfficial.rhel8_cis
2. create a basic playbook that contains the role:

- hosts: all
roles:
- { role: RedHatOfficial.rhel8_cis }

4. check playbook with command ansible-playbook -i "localhost," -c local --check playbook.yml
5. Failure

#### Actual Results:

See error message above - command fails to execute do to an unset variable, but reading the yaml file it appears the variable should be set.

#### Expected Results:

Profile should apply without errors

#### Additional Information/Debugging Steps:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.