Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add profile::ncsa::lhn_target_from_bdc #181

Merged
merged 1 commit into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions hieradata/org/ncsa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,6 @@ pakrat_client::repos:
# if we use GPG key checking, it's probably because we have only CentOS-built RPMs in the repo
gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7"

profile::ncsa::allow_qualys_scan::ip: "141.142.148.51"

profile::ncsa::allow_ssh_from_bastion::bastion_nodelist:
- 10.142.181.15
- 141.142.181.15
profile::ncsa::allow_ssh_from_bastion::allow_groups:
- lsst_admin_ncsa
- lsst_int_bastion

profile::ncsa::allow_ssh_from_login::login_nodelist:
- 10.142.181.16
- 10.142.181.17
- 10.142.181.18
- 141.142.181.16
- 141.142.181.17
- 141.142.181.18
profile::ncsa::allow_ssh_from_login::allow_groups:
- lsst_admin_ncsa

profile::ncsa::allow_sudo::groups:
- lsst_admin_ncsa

python::dev: "present"
python::pip: "present"
python::python_pips:
Expand Down
17 changes: 17 additions & 0 deletions hieradata/org/ncsa/role/lhntest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
classes:
- profile::ncsa::allow_qualys_scan
- profile::ncsa::allow_ssh_from_bastion
- profile::ncsa::allow_ssh_from_login
- profile::ncsa::baseline_cfg
- profile::ncsa::lhn_target_from_bdc
- profile::ncsa::system_authnz
- profile::ncsa::xcat_client
- profile::sal

profile::ncsa::allow_sudo::groups:
- "lsst_admin_tucson"

sal2::ospl_version: "6.9.0"
sal2::ts_idl_version: "1.2.2_4.1.1_6.0.0"
sal2::ts_salobj_version: "5.15.0"
7 changes: 7 additions & 0 deletions hieradata/site/nts/role/puppet_master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
profile::ncsa::allow_ssh_from_bastion:
- "lsst_level1_adm"
profile::ncsa::allow_ssh_from_login:
- "lsst_level1_adm"
profile::ncsa::allow_sudo::groups:
- "lsst_level1_adm"
12 changes: 0 additions & 12 deletions site/profile/data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
---
# Override default hiera lookup options (keep this at the top)
lookup_options:
profile::ncsa::allow_ssh_from_login::allow_groups:
merge: "unique"
profile::ncsa::allow_ssh_from_bastion::allow_groups:
merge: "unique"
profile::ncsa::allow_sudo::groups:
merge: "unique"
profile::ncsa::allow_sudo::users:
merge: "unique"
profile::sal::miniconda_pkgs:
merge: "unique"

# Everything else goes down below. Sort keys alphabetically

profile::ncsa::allow_ssh_from_bastion::custom_cfg: {}

profile::ncsa::allow_ssh_from_login::custom_cfg: {}

profile::sal::miniconda_pkgs: []
49 changes: 49 additions & 0 deletions site/profile/data/org/ncsa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# Override default hiera lookup options (keep this at the top)
lookup_options:
profile::ncsa::allow_ssh_from_bastion::allow_groups:
merge: "unique"
profile::ncsa::allow_ssh_from_bdc::allow_groups:
merge: "unique"
profile::ncsa::allow_ssh_from_login::allow_groups:
merge: "unique"
profile::ncsa::allow_sudo::groups:
merge: "unique"
profile::ncsa::allow_sudo::users:
merge: "unique"

# Everything else goes down below. Sort keys alphabetically

profile::ncsa::allow_ssh_from_bastion::allow_groups:
- "lsst_admin_ncsa"
- "lsst_int_bastion"
profile::ncsa::allow_ssh_from_bastion::bastion_nodelist:
- "10.142.181.15"
- "141.142.181.15"
profile::ncsa::allow_ssh_from_bastion::custom_cfg: {}

profile::ncsa::allow_ssh_from_bdc::allow_groups:
- "lsst_admin_ncsa"
- "lsst_admin_tucson"
profile::ncsa::allow_ssh_from_bdc::custom_cfg: {}
profile::ncsa::allow_ssh_from_bdc::nodelist:
- "139.229.140.0/22"
- "139.229.146.0/24"
- "139.229.149.0/24"


profile::ncsa::allow_ssh_from_login::allow_groups:
- "lsst_admin_ncsa"
profile::ncsa::allow_ssh_from_login::custom_cfg: {}
profile::ncsa::allow_ssh_from_login::login_nodelist:
- "10.142.181.16"
- "10.142.181.17"
- "10.142.181.18"
- "141.142.181.16"
- "141.142.181.17"
- "141.142.181.18"

profile::ncsa::allow_sudo::groups:
- "lsst_admin_ncsa"

profile::ncsa::allow_qualys_scan::ip: "141.142.148.51"
45 changes: 45 additions & 0 deletions site/profile/manifests/ncsa/allow_ssh_from_bdc.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# @summary Allow incoming ssh from BDC nodes
#
# Allow incoming ssh from BDC nodes
#
# @param
# nodelist
# Type: Array
# Desc: one or more hostnames / IPs / CIDRs
# Note: must contain at least 1 item
# @param
# allow_groups
# Type: Array
# Desc: one or more LDAP / UNIX groups that are allowed to login from
# any of the nodes in nodelist
# Note: can be empty
# @example
# include profile::allow_ssh_from_BDC
#
class profile::ncsa::allow_ssh_from_bdc (
Array[ String ] $allow_groups,
Array[ String, 1 ] $nodelist,
Hash $custom_cfg,
) {
$parms_local = {
'PubkeyAuthentication' => 'yes',
'KerberosAuthentication' => 'yes',
'GSSAPIAuthentication' => 'yes',
}

#add in allow_groups if non-empty
if size( $allow_groups ) > 0 {
$groups = { 'AllowGroups' => $allow_groups }
}
else {
$groups = {}
}

$params = $parms_local + $groups + $custom_cfg

::sshd::allow_from{ 'allow ssh from BDC nodes':
hostlist => $nodelist,
groups => $allow_groups,
additional_match_params => $params,
}
}
17 changes: 17 additions & 0 deletions site/profile/manifests/ncsa/lhn_target_from_bdc.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class profile::ncsa::lhn_target_from_bdc {

$protocols = [ 'udp', 'tcp' ]
$sources = [ '139.229.140.0/22', '139.229.146.0/24', '139.229.149.0/24' ]

$protocols.each | $proto | {
$sources.each | $src | {
firewall { "550 profile::ncsa::allow_lhn_from_bdc - ${src} + ${proto}" :
action => 'accept',
dport => '5000-5050',
source => $src,
proto => $proto,
}
}
}

}