27.07.2016 Views

Hacker Bits, August 2016

HACKER BITS is the monthly magazine that gives you the hottest technology stories crowdsourced by the readers of Hacker News. We select from the top voted stories and publish them in an easy-to-read magazine format. Get HACKER BITS delivered to your inbox every month! For more, visit https://hackerbits.com/2016-08.

HACKER BITS is the monthly magazine that gives you the hottest technology stories crowdsourced by the readers of Hacker News. We select from the top voted stories and publish them in an easy-to-read magazine format.

Get HACKER BITS delivered to your inbox every month! For more, visit https://hackerbits.com/2016-08.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Logwatch monitors your logfiles and<br />

when configured, sends you a daily email<br />

with the information parsed very nicely.<br />

your server (baring application<br />

vulnerabilities), the attacker<br />

would have to have:<br />

1. Access to your certificate<br />

and key to access VPN<br />

2. Access to your computer<br />

to have your private key<br />

3. Access to your passphrase<br />

for your private key<br />

4. Access to your phone for<br />

2FA<br />

These are quite a few hurdles<br />

to jump. Even then to gain<br />

root access via sudo, they'd have<br />

to have deploy's password that<br />

is stored behind AES encryption<br />

(5).<br />

Install this package:<br />

apt-get install libpam-google-authenticator<br />

Set up by running this command<br />

and following the instructions:<br />

su deploy<br />

google-authenticator<br />

2FA is very easy and adds a<br />

great layer of security.<br />

Logwatch<br />

This is really more of a simple<br />

pleasure and monitoring tool<br />

that helps you see what's going<br />

on after the fact. Logwatch monitors<br />

your logfiles and when configured,<br />

sends you a daily email<br />

with the information parsed very<br />

nicely.<br />

The output is quite entertaining<br />

to watch and you'll be<br />

surprised at how many attempts<br />

are made every day to gain<br />

access to your server. I install<br />

it if for no other reason than to<br />

show the team how important<br />

good security is.<br />

There's a great write-up by<br />

DigitalOcean on Logwatch install<br />

and config, but if we're keeping<br />

to 10 minutes, we'll just install it<br />

and run a cron job to run it and<br />

email us daily.<br />

apt-get install logwatch<br />

Add a cron job:<br />

vim /etc/cron.daily/00logwatch<br />

Add this line to the cron file:<br />

/usr/sbin/logwatch --output<br />

mail --mailto you@example.com<br />

--detail high<br />

All done<br />

There you are. Your main concern<br />

and point of vulnerability<br />

after completing this will be<br />

your application and services.<br />

These are another animal entirely<br />

though.<br />

We're making a big push to<br />

externalize our processes and<br />

best practices. If you're interested<br />

in learning more, take a<br />

look at our repository. We open<br />

source all of our policies and<br />

best practices, as well as continue<br />

to add to them there.<br />

Have suggestions or questions?<br />

Comment below or submit<br />

a PR/issue on the Github<br />

repo! There are also a lot of<br />

really good bits of info on the<br />

<strong>Hacker</strong> News thread and /r/<br />

netsec. •<br />

1<br />

Make sure it's `.pub`. This seems to<br />

be very simple, but I've seen two people<br />

(both *not* members of our organization<br />

— it would be a quick way to stop<br />

being part of our org.) in my career,<br />

send me their private key (`id_rsa` without<br />

the .pub extension) when asking for<br />

their public keys.<br />

2<br />

There's a couple of camps on whether<br />

to keep your SSH connection on a standard<br />

or non-standard port. See [here]<br />

and [here] for opposing sides.<br />

Reprinted with permission of the original author. First appeared at codelitt.com/blog.<br />

hacker bits<br />

17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!