File tree 2 files changed +39
-1
lines changed
lib/puppet/parser/functions
2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change
1
+ # encoding: utf-8
2
+ #
3
+ # Copyright 2015, Dominik Richter
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ Puppet ::Parser ::Functions . newfunction ( :use_privilege_separation , :type => :rvalue ) do |args |
19
+ os = args [ 0 ] . downcase
20
+ osrelease = args [ 1 ]
21
+ osmajor = osrelease . sub ( /\. .*/ , '' )
22
+
23
+ ps53 = 'yes'
24
+ ps59 = 'sandbox'
25
+ ps = ps59
26
+
27
+ # redhat/centos/oracle 6.x has ssh 5.3
28
+ if os == 'redhat' || os == 'centos' || os == 'oraclelinux'
29
+ ps = ps53
30
+
31
+ # debian 7.x and newer has ssh 5.9+
32
+ elsif os == 'debian' && osmajor . to_i <= 6
33
+ ps = ps53
34
+ end
35
+
36
+ ps
37
+ end
Original file line number Diff line number Diff line change 76
76
$ciphers = get_ssh_ciphers($::operatingsystem , $::operatingsystemrelease , $cbc_required )
77
77
$macs = get_ssh_macs($::operatingsystem , $::operatingsystemrelease , $weak_hmac )
78
78
$kex = get_ssh_kex($::operatingsystem , $::operatingsystemrelease , $weak_kex )
79
+ $priv_sep = use_privilege_separation($::operatingsystem , $::operatingsystemrelease )
79
80
80
81
$permit_root_login = $allow_root_with_key ? {
81
82
true => ' without-password' ,
169
170
170
171
# Secure Login directives.
171
172
' UseLogin' => ' no' ,
172
- ' UsePrivilegeSeparation' => ' sandbox ' ,
173
+ ' UsePrivilegeSeparation' => $priv_sep ,
173
174
' PermitUserEnvironment' => ' no' ,
174
175
' LoginGraceTime' => ' 30s' ,
175
176
' MaxAuthTries' => 2,
You can’t perform that action at this time.
0 commit comments