Verify Permissions on passwd File
An XCCDF Rule
Description
To properly set the permissions of /etc/passwd
, run the command:
$ sudo chmod 0644 /etc/passwd
Rationale
If the /etc/passwd
file is writable by a group-owner or the
world the risk of its compromise is increased. The file contains the list of
accounts on the system and associated information, and protection of this file
is critical for system security.
- ID
- xccdf_org.ssgproject.content_rule_file_permissions_etc_passwd
- Severity
- Medium
- References
- Updated
Remediation - Shell Script
chmod u-xs,g-xws,o-xwt /etc/passwd
Remediation - Ansible
- name: Test for existence /etc/passwd
stat:
path: /etc/passwd
register: file_exists
tags:
- CCE-82029-0