SANS Internet Storm Center, InfoCON: green

Thursday, May 27, 2010

Amazon S3 + Duplicity on CentOS 5

As my previous post indicated, currently I am trying to locate an online backup service to backup my irreplaceable photos. There are many popular online backup services available but many of them comes with Windows-only client with features I don't need. Realistically I am just looking for some reliable online storage space with the ability to automate nightly backup with rsync (and do it cheaply :) ). Amazon Simple Storage Service with duplicity seems to satisfy all my requirements.

At first glance, S3 is not end-user friendly as it is primarily geared towards developers or power users. Fortunately, plenty of people already built tools, such as duplicity, for power users like myself to take advantage of the storage with minimum coding. Duplicity will take care of rsync full and incremental backup and encryption.

Signup with Amazon S3
It's a fairly straight forward process. I chose 99.99% Reduced Redundancy Storage to reduce cost. To me, four 9s is good enough since I have other backups available. 

Install duplicity on CentOS 5
It is not in the standard repository, but luckily it is in the EPEL. After you enable EPEL, the actual installation is quite simple:

#yum -y install duplicity

Generate GPG key
Duplicity can take GPG key and encrypt the data. I went with RSA key pairs (signing & encryption):

#gpg --expert --gen-key

On a head-less server, without keyboard or mouse, you may not be able to generate enough entropy for the keys. You can do the following to resolve this issue:

#yum -y install rng-utils
#rngd -r /dev/urandom

After you ran rngd, re-run gpg and you should be able to generate the key pairs

Putting Everything Together
Create a configuration file under /etc/, for example, /etc/aws.conf

Add your AWS access credential

AWS_ACCESS_KEY_ID="123"
AWS_SECRET_ACCESS_KEY="323"

Create a cron script - backup2s3.sh
#!/bin/bash
. /etc/aws.conf
# If you have passphrase for your GPG key
. /etc/passphrase

export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY
export PASSPHRASE

# Bucket name on S3 must be unique
BUCKET="uniqueName"

# Replace 86181CE8 with your key signature
duplicity --encrypt-key=86181CE8 --sign-key=86181CE8 /backup/Pictures s3+http://$BUCKET

Done! You can verify upload progress using S3 Browser.

Backup is unreliable if we don't test and verify restore. I will do couple of tests once I finish the initial upload.

Reference

Tuesday, May 25, 2010

Fedora 13 (Goddard) Released

Release Note

The only two features I care:

  • SSSD authentication for users — refer to Section 2, “Installation Notes”
    Finally, locally cached network credentials. In a large deployment with LDAP, there's no excuse to use local passwords anymore. Not to mention Windows have had this feature for quite sometime.
  • System rollback for the Btrfs file system — refer to Section 5.9, “File Systems”
    It's probably time to get familiar with the new file system features.

Monday, May 17, 2010

Moved to Blogger

Finally I decided to move my forgotten blog from self-hosted WordPress to Blogger. I'll let someone else take care blog software security update. If I can't trust Google who can I trust?

Gradually, my life is shifting to the cloud (I hate this buzz word). Facebook, Linkedin, Blogger, DNS and Gmail. The only thing missing is data backup. I tested SpiderOak but due to its slow speed from up here, I guess I'll do my own backup for the foreseeable future.


Monday, September 28, 2009

One-liner to log off everyone from SSH

#w -husf|awk '{print $2;}'|xargs -i skill -KILL -t {}

If you have a easier & simpler way to log off everyone from SSH & console, please let me know!

Tuesday, April 21, 2009

Passed CISSP Exam

I've passed Certified Information Systems Security Professional (CISSP) exam.


Study Aid
  1. CISSP Certification All-in-One Exam Guide, Fourth Edition - By Shon Harris
  2. http://cccure.org/
  3. http://www.freepracticetests.org/quiz/home.php
The test was not as difficult as people claim. From my experience, it's similar to my undergrad junior-level Psychology final - multiple choice exam on textbook chapter 1-12. It gives you an overview on the subject matter but not enough depth.

Update: I finally sent in my endorsement. As of February 2010, I am officially a CISSP.