Skip to content

Commit

Permalink
Merge pull request #197 from szEvEz/master
Browse files Browse the repository at this point in the history
ensure that permissions to su-binary are not restricted to root user and group only, if os_security_users_allow contains the value change_user
  • Loading branch information
rndmh3ro committed Oct 12, 2018
2 parents e71fce9 + df13320 commit d90f894
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,25 @@ To prevent some of the filesystems from being disabled, add them to the `os_file

## Example Playbook

- hosts: localhost
roles:
- dev-sec.os-hardening

```yaml
- hosts: localhost
roles:
- dev-sec.os-hardening
```

## Changing sysctl variables
If you want to override sysctl-variables, you can use the `sysctl_overwrite` variable (in older versions you had to override the whole `sysctl_dict`).
+So for example if you want to change the IPv4 traffic forwarding variable to `1`, do it like this:

```
- hosts: localhost
roles:
- dev-sec.os-hardening
vars:
sysctl_overwrite:
# Enable IPv4 traffic forwarding.
net.ipv4.ip_forward: 1
If you want to override sysctl-variables, you can use the `sysctl_overwrite` variable (in older versions you had to override the whole `sysctl_dict`).
So for example if you want to change the IPv4 traffic forwarding variable to `1`, do it like this:

```yaml
- hosts: localhost
roles:
- dev-sec.os-hardening
vars:
sysctl_overwrite:
# Enable IPv4 traffic forwarding.
net.ipv4.ip_forward: 1
```

Alternatively you can change Ansible's [hash-behaviour](https://docs.ansible.com/ansible/intro_configuration.html#hash-behaviour) to `merge`, then you only have to overwrite the single hash you need to. But please be aware that changing the hash-behaviour changes it for all your playbooks and is not recommended by Ansible.
Expand Down
2 changes: 1 addition & 1 deletion tasks/minimize_access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
owner: 'root'
group: 'root'
mode: '0750'
when: os_security_users_allow != None
when: '"change_user" not in os_security_users_allow'

0 comments on commit d90f894

Please sign in to comment.