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

feat: customize user paths default #692

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions roles/os_hardening/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ To prevent some of the filesystems from being disabled, add them to the `os_file
- Description: true if this is a desktop system, ie Xorg, KDE/GNOME/Unity/etc.
- Type: bool
- Required: no
- `os_env_user_paths`
- Default: `[/usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin]`
- Description: Specify paths to the user's `PATH` variable.
- Type: list
- Required: no
- `os_env_extra_user_paths`
- Default: `"[]"`
- Description: add additional paths to the user's `PATH` variable (default is empty).
Expand Down
1 change: 1 addition & 0 deletions roles/os_hardening/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
os_desktop_enable: false
os_env_user_paths: [/usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin]
os_env_extra_user_paths: []
os_auth_pw_max_age: 60
os_auth_pw_min_age: 7 # Discourage password cycling
Expand Down
7 changes: 1 addition & 6 deletions roles/os_hardening/tasks/minimize_access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
- name: Find files with write-permissions for group # noqa command-instead-of-shell
ansible.builtin.shell: find -L {{ item }} -perm /go+w -type f
with_community.general.flattened:
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- "{{ os_env_user_paths }}"
- "{{ os_env_extra_user_paths }}"
register: minimize_access_directories
ignore_errors: true
Expand Down