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

Deprecation warnings for os_hardening #638

Closed
DonEstefan opened this issue Feb 20, 2023 · 2 comments
Closed

Deprecation warnings for os_hardening #638

DonEstefan opened this issue Feb 20, 2023 · 2 comments

Comments

@DonEstefan
Copy link
Contributor

DonEstefan commented Feb 20, 2023

Description

TASK [devsec.hardening.os_hardening : Remove suid/sgid bit from binaries in blacklist | os-06] ******************************************************
[DEPRECATION WARNING]: "listify_lookup_plugin_terms" does not use "dataloader" anymore, the ability to pass it in will be removed in future versions. This feature will be removed in version 2.18. 

[...]

TASK [devsec.hardening.os_hardening : Find files with write-permissions for group] *****************************************************************
[DEPRECATION WARNING]: "listify_lookup_plugin_terms" does not use "dataloader" anymore, the ability to pass it in will be removed in future versions. This feature will be removed in version 2.18. 

[...]

TASK [devsec.hardening.os_hardening : Change system accounts not on the user provided ignore-list] *************************************************
[DEPRECATION WARNING]: "listify_lookup_plugin_terms" does not use "dataloader" anymore, the ability to pass it in will be removed in future versions. This feature will be removed in version 2.18. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

Reproduction steps

# ansible --version
ansible [core 2.14.1]

# ansible-playbook site.yml --tags os_hardening

Current Behavior

"DEPRECATION WARNING" is shown

Expected Behavior

"DEPRECATION WARNING" is not shown

OS / Environment

centos8

Ansible Version

ansible [core 2.14.1]
  config file = /workspaces/ansible-proxy/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /workspaces/ansible-proxy/collections
  executable location = /usr/bin/ansible
  python version = 3.9.13 (main, Nov  9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

Collection Version

collections:
    - name: devsec.hardening
      version: "8.4.0"

Additional information

No response

@DonEstefan DonEstefan added the bug label Feb 20, 2023
@DonEstefan DonEstefan changed the title Deprecation warning for os_hardening -> Remove suid/sgid bit Deprecation warnings for os_hardening Feb 20, 2023
@schurzi schurzi removed the bug label Feb 24, 2023
@schurzi
Copy link
Contributor

schurzi commented Feb 24, 2023

Thank you for reporting this. This is however not a bug in our collection, the deprecation warning is triggered by using with_community.general.flattened from https://github.com/ansible-collections/community.general.

Here is an example playbook:

- hosts: localhost
  gather_facts: False
  tasks:
    - name: test
      debug:
        msg: "{{ item }}"
      with_community.general.flattened:
        - a
        - b
        - c

which produces the output:

# ansible-playbook /test.yml

PLAY [localhost] **********************************************************************************************************************************************************************************************************************************

TASK [test] ***************************************************************************************************************************************************************************************************************************************
[DEPRECATION WARNING]: "listify_lookup_plugin_terms" does not use "dataloader" anymore, the ability to pass it in will be removed in future versions. This feature will be removed in version 2.18. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
ok: [localhost] => (item=a) => {
    "msg": "a"
}
ok: [localhost] => (item=b) => {
    "msg": "b"
}
ok: [localhost] => (item=c) => {
    "msg": "c"
}

PLAY RECAP ****************************************************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

The feature was deprecated in Ansible with ansible/ansible#78244. And it seems this deprecation has not been applied to the community.general code.

I will open a PR in their repository but we have no influence on when this will be merged or shipped.

@schurzi
Copy link
Contributor

schurzi commented Feb 24, 2023

I have opened a PR in Ansible community.general (ansible-collections/community.general#6074) and will now close this issue, since nothing can be done from our side.

@schurzi schurzi closed this as completed Feb 24, 2023
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

No branches or pull requests

2 participants