diff options
author | lhinds <lhinds@redhat.com> | 2017-03-23 13:28:19 +0000 |
---|---|---|
committer | lhinds <lhinds@redhat.com> | 2017-03-29 20:25:21 +0100 |
commit | 87850942adfe0a2ed44441913d2442d1fd86a809 (patch) | |
tree | 6c6449b0082f8b0f566e15195ee55dae749c3a2a /manifests/profile | |
parent | 4c07c75d5b77fd146ada9c464769822a828b4601 (diff) |
Adds service for managing securetty
This adds the ability to manage the securetty file.
By allowing management of securetty, operators can limit root
console access and improve security through hardening.
Change-Id: Ic4647fb823bd112648c5b8d102913baa8b4dac1c
Closes-Bug: #1665042
Diffstat (limited to 'manifests/profile')
-rw-r--r-- | manifests/profile/base/securetty.pp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/manifests/profile/base/securetty.pp b/manifests/profile/base/securetty.pp new file mode 100644 index 0000000..a04c559 --- /dev/null +++ b/manifests/profile/base/securetty.pp @@ -0,0 +1,46 @@ +# Copyright 2016 Red Hat, Inc. +# All Rights Reserved. +# +# 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. +# +# == Class: tripleo::profile::base::securetty +# +# Sets securetty Parameters +# +# === Parameters +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') +# +# [*tty_list*] +# Hash of values for /etc/securetty console +# Defaults to hiera('securetty::tty_list') +# +class tripleo::profile::base::securetty ( + $step = hiera('step'), + $tty_list = hiera('tty_list)', []), +) { + if $step >=1 { + $ttys = join( $tty_list, "\n") + + file { '/etc/securetty': + ensure => file, + content => template( 'tripleo/securetty/securetty.erb' ), + owner => 'root', + group => 'root', + mode => '0600' + } + } +} |