puzzle / puzzle.opnsense

An Ansible Collection to configure an opnsense Firewall
https://puzzle.github.io/puzzle.opnsense/collections/puzzle/opnsense/index.html
GNU General Public License v3.0
23 stars 12 forks source link

Implement/password sanitation before hashing #122

Closed KiLLuuuhh closed 4 months ago

KiLLuuuhh commented 4 months ago

This pull request addresses several critical issues within the system_access_users module, enhancing security and functionality.

Issues and Solutions:

  1. Password Sanitization:

    • Problem: Previously, if a password ended with a backslash (\) or an apostrophe ('), it would cause parsing errors, such as: unexpected identifier "cost", expecting (.
    • Solution: Introduced changes to sanitize passwords before saving, effectively preventing these errors and ensuring data integrity.
  2. Password Verification:

    • Problem: There was no existing method to verify if a user's password needed updating because the current passwords couldn’t be effectively checked.
    • Solution: Implemented a new password_verify method, which allows the system to check existing passwords and determine if updates are necessary.
  3. Group removal handling

    • Problem: If a user is removed from a group, the user attribute groupname is not updated
    • Solution: enhanced the _update_user_groups function, so that the attribute groupname is updated or removed as well

Related Issues:

Closes #120.

DonGiovanni83 commented 4 months ago

Please add a changelog fragment for the bug fix. See https://github.com/puzzle/puzzle.opnsense/blob/main/changelogs/fragments/117-remove-user-shell-attribute-as-enum.yml as an example. The naming of the file must follow the convention of <PR_NR>-<TITLE>.yml