
lineinfile uses 'dest' for the file to modify instead of 'path'. Change-Id: I52b9e97a79ddd4e9207b4bdfa4f4a49df04f8990
121 lines
2.9 KiB
YAML
121 lines
2.9 KiB
YAML
---
|
|
# Copyright 2016, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
- name: Check if gdm is installed and configured
|
|
stat:
|
|
path: /etc/gdm/custom.conf
|
|
register: RHEL_07_010430_gdm_conf
|
|
check_mode: no
|
|
|
|
- name: RHEL-07-010430 - The operating system must not allow an unattended or automatic logon to the system via a graphical user interface
|
|
lineinfile:
|
|
dest: /etc/gdm/custom.conf
|
|
line: "^AutomaticLoginEnable=true"
|
|
state: absent
|
|
when:
|
|
- RHEL_07_010430_gdm_conf.stat.exists
|
|
- security_disable_gdm_automatic_login | bool
|
|
tags:
|
|
- graphical
|
|
- high
|
|
- RHEL-07-010430
|
|
|
|
- name: RHEL-07-010431 - The operating system must not allow guest logon to the system.
|
|
lineinfile:
|
|
dest: /etc/gdm/custom.conf
|
|
line: "^TimedLoginEnable=true"
|
|
state: absent
|
|
when:
|
|
- RHEL_07_010430_gdm_conf.stat.exists
|
|
- security_disable_gdm_timed_login | bool
|
|
tags:
|
|
- graphical
|
|
- high
|
|
- RHEL-07-010431
|
|
|
|
- name: Check for dconf profiles
|
|
stat:
|
|
path: /etc/dconf/profile
|
|
register: dconf_check
|
|
tags:
|
|
- always
|
|
|
|
- name: Create a user profile in dconf
|
|
copy:
|
|
src: dconf-user-profile
|
|
dest: /etc/dconf/profile/user
|
|
when:
|
|
- dconf_check.stat.exists
|
|
tags:
|
|
- graphical
|
|
- medium
|
|
- RHEL-07-010060
|
|
- RHEL-07-010070
|
|
- RHEL-07-010071
|
|
- RHEL-07-010073
|
|
- RHEL-07-010074
|
|
|
|
- name: Create dconf directories
|
|
file:
|
|
path: /etc/dconf/db/local.d/
|
|
state: directory
|
|
with_items:
|
|
- /etc/dconf/db/local.d/
|
|
- /etc/dconf/db/local.d/locks
|
|
when:
|
|
- dconf_check.stat.exists
|
|
tags:
|
|
- graphical
|
|
- medium
|
|
- RHEL-07-010060
|
|
- RHEL-07-010070
|
|
- RHEL-07-010071
|
|
- RHEL-07-010073
|
|
- RHEL-07-010074
|
|
|
|
- name: Configure graphical session locking
|
|
template:
|
|
src: dconf-screensaver-lock.j2
|
|
dest: /etc/dconf/db/local.d/00-screensaver
|
|
when:
|
|
- dconf_check.stat.exists
|
|
notify:
|
|
- dconf update
|
|
tags:
|
|
- graphical
|
|
- medium
|
|
- RHEL-07-010060
|
|
- RHEL-07-010070
|
|
- RHEL-07-010071
|
|
- RHEL-07-010073
|
|
- RHEL-07-010074
|
|
|
|
- name: Prevent users from changing graphical session locking configurations
|
|
template:
|
|
src: dconf-session-user-config-lockout.j2
|
|
dest: /etc/dconf/db/local.d/locks/session
|
|
when:
|
|
- dconf_check.stat.exists
|
|
notify:
|
|
- dconf update
|
|
tags:
|
|
- graphical
|
|
- medium
|
|
- RHEL-07-010060
|
|
- RHEL-07-010070
|
|
- RHEL-07-010071
|
|
- RHEL-07-010073
|
|
- RHEL-07-010074
|