-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add cloud-init hardening for tests (#133)
* add cloud hardening * add .PHONY to quick-test in Makefile
- Loading branch information
1 parent
c5808a0
commit f2556a4
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#cloud-config | ||
hostname: dx-dev-vm | ||
|
||
package_update: true | ||
package_upgrade: true | ||
packages: | ||
- fail2ban | ||
|
||
ssh_pwauth: false | ||
disable_root: true | ||
|
||
users: | ||
- default | ||
- name: linodedx | ||
gecos: The primary account for development on this VM. | ||
shell: /bin/bash | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
lock_passwd: true | ||
ssh_authorized_keys: | ||
- '{{ ssh_pubkey }}' | ||
|
||
write_files: | ||
# Root login over SSH isn't fully disabled by disable_root | ||
- path: /etc/ssh/sshd_config.d/51-disable-root.conf | ||
permissions: "0600" | ||
content: | | ||
PermitRootLogin no | ||
|
||
runcmd: | ||
- service ssh restart | ||
- service fail2ban start --enable | ||
|
||
- ufw default deny incoming | ||
- ufw default allow outgoing | ||
- ufw allow 80,443,21,22/tcp | ||
- ufw enable |