pf tricks

OpenBSD journal points that pf is enabled by default on OpenBSD from now on (with the exception of X11 incoming traffic). I take the opportunity to share some minor tricks that I use with pf on my BSD systems (servers mostly):

Regardless of the default policy which may or may not vary across the BSD operating systems that support pf, I always have a pf.conf.block and a pf.conf.pass handy, just in case I need to enable one of the two defaults for debugging:

* pf.conf.block:

block all

* pf.conf.pass:

pass all

On machines that run OpenVPN it happens that pf is enabled and its rules are loaded before OpenVPN is started (and its virtual interface created). So if your pf.conf has rules for a non existent interface, loading it fails leaving your machine’s pf in a state that your clearly do not want. In those cases I boot the machine with a very simple policy and load the intended policy (written in /etc/pf.conf.local) later from /etc/rc.local by issuing the command:

pfctl -Fall -f /etc/pf.conf.local

And the simple policy contents of /etc/pf.conf are:

table <machine> const  { self }
block all
pass all to <machine>
pass all from <machine>

The above policy allows any kind of traffic to and from the machine, but routes no traffic between interfaces. It can be modified depending the services the machines starts (if any) and it is used only for boot time. YMMV.

Μήνυμα του Στέφανου Μάνου

Από το υστερόγραφο του τελευταίου πολιτικού spam:

“Υ.Γ. Ζητώ την κατανόηση σας για τον ανορθόδοξο τρόπο επικοινωνίας. Η κυβέρνηση “φρόντισε” να φιμώσει τη Δράση, απαγορεύει στα νέα κόμματα τη χρήση των ραδιοτηλεοπτικών μέσων. Αν πάντως δεν επιθυμείτε να λαμβάνετε μηνύματα από τη “Δράση”, απαντείστε γράφοντας “διαγράψτε με”.”

Καμία κατανόηση. Δύο λάθη δεν κάνουν ένα σωστό. Αναζητήστε λοιπόν ένα σύμβουλο επικοινωνίας που να ξέρει το αντικείμενο. Η όποια στοιχειώδης συμπάθεια που είχα στον κομματικό σχηματισμό σας εξαφανίστηκε.

Aaaargh!!! no-reply addresses in From: headers

I was asked to create a no-reply@ address for a certain internal application.

Aaaargh! Aaaargh! Aaaargh!!!

Fortunately Word to the wise points to this excellent article which I suggested that the people “upstairs” should read:

“Do Not Reply” Address? Don’t Bother.

As always, if you are lucky enough a consultant is an expert from out of town. Most of the times they are from out of this planet though.

XandrOS presto

I have been a XandrOS user ever since their first released version of desktop Linux. The reason that I stopped using XandrOS 4 was that I could not compile ns2-2.31 on it (which meant switching to Ubuntu and later to Debian/Etch; this desktop now runs OpenBSD). So when XandrOS emailed me an offer to install Presto, I gladly did.

If there is one way for Linux to conquer the desktop, distributions like Presto are the way to go. If most of the time that you use your computer you browse the web why not use an operating system that boots faster (11 seconds on my HP 530 laptop) and consumes less energy while at the same time your documents are accessible? Everyone seems to be riding the green computing wave and judging from my laptop’s battery, Presto is greener than Vista. Plus their email support is exceptional and they follow back when they haven’t heard from you for a day or two.

Presto installs as a three-click (next, next, install) application from within Windows. I can’t wait for a standalone installer for my Aspire One A110L.

on AMKA

Συνήθως αποφεύγω να κάνω κρίσεις από μακριά για την δουλειά των άλλων, αλλά η περίπτωση του ΑΜΚΑ είναι μία εξαίρεση. Μου γεννιόνται απορίες και ελπίζω να τις διαβάσει κάποιος και να μας διαφωτίσει. Αρχικά υπήρχε η παρατήρηση του Stazybo Horn πως τα πρώτα ψηφία του ΑΜΚΑ αποτελούνται από την ημερομηνία γέννησης του ασφαλισμένου. Μου φάνηκε περίεργο, αλλά δεν έδωσα ιδιαίτερη σημασία. Μέχρι που σήμερα η γυναίκα μου κάνοντας ένα paper mining, βρήκε τη δικιά της κάρτα με τον ΑΜΚΑ της, καθώς και το χαρτί που συνόδευε την κάρτα. Διαβάζει λοιπόν κανείς στο πίσω μέρος του χαρτιού:

Ελέγξετε την ημερομηνία γέννησης και το φύλο, που περιέχονται στον Α.Μ.Κ.Α., σύμφωνα με το παρακάτω παράδειγμα.

Έστω ότι ο Α.Μ.Κ.Α. είναι ο 270163 0012 5

  • Οι πρώτοι έξι (6) αριθμοί είναι η ημερομηνία γέννησης (27 Ιανουαρίου 1963).
  • Από τους επόμενους τέσσερις αριθμούς (0012) ο τελευταίος (δηλ. το 2) δηλώνει το φύλο και στη συγκεκριμένη περίπτωση πρόκειται για γυναίκα. Γιατί οι ζυγοί αριθμοί 0,2,4,6,8 δίδονται στις γυναίκες ενώ οι μονοί 1,3,5,7,9 δίδονται στους άνδρες.
  • Ο τελευταίος αριθμός (5) αφορά τη μηχανογράφηση και επομένως δεν ελέγχεται από εσάς.

 

Ερωτήματα:

  1. Η ασφαλισμένη γεννήθηκε στις 26/01/63. Y2K anyone; Η δικιά μου κάρτα έφτασε ~5 χρόνια πριν. Ξεχάστηκε τόσο γρήγορα; Τι θα γίνει εάν κάποιο νεογέννητο βρεθεί με το ΑΜΚΑ κάποιου υπεραιωνόβιου;
  2. 80 bits (ναι 80, όχι 88, θα το δούμε μετά) για να περιγραφεί ο ασφαλισμένος με μοναδικό τρόπο; Τη στιγμή που αρκούν 33 bits για να χαρακτηρίσουν μοναδικά όποιον ζει αυτή τη στιγμή στον πλανήτη;
  3. Δεν ξέρω πως είναι οργανωμένη η βάση του ΑΜΚΑ, καταλαβαίνω όμως πως ο ΑΜΚΑ είναι πρωτεύον κλειδί (ή χρησιμοποιείται ως τέτοιο). Είναι δυνατό να κάνει κανείς πράξεις στο πρωτεύον κλειδί για να εξάγει συμπεράσματα για τον ασφαλισμένο; Και εάν δεν κάνει τον υπολογισμό επί του κλειδιού αυτού, ξανασώζει την ίδια πληροφορία σε χωριστό πεδίο; Και όχι μόνο αυτό, αλλά η πληροφορία αυτή να είναι substring μήκους 6 bytes μέσα σε άλλο string, ενώ θα μπορούσε να είναι 4 bytes (ένας integer); Update: Χρόνια μετά υποψιάζομαι πως ο λόγος που ο ΑΜΚΑ έχει αυτή τη μορφή είναι για να τον θυμάται εύκολα ο ασφαλισμένος. Και τον δικό του και των παιδιών του.
  4. Το αυτό και για το φύλο του ασφαλισμένου. Γιατί πρέπει να είναι κομάτι του ΑΜΚΑ αυτό;
  5. Τι εξυπηρετούν τα 3 bytes για τα οποία δεν υπάρχει εξήγηση;
  6. Το 11ο byte (αυτό που αφορά τη μηχανογράφηση) είναι μάλλον κάποιο check digit.

This smells a lot like COBOL.

– Που πάνε οι ΑΜΚΑ όταν πεθαίνουν μπαμπά;

Bureaucracies and information flow

Interesting quote from a security presentation that I attended recently:

“Bureaucracies depend on information flow to maintain function. Change the information flow and you can predict function”

I miss the days when hacking cracking was about ownage and defacement. It has now evolved to a strategic capability, which makes things far more difficult for the defenders.

wash your hands

Bear with me, this is actually a computer security post. In parentonomics Joshua Gans cites an Australian study according to which doctors believed they washed their hands after going to the toilet 73% of the time. Close monitoring however revealed that this happened only 9% of the time. This in a pediatric intensive care unit!

This is a simple requirement: Wash your hands when leaving the toilet! One would expect that medical professionals, of all people, would follow it and not believe that they follow it.

So if the most simple measure, and one instructed to them from a very young age, cannot be followed through, how on earth are we supposed to make people read, understand and actually follow any security policy? How much simpler than “wash your hands“ does it have to be?

Recently I heard the argument that “I do not mind using cracks and pirated software*, since I trust the source”. Oh really? I am sure they [the source] wash their hands every time too…

In the case of hospitals the problem was solved using a kind of public embarrassment (screen savers with the names of doctors with no clean hands). Or as Gans puts it “Data plus shame equals trust”. However, I am sure that no legal framework can allow for the public embarrassment of any computer user. Nor any administrator wishes to make more enemies among their users than they already have.


[*] – Using cracked versions of software when the price is not right is not the way to go. If you want to punish the vendor quit using their product and stop advertising it by using it.