I keep hearing it but it's starting to sound like Red Hat marketing like Macs don't get viruses.
A non-LTS Ubuntu release should be avoided, since they tend to be less stable.
If you're using something in the Debian family, Debian itself is probably the much better choice unless you're looking to use Canonical's enterprise products.
- Ubuntu is not stable
- it is not hardened out of the box
- it can contain dangerous configuration out of the box
- it calls home
- it will tempt you to install dev packages or other packages unfit for production (because devs dev on ubuntu and they require the dev packages)
But please, don't mind me. Other people are better at explaining this. I'm biassed.
Surprised about Ubuntu, what about Debian? Share same... Hmm...
A lot of these I have to tick off.
Also curious as to why Ubuntu isn't suitable for production.
I am on an Amazon EC2 in this particular case, also curious that Apache was also on there but only nginx is running. Had a long TTFB was trying to figure out what was wrong. Upon restart (new instance) I guess I got lucky, now back to regular site speed around 2 seconds load (full page).
Sorry rambling, cool stuff. Been on VPS, I guess EC2 is still the same thing but next would be serverless I guess.
However, the application which is being served, may produce different errors (failed login attempt, attempt for sql injection, cross site attack, ...). Some things are better logged by the application, Then the application needs to produce these logs. An awful lot of applications do nothing when presented with any of these type of attacks, making them extremely vulnerable. It's the dev's job to provide logging.
Debian: fine if you like pain :) it's stable.
Also it is somewhat of a similar question as to how Git is public but private.(Not GitHub your own setup)
Another possibility would be to first pass a reverse proxy that will request a client-side certificate. That'd make it pretty secure.
A password protected directory is just asking for a brute force through a botnet. Your failtoban won't even block anything because the attacker would only let 1 host attempt a password once per 30 min or per hour. But if he has thousands of bots to his disposal, he can still bruteforce a couple times a second.
That's OK you say. I have a strong password. Don't forget: Each connection and failed login attempts is logged. Your logfile will quickly grow. If you did not set a seperate VAR partition on your disk, your root disk will quickly get full and server will crash. Additionally, it will fill up your bandwith and be as effective as a ddos attack.
Don't use passwords. Use certificates. easier for you, impossible to hack.
There are other methods of course, but these would be my preferred methods. Setting phpmyadmin publically is asking to get your data stolen. Do not assume there are not exploits in the latest phpmyadmin. But don't forget to update it within the first 10 minutes when a security patch comes along, otherwise your data may well already be compromised.
Use certificates? What is that not keypairs?
I logged into this Digital Ocean droplet and was surprised to see 15,000+ failed login attempts to SSH. I hadn't seen that before.
I don't know if using PHPMyAdmin is noobish. I still primarily use MySQL/Maria (only).
Thanks for the tips. I learn a lot though HN.
Easy (read easier) to do with nginx: https://www.google.de/search?q=nginx+client+side+certificate...
It requires quite a bit of steps, but is as secure as it gets what web access is concerned.
You should not be surprised to see 15k+ failed login attempts on ssh with popular ISP's. As I said, a system is the most vulnerable when it has just been installed and a/the default root password has not yet been changed. Simply disallow password login on ssh, change the port and only allow non-root users you need to allow. I have on my systems only 1 user allowed to login, authenticated by a 4096b key. There is no way an attacker can use ssh if not using an ssh exploit. The system is updated automatically every hour. This way known exploits are very quickly taken care of.
For me, server security has been a practice over many years and it takes many years to perfect your 'secure server setup'. It's depressing how many companies do not adhere good security practices and just leave their systems unprotected. Especially mail servers.
Can you give more clarification? Do you mean LB -> Firewall -> Web Server?
> - run checks on each request on the reverse proxy
Can you give more information on how to do this please.
Thanks
Using a reverse proxy allows you to cache static content, decreasing load. I'm not talking about load balancers. These days you need them when your website pulls _a lot_ of requests (1000/s) Your reverse proxy will also stop unwanted requests and indeed will have a firewall incorperated.
> - run checks on each request on the reverse proxy
post => clamav
post => sqlinjection
get => blacklisted address?
any => iptables (let any connection go through your firewall. It's a check)
don't terminate SSL on reverse proxy though. It's a bad idea, unless you are a bad person and like to read your visitors data they think is secure.
There are plenty of other ways of using security on a reverse proxy. Have a look around on google.
I'd tend to agree about Ubuntu because... why aren't you just using Debian? I would generally opt for CentOS for a prod server, but I am now starting to think about using OpenBSD in production environments.
Ultimately it comes down to the way you configure the server, not the distro you use. The only benefit of Enterprise Linux (CentOS, Red Hat, Fedora, Oracle) over Debian out-of-the-box (that I am aware of) is the presence of SELinux, which you can still set up on Debian. All have insecure configs by default.
I will say that the live kernel patching in Ubuntu Server now is cool. I used KSplice on CentOS before it was discontinued (only on Oracle Linux now).
() updated, rkhunter, clamav, ...
At work, I show developers, ops and infrastructure folks these things and let them decide if they want to test and implement any of it.
The above list will help you from most scriptkiddy attacks, which are 99% of the attacks I have experienced. It's a good idea not to piss off anybody on the net or do it with a sufficiently obscure account.
- reverse proxy to backend webserver
- run checks on each request on the reverse proxy
- close all ports except what needs to be open
- only allow access to what needs to be seen
- perform frequent security updates (script it, automate it, run it hourly)
- never install more software then strictly required
- never allow SSH directly to your public address
- for ssh, use custom ports, cert (4096b) with passwords
- install logwatch or something else that will inform you about logs (elk stack)
- automate checks in logs for tell-tale signs of scriptkiddies (attempted access to /wp-admin or phpmyadmin for example) => automate adding source IP's to firewalls
- frequently check for malicious code (clamav, rkhunter, ...)
- only use stable and tested software
- only use stable and tested OS (Centos/redhat. DO NOT run production on anything else, especially ubuntu.)
- do not use ubuntu for production. it is not suited.
- install failtoban
from dev pov:
- implement measures to prevent sql injection
- don't require production to install dev libraries
- don't require production to install packages only available on ubuntu
- log strange behaviour to a file, make sure actions can be automated (iptable drop)
I'm no dev, but those are things I'd like dev's to do with their software.