Compare commits
No commits in common. "5eb684e7ea0dfd859b0e73403cd7152b50ecf3f2" and "1ea39b8117fe0ca53beadb22377724e9540eac7e" have entirely different histories.
5eb684e7ea
...
1ea39b8117
4 changed files with 3 additions and 16 deletions
|
@ -5,9 +5,7 @@ Host *
|
||||||
StrictHostKeyChecking yes
|
StrictHostKeyChecking yes
|
||||||
GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
|
GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
|
||||||
|
|
||||||
% if multiplex_incoming:
|
|
||||||
Host ${' '.join(sorted(multiplex_hosts))}
|
Host ${' '.join(sorted(multiplex_hosts))}
|
||||||
ControlMaster auto
|
ControlMaster auto
|
||||||
ControlPath ~/.ssh/multiplex-%C
|
ControlPath ~/.ssh/multiplex-%C
|
||||||
ControlPersist 5m
|
ControlPersist 5m
|
||||||
% endif
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ files = {
|
||||||
'/etc/ssh/ssh_config': {
|
'/etc/ssh/ssh_config': {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': {
|
||||||
'multiplex_incoming': node.metadata.get('ssh/multiplex_incoming'),
|
|
||||||
'multiplex_hosts': set(
|
'multiplex_hosts': set(
|
||||||
str(ip_interface(other_node.metadata.get('network/internal/ipv4')).ip)
|
str(ip_interface(other_node.metadata.get('network/internal/ipv4')).ip)
|
||||||
for other_node in repo.nodes
|
for other_node in repo.nodes
|
||||||
|
|
|
@ -34,21 +34,12 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# CHECK FOR INCOMING SSH CONNECTIONS
|
# CHECK FOR ACTIVE LOGINS
|
||||||
|
|
||||||
LOGINS=$(netstat -np | grep 'ESTABLISHED.*sshd' | tr -s ' ' | cut -d' ' -f5,7,8)
|
LOGINS=$(netstat -tnpa | grep 'ESTABLISHED.*sshd' | tr -s ' ' | cut -d' ' -f5,7-8 | paste -d',' -s | sed 's/,/, /')
|
||||||
if ! [[ -z "$LOGINS" ]]
|
if ! [[ -z "$LOGINS" ]]
|
||||||
then
|
then
|
||||||
echo "ABORT: incoming ssh connections: $LOGINS"
|
echo "ABORT: users logged in: $LOGINS"
|
||||||
exit 75
|
|
||||||
fi
|
|
||||||
|
|
||||||
# CHECK FOR OUTGOING SSH CONNECTIONS
|
|
||||||
|
|
||||||
LOGINS=$(netstat -np | grep 'ESTABLISHED.*ssh[^d]' | tr -s ' ' | cut -d' ' -f5,7,8)
|
|
||||||
if ! [[ -z "$LOGINS" ]]
|
|
||||||
then
|
|
||||||
echo "ABORT: outgoing ssh connections: $LOGINS"
|
|
||||||
exit 75
|
exit 75
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ def backup(metadata):
|
||||||
options['mountpoint']
|
options['mountpoint']
|
||||||
for options in metadata.get('zfs/datasets').values()
|
for options in metadata.get('zfs/datasets').values()
|
||||||
if options.get('backup', True)
|
if options.get('backup', True)
|
||||||
and not options.get('mountpoint', None) in [None, 'none']
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue