Skip to content

Commit

Permalink
add sensitive data
Browse files Browse the repository at this point in the history
  • Loading branch information
vit01 committed Jul 23, 2022
1 parent 16989e7 commit 9242c7e
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions personal.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include software::everywhere
include software::personal
1 change: 1 addition & 0 deletions puppet-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ puppet module install puppetlabs-vcsrepo --version 3.1.1
puppet module install puppetlabs-docker --version 4.4.0
puppet module install saz-resolv_conf --version 5.0.0
puppet module install puppet-openssl --version 2.0.1
puppet module install saz-ssh --version 6.2.0
#puppet module install eyp-python --version 0.1.13
5 changes: 5 additions & 0 deletions sensitive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cmd_replace='sed "s|empty1|$SSH_KEY|g; s|empty2|$SSH_USER|g" software/manifests/personaltpl.pp > software/manifests/personal.pp'

sops exec-env ./ssh-info.env "$cmd_replace"
46 changes: 46 additions & 0 deletions software/manifests/personaltpl.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
class software::personal {
$user = 'vitya'

ssh_authorized_key { 'empty2':
ensure => present,
user => $user,
type => 'ssh-rsa',
key => 'empty1'
}

$ssh_service_name = $operatingsystem ? {
debian => "ssh",
ubuntu => "ssh",
archlinux => "sshd",
manjarolinux => "sshd"
}

#service { 'ssh':
# name => $ssh_service_name,
# ensure => "running",
# enable => "true"
#}

class { 'ssh::server':
validate_sshd_file => true,
options => {
'Match User www-data' => {
'ChrootDirectory' => '%h',
'ForceCommand' => 'internal-sftp',
'PasswordAuthentication' => 'no',
'AllowTcpForwarding' => 'no',
'X11Forwarding' => 'no',
},
'Match User vitya' => {
'PasswordAuthentication' => 'yes',
'AllowTcpForwarding' => 'yes',
'X11Forwarding' => 'yes',
},
'PrintMotd' => 'no',
'StreamLocalBindUnlink' => 'yes',
'PasswordAuthentication' => 'yes',
'PermitRootLogin' => 'no',
'Port' => 356,
}
}
}
4 changes: 4 additions & 0 deletions zaebis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ fi
if [ "$1" = "science" ]; then
puppet apply --modulepath="$puppetpath" science.pp
fi

if [ "$1" = "personal" ]; then
puppet apply --modulepath="$puppetpath" personal.pp
fi

0 comments on commit 9242c7e

Please sign in to comment.