Does anyone have simple security stackscript for ubuntu?

Every time I create a server, I do the same things by hand. It would be great to automate it in some way, but dont know how. I searched through the 800 or so stack scripts for ubuntu, and there are a lot of complex installers for specific products, but I could not find a simple standard one to do the following:

1) apt-get update/upgrade etc.
2) install/configure UWF for only ssh (and posssibly web)
3) install/configure fail2ban
4) create a user for me with sudo and add my certificate.
5) disable passwords.
6) any other standard stuff.

The nearest I could find was this:

https://github.com/nigma/StackScripts/blob/master/123%20-%20lib-system-ubuntu.sh

But it just creates a bunch of functions - there is no instructions on how to actually run it.

I also saw the stackscript with id=1 one has some functions, but I cant see an example of where this is used to set the certificate etc.

Any suggestions.

2 Replies

Taking a look at our public stackscripts, this hardened Ubuntu 16.04 LTS stackscript might get you going in the right direction. I hope this helps!

@nutmix : The StackScript that @scrane mentioned seems like it would be a great starting point for exactly what you mentioned. Also, I maintain that script, so feel free to drop an issue here if you notice anything odd or if things don't work quite as you would expect:

https://github.com/mb243/linux-deployment-scripts

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct