Skip to content

Commit 17e6044

Browse files
authored
Merge pull request #21 from CatalystCode/harden
Harden featureService
2 parents dc3d165 + 26fc2f1 commit 17e6044

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

scripts/deploy

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/install.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ DUMP_VERSION='v2'
77
# setup
88
build_dependencies='curl git build-essential'
99
sudo apt-get update > /dev/null
10+
sudo apt-get upgrade -y > /dev/null
1011
sudo apt-get install -y ${build_dependencies} > /dev/null
1112

1213
# install postgres
@@ -67,6 +68,41 @@ EOF
6768
sudo supervisorctl reread
6869
sudo supervisorctl update
6970

71+
# harden ssh
72+
sudo apt-get install -y fail2ban > /dev/null
73+
sudo tee '/etc/ssh/sshd_config' > /dev/null << EOF
74+
Port 22
75+
Protocol 2
76+
HostKey /etc/ssh/ssh_host_rsa_key
77+
HostKey /etc/ssh/ssh_host_dsa_key
78+
HostKey /etc/ssh/ssh_host_ecdsa_key
79+
HostKey /etc/ssh/ssh_host_ed25519_key
80+
UsePrivilegeSeparation yes
81+
KeyRegenerationInterval 3600
82+
ServerKeyBits 1024
83+
SyslogFacility AUTH
84+
LogLevel INFO
85+
LoginGraceTime 120
86+
PermitRootLogin no
87+
StrictModes yes
88+
RSAAuthentication yes
89+
PubkeyAuthentication yes
90+
IgnoreRhosts yes
91+
RhostsRSAAuthentication no
92+
HostbasedAuthentication no
93+
PermitEmptyPasswords no
94+
ChallengeResponseAuthentication no
95+
PasswordAuthentication no
96+
X11Forwarding no
97+
PrintMotd no
98+
PrintLastLog yes
99+
TCPKeepAlive yes
100+
AcceptEnv LANG LC_*
101+
Subsystem sftp /usr/lib/openssh/sftp-server
102+
UsePAM no
103+
EOF
104+
sudo systemctl reload ssh
105+
70106
# cleanup
71107
sudo apt-get remove -y ${build_dependencies} > /dev/null
72108
sudo apt-get autoremove -y > /dev/null

0 commit comments

Comments
 (0)