Zitat des Tages

Written by  on Februar 29, 2016

None of us is as dumb as all of us.

DBA Survivor: Become a Rock Star DBA

OpenLDAP Dynamic Configuration

Written by  on Februar 28, 2016

Aktuelle LDAP Pakete z.B. für Ubuntu finden sich beim LDAP Tool Box project. Aber ein Problem gibt es mit den Paketen – per Default ist nur die statische Konfiguration über die slapd.conf unterstützt. Das lässt sich aber theoretisch ganz leicht ändern, man legt ein zusätzliches Verzeichnis an, wo die dynamische Konfiguration gespeichert werden kann, und trägt es in /etc/default/slapd in der Zeile „SLAPD_CONF_DIR“ ein. Was passiert dann?

slapd: [ALERT] OpenLDAP configuration test failed

Wie kann das sein? Wieso kann die Konfiguration fehlerhaft sein, wenn es doch noch gar keine gibt? Und sollte die nicht per Default angelegt werden?
Dann teste ich eben, ob ich den Dienst händisch starten kann! Wie sieht die Befehlszeile aus den slapd zu starten?

ps aux | grep slap
ldap     32099  0.0  0.3 1085388 3480 ?        Ssl  18:31   0:00 /usr/local/openldap/libexec/slapd -h ldap://*:389 ldaps://*:636 -f /usr/local/openldap/etc/openldap/slapd.conf -u ldap -g ldap -l local4

Also muss ich den Dienst doch mit -F statt -f starten können?

# /usr/local/openldap/libexec/slapd -h ldap://*:389 ldaps://*:636 -F /usr/local/openldap/etc/openldap/slapd.d -u ldap -g ldap -l local4
usage: /usr/local/openldap/libexec/slapd options
        -4              IPv4 only
        -6              IPv6 only
        -T {acl|add|auth|cat|dn|index|passwd|test}
                        Run in Tool mode
        -c cookie       Sync cookie of consumer
        -d level        Debug level
        -f filename     Configuration file
        -F dir  Configuration directory
        -g group        Group (id or name) to run as
        -h URLs         List of URLs to serve
        -l facility     Syslog facility (default: LOCAL4)
        -n serverName   Service name
        -o <opt>[=val] generic means to specify options; supported options:
                slp[={on|off|(attrs)}] enable/disable SLP using (attrs)
        -r directory    Sandbox directory to chroot to
        -s level        Syslog level
        -u user         User (id or name) to run as
        -V              print version info (-VV exit afterwards, -VVV print
                        info about static overlays and backends)

Wie konnte das passieren?
Die Bash versucht den „*“ bei der IP Konfiguration aufzulösen. Also schützen wir die Sterne vor der Shell:

# /usr/local/openldap/libexec/slapd -h "ldap://*:389 ldaps://*:636" -F /usr/local/openldap/etc/openldap/slapd.d -u ldap -g ldap -l local4
# ps aux | grep slap
ldap     32589  0.1  0.2 1068476 2700 ?        Ssl  18:49   0:00 /usr/local/openldap/libexec/slapd -h ldap://*:389 ldaps://*:636 -F /usr/local/openldap/etc/openldap/slapd.d -u ldap -g ldap -l local4

Und wir haben das Configverzeichnis mit einer ersten Konfiguration befüllt.
Ab jetzt klappt der Start des Dienstes auch mit dem Start/Stop Script bzw. mit dem service-Befehl.

Zitat des Tages

Written by  on Februar 27, 2016

I knew a man once who drank his coffee black. I asked him how he could drink coffee without even some cream to temper it, and his reply has stuck with me to this day: “Would you pour cream and sugar into a glass of 20-year-old Scotch?” I stared blankly at him and replied softly, “No.” He responded with, “Then why would you want to ruin a perfectly good cup of coffee by pouring that junk in it?”

DBA Survivor: Become a Rock Star DBA

Zitat des Tages

Written by  on Februar 26, 2016

Bacon is to food as black is to fashion; it goes with everything.

DBA Survivor: Become a Rock Star DBA

Certificate Order

Written by  on Februar 25, 2016

What is the correct order of certificates when sending intermediate certificates?
Should I add the root certificate to be sent by the server?

The Certificate message is typically used to carry the server’s X.509 certificate chain. Certificates are provided one after another, in ASN.1 DER encoding. The main certificate must be sent first, with all of the intermediary certificates following in the correct order. The root can and should be omitted, because it serves no purpose in this context.

Bulletproof SSL and TLS, p30

Zitat des Tages

Written by  on Februar 24, 2016

In addition to having your own set of tools at your disposal, another good skill to acquire is the ability to remain unemotional.

DBA Survivor: Become a Rock Star DBA

Zitat des Tages

Written by  on Februar 23, 2016

You should spend more time focusing on your own efforts and less time worrying about someone else. Focus on what you can control; otherwise, you will quickly become frustrated.

DBA Survivor: Become a Rock Star DBA

Zitat des Tages

Written by  on Februar 22, 2016

Having your procedures written down is a necessity in order to make certain that any new hire can be brought up to speed in the shortest time.

DBA Survivor: Become a Rock Star DBA

MS IIS Server Header

Written by  on Februar 21, 2016

Im IIS den Server Header zu deaktivieren ist nicht leicht. Es finden sich jede Menge Anleitungen dazu – aber nichts funktioniert.
Im Apache verändert man diesen Header über eine Zeile in einem Textfile (ServerTokens Prod). Eigentlich erwarte ich da, dass Microsoft für den IIS ein Häkchen oder ein Dropdown im GUI anbietet, mit dem man das ändern kann. Gibt es das nicht, würde ich einen Wert in der Registry erwarten – den gibt es aber auch nicht wirklich.

Eine einfache Möglichkeit bietet EASILY REMOVE UNWANTED HTTP HEADERS IN IIS 7.0 TO 8.5. Einfach das .msi Paket herunterladen, installieren, fertig.
Das ist natürlich gleichzeitig der Nachteil – man muss dazu ein MSI Paket installieren.
Das Paket ist laut Virustotal sauber. Ob jemand das auf einem produktiven Server installieren will, muss aber jeder für sich selbst entscheiden.

Zitat des Tages

Written by  on Februar 20, 2016

workdays never go purely as planned, and you need to leave some margin for error. I still create a daily list, but I leave a generous margin to handle all the ad hoc items that hit me as the day progresses.

DBA Survivor: Become a Rock Star DBA