From f1f25b0534fe266051e3ffa952484563a85f9e72 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 31 Jan 2012 11:00:43 +0100 Subject: [PATCH] Current state --- .etckeeper | 47 ++++ .gitignore | 2 + motd | 15 -- runlevels/default/stunnel | 1 + ssl/CA-Brehm/apache2/mkcert | 73 ++++++ ssl/CA-Brehm/apache2/myadmin-cert.cnf | 22 ++ ssl/CA-Brehm/apache2/myadmin-cert.pem | 37 +++ ssl/CA-Brehm/apache2/webmail-cert.cnf | 22 ++ ssl/CA-Brehm/apache2/webmail-cert.pem | 37 +++ ssl/CA-Brehm/cacert.pem | 26 ++ ssl/CA-Brehm/courier-imap/imapd.cnf | 23 ++ ssl/CA-Brehm/courier-imap/imapd.pem | 38 +++ ssl/CA-Brehm/courier-imap/mkcert | 81 ++++++ ssl/CA-Brehm/courier-imap/pop3d.cnf | 23 ++ ssl/CA-Brehm/courier-imap/pop3d.pem | 38 +++ ssl/CA-Brehm/postfix/mkcert | 44 ++++ ssl/CA-Brehm/postfix/postfix-cert.cnf | 23 ++ ssl/CA-Brehm/postfix/postfix.pem | 37 +++ ssl/CA-Brehm/private/ca.key.unsecure | 27 ++ ssl/CA-Brehm/private/cakey.pem | 30 +++ ssl/CA-Brehm/stunnel/mkcert | 111 ++++++++ ssl/CA-Brehm/stunnel/stunnel-cert.cnf | 22 ++ ssl/CA-Brehm/stunnel/stunnel.rand | Bin 0 -> 512 bytes ssl/CA-Brehm/uhu.txt | 1 + ssl/openssl.cnf | 14 +- ssl/openssl.cnf.default | 350 ++++++++++++++++++++++++++ stunnel/old/stunnel.crt | 17 ++ stunnel/old/stunnel.csr | 13 + stunnel/old/stunnel.key | 15 ++ stunnel/old/stunnel.pem | 33 +++ stunnel/stunnel.conf | 8 +- stunnel/stunnel.pem | 33 +++ 32 files changed, 1239 insertions(+), 24 deletions(-) delete mode 100644 motd create mode 120000 runlevels/default/stunnel create mode 100755 ssl/CA-Brehm/apache2/mkcert create mode 100644 ssl/CA-Brehm/apache2/myadmin-cert.cnf create mode 100644 ssl/CA-Brehm/apache2/myadmin-cert.pem create mode 100644 ssl/CA-Brehm/apache2/webmail-cert.cnf create mode 100644 ssl/CA-Brehm/apache2/webmail-cert.pem create mode 100644 ssl/CA-Brehm/cacert.pem create mode 100644 ssl/CA-Brehm/courier-imap/imapd.cnf create mode 100644 ssl/CA-Brehm/courier-imap/imapd.pem create mode 100755 ssl/CA-Brehm/courier-imap/mkcert create mode 100644 ssl/CA-Brehm/courier-imap/pop3d.cnf create mode 100644 ssl/CA-Brehm/courier-imap/pop3d.pem create mode 100755 ssl/CA-Brehm/postfix/mkcert create mode 100644 ssl/CA-Brehm/postfix/postfix-cert.cnf create mode 100644 ssl/CA-Brehm/postfix/postfix.pem create mode 100644 ssl/CA-Brehm/private/ca.key.unsecure create mode 100644 ssl/CA-Brehm/private/cakey.pem create mode 100755 ssl/CA-Brehm/stunnel/mkcert create mode 100644 ssl/CA-Brehm/stunnel/stunnel-cert.cnf create mode 100644 ssl/CA-Brehm/stunnel/stunnel.rand create mode 100644 ssl/CA-Brehm/uhu.txt create mode 100644 ssl/openssl.cnf.default create mode 100644 stunnel/old/stunnel.crt create mode 100644 stunnel/old/stunnel.csr create mode 100644 stunnel/old/stunnel.key create mode 100644 stunnel/old/stunnel.pem create mode 100644 stunnel/stunnel.pem diff --git a/.etckeeper b/.etckeeper index ce40246..17a88c1 100755 --- a/.etckeeper +++ b/.etckeeper @@ -12,6 +12,9 @@ mkdir -p './security/namespace.d' mkdir -p './sensors.d' mkdir -p './skel/.ssh' mkdir -p './ssh/ca' +mkdir -p './ssl/CA-Brehm/certs' +mkdir -p './ssl/CA-Brehm/crl' +mkdir -p './ssl/CA-Brehm/newcerts' mkdir -p './sudoers.d' mkdir -p './texmf/dvipdfm/config' mkdir -p './texmf/dvips.d' @@ -1086,6 +1089,35 @@ maybe chmod 0600 './ssh/ssh_host_rsa_key' maybe chmod 0644 './ssh/ssh_host_rsa_key.pub' maybe chmod 0600 './ssh/sshd_config' maybe chmod 0755 './ssl' +maybe chmod 0755 './ssl/CA-Brehm' +maybe chmod 0755 './ssl/CA-Brehm/apache2' +maybe chmod 0755 './ssl/CA-Brehm/apache2/mkcert' +maybe chmod 0644 './ssl/CA-Brehm/apache2/myadmin-cert.cnf' +maybe chmod 0600 './ssl/CA-Brehm/apache2/myadmin-cert.pem' +maybe chmod 0644 './ssl/CA-Brehm/apache2/webmail-cert.cnf' +maybe chmod 0600 './ssl/CA-Brehm/apache2/webmail-cert.pem' +maybe chmod 0644 './ssl/CA-Brehm/cacert.pem' +maybe chmod 0755 './ssl/CA-Brehm/certs' +maybe chmod 0755 './ssl/CA-Brehm/courier-imap' +maybe chmod 0644 './ssl/CA-Brehm/courier-imap/imapd.cnf' +maybe chmod 0600 './ssl/CA-Brehm/courier-imap/imapd.pem' +maybe chmod 0755 './ssl/CA-Brehm/courier-imap/mkcert' +maybe chmod 0644 './ssl/CA-Brehm/courier-imap/pop3d.cnf' +maybe chmod 0600 './ssl/CA-Brehm/courier-imap/pop3d.pem' +maybe chmod 0755 './ssl/CA-Brehm/crl' +maybe chmod 0755 './ssl/CA-Brehm/newcerts' +maybe chmod 0755 './ssl/CA-Brehm/postfix' +maybe chmod 0755 './ssl/CA-Brehm/postfix/mkcert' +maybe chmod 0644 './ssl/CA-Brehm/postfix/postfix-cert.cnf' +maybe chmod 0600 './ssl/CA-Brehm/postfix/postfix.pem' +maybe chmod 0755 './ssl/CA-Brehm/private' +maybe chmod 0644 './ssl/CA-Brehm/private/ca.key.unsecure' +maybe chmod 0644 './ssl/CA-Brehm/private/cakey.pem' +maybe chmod 0755 './ssl/CA-Brehm/stunnel' +maybe chmod 0755 './ssl/CA-Brehm/stunnel/mkcert' +maybe chmod 0644 './ssl/CA-Brehm/stunnel/stunnel-cert.cnf' +maybe chmod 0644 './ssl/CA-Brehm/stunnel/stunnel.rand' +maybe chmod 0644 './ssl/CA-Brehm/uhu.txt' maybe chmod 0755 './ssl/apache2' maybe chmod 0444 './ssl/apache2/server.crt' maybe chmod 0444 './ssl/apache2/server.csr' @@ -1103,6 +1135,7 @@ maybe chmod 0755 './ssl/misc/c_issuer' maybe chmod 0755 './ssl/misc/c_name' maybe chmod 0755 './ssl/misc/tsget' maybe chmod 0644 './ssl/openssl.cnf' +maybe chmod 0644 './ssl/openssl.cnf.default' maybe chmod 0755 './ssl/postfix' maybe chmod 0444 './ssl/postfix/server.crt' maybe chmod 0444 './ssl/postfix/server.csr' @@ -1115,7 +1148,21 @@ maybe chmod 0400 './ssl/postfix/server.pem' maybe chmod 0700 './ssl/private' maybe chmod 0644 './ssl/private/.keep_dev-libs_openssl-0' maybe chmod 0755 './stunnel' +maybe chmod 0755 './stunnel/old' +maybe chown stunnel './stunnel/old/stunnel.crt' +maybe chgrp stunnel './stunnel/old/stunnel.crt' +maybe chmod 0640 './stunnel/old/stunnel.crt' +maybe chown stunnel './stunnel/old/stunnel.csr' +maybe chgrp stunnel './stunnel/old/stunnel.csr' +maybe chmod 0640 './stunnel/old/stunnel.csr' +maybe chown stunnel './stunnel/old/stunnel.key' +maybe chgrp stunnel './stunnel/old/stunnel.key' +maybe chmod 0640 './stunnel/old/stunnel.key' +maybe chown stunnel './stunnel/old/stunnel.pem' +maybe chgrp stunnel './stunnel/old/stunnel.pem' +maybe chmod 0640 './stunnel/old/stunnel.pem' maybe chmod 0644 './stunnel/stunnel.conf' +maybe chmod 0644 './stunnel/stunnel.pem' maybe chmod 0440 './sudoers' maybe chmod 0750 './sudoers.d' maybe chmod 0644 './sysctl.conf' diff --git a/.gitignore b/.gitignore index fa8caf3..6f3c373 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ # old versions of files *.old +motd + # mount(8) records system state here, no need to store these blkid.tab blkid.tab.old diff --git a/motd b/motd deleted file mode 100644 index f97d454..0000000 --- a/motd +++ /dev/null @@ -1,15 +0,0 @@ -Linux uhu1 3.2.1-gentoo-r2 #1 SMP Mon Jan 30 16:49:14 CET 2012 x86_64 AMD Opteron 23xx (Gen 3 Class Opteron) AuthenticAMD GNU/Linux -Gentoo Base System release 2.0.3 - _ _ _ _ -| | | | |__ _ _ / | -| | | | '_ \| | | | | | -| |_| | | | | |_| | | | - \___/|_| |_|\__,_| |_| - - -Manche Menschen tun nichts - aber sie tun es auf eine faszinierende -Weise. - -- Curzio Malaparte (eigentlich: Kurt Erich Suckert) - -Today is Sweetmorn, the 31st day of Chaos in the YOLD 3178 - diff --git a/runlevels/default/stunnel b/runlevels/default/stunnel new file mode 120000 index 0000000..b1b3a25 --- /dev/null +++ b/runlevels/default/stunnel @@ -0,0 +1 @@ +/etc/init.d/stunnel \ No newline at end of file diff --git a/ssl/CA-Brehm/apache2/mkcert b/ssl/CA-Brehm/apache2/mkcert new file mode 100755 index 0000000..45c08f3 --- /dev/null +++ b/ssl/CA-Brehm/apache2/mkcert @@ -0,0 +1,73 @@ +#! /bin/sh +# +# This is a short script to quickly generate a self-signed X.509 key for +# Courier-IMAP/POP3 over SSL. + +test -x /usr/bin/openssl || exit 0 + +CADir="/etc/ssl/CA-Brehm/apache2" +prefix="/usr" +randfile="$CADir/apache2.rand" +days=1875 +do_install=0 + +Instances="webmail myadmin" + +echo +echo "Generating Random file '$randfile' ..." +dd if=/dev/urandom of=$randfile count=1 2>/dev/null + +for i in $Instances ; do + + pemfile="$CADir/$i-cert.pem" + conffile="$CADir/$i-cert.cnf" + + if [ -f $pemfile ]; then + echo "$pemfile already exists." + continue + fi + do_install=1 + + if [ ! -f $conffile ] ; then + echo "$conffile does not exists!" + exit 2 + fi + + cp /dev/null $pemfile + chmod 600 $pemfile + chown root $pemfile + + cleanup() { + echo + echo "Emergency Cleanup ..." >&2 + rm -f $pemfile + rm -f $randfile + exit 10 + } + + echo "Generating Cert for IMAP ..." + /usr/bin/openssl req -new -x509 -days $days -nodes \ + -config $conffile -out $pemfile -keyout $pemfile || cleanup + /usr/bin/openssl gendh -rand $randfile 512 >> $pemfile || cleanup + /usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile || cleanup + +done + +if [ "$do_install" = "1" ] ; then + + echo + echo "Installing Certificates ..." + + for i in $Instances ; do + + pemfile="$CADir/$i-cert.pem" + pemfile_orig="/etc/apache2/ssl/$i-cert.pem" + + cp -pv $pemfile $pemfile_orig + + done + +fi + +rm -f $randfile + diff --git a/ssl/CA-Brehm/apache2/myadmin-cert.cnf b/ssl/CA-Brehm/apache2/myadmin-cert.cnf new file mode 100644 index 0000000..dabb192 --- /dev/null +++ b/ssl/CA-Brehm/apache2/myadmin-cert.cnf @@ -0,0 +1,22 @@ +RANDFILE = /usr/share/webmail.rand + +[ req ] +default_bits = 1024 +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +C=DE +ST=Berlin +L=Berlin +O=Brehm +OU=Frank Brehm SSL Key +CN=myadmin.brehm-online.com +emailAddress=frank@brehm-online.com + + +[ cert_type ] +nsCertType = server + diff --git a/ssl/CA-Brehm/apache2/myadmin-cert.pem b/ssl/CA-Brehm/apache2/myadmin-cert.pem new file mode 100644 index 0000000..cf5de34 --- /dev/null +++ b/ssl/CA-Brehm/apache2/myadmin-cert.pem @@ -0,0 +1,37 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQC0+qDrRPNPHnd/sD2Vp6ZRy87g0X22CpVMLZpjj2tEKPyf1N/t +VoiHdOHSVLJZrmBf26A5MknUENgEFHqvjO3dPFV7x/VL9OzrrGKS5QBEoaDGheAp +Qow/FKMYA93uFGiG4jcoC7gj+uA3zNeU+fUSHHbqEf9hm+cBtOKG7XVb5QIDAQAB +AoGAJrrP/ylFTHQ/rILB2yoCjNSp1DDgzzlak+/ab1383ZxL28SJm1f+ZcacoQ9h +D5Iiq8Dre/IIHKryH4Vmb/Uf3fFlLbfDcalIIZRKlLmJ43oahUI4aPRthaEN+t2X +4PgL0uQ/4BeCs32ivGz+QWjgx2tuxIkIv7B+JYjyjJ/9QoECQQDd2QCnd70OcQVT +0EYk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QC0+qDrRPNPHnd/sD2Vp6ZRy87g0X22CpVMLZpjj2tEKPyf1N/tVoiH +dOHSVLJZrmBf26A5MknUENgEFHqvjO3dPFV7x/VL9OzrrGKS5QBEoaDGheApQow/ +FKMYA93uFGiG4jcoC7gj+uA3zNeU+fUSHHbqEf9hm+cBtOKG7XVb5QIDAQABoxUw +EzARBglghkgBhvhCAQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAA+PPUJ1IWo+i +lZlDQAOfLscsjv37dJtrvZguPV9aNTSRv1RgJSFseMt/CYjrzxXD2GKhDk8wyE1D +qTy87Os2WXqBKm+6L38hheZoUcIorPwTOmh5KZXwtbyxfmKXg3lXXGDm60E6Pkf7 +O2+jRSctKlQe36TIAZxUpfumY2pVQZA= +-----END CERTIFICATE----- +-----BEGIN DH PARAMETERS----- +MEYCQQDYf1RIczbTmgovRnZ8SA/b9l4b+t0dPW3/CHEUJU93w20YQ3yap6xrWIQk +wVzhsgf+zmajDFpfQU2JJKc35oA7AgEC +-----END DH PARAMETERS----- diff --git a/ssl/CA-Brehm/apache2/webmail-cert.cnf b/ssl/CA-Brehm/apache2/webmail-cert.cnf new file mode 100644 index 0000000..d88f92f --- /dev/null +++ b/ssl/CA-Brehm/apache2/webmail-cert.cnf @@ -0,0 +1,22 @@ +RANDFILE = /usr/share/webmail.rand + +[ req ] +default_bits = 1024 +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +C=DE +ST=Berlin +L=Berlin +O=Brehm +OU=Brehm SSL Key +CN=webmail.brehm-online.com +emailAddress=frank@brehm-online.com + + +[ cert_type ] +nsCertType = server + diff --git a/ssl/CA-Brehm/apache2/webmail-cert.pem b/ssl/CA-Brehm/apache2/webmail-cert.pem new file mode 100644 index 0000000..fd2de1c --- /dev/null +++ b/ssl/CA-Brehm/apache2/webmail-cert.pem @@ -0,0 +1,37 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCsrn1fttalMjR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kiG9w0BCQEWFmZyYW5rQGJyZWht +LW9ubGluZS5jb20wHhcNMDYxMjA4MjIzNjU5WhcNMTIwMTI2MjIzNjU5WjCBoTEL +MAkGA1UEBhMCREUxDzANBgNVBAgTBkJlcmxpbjEPMA0GA1UEBxMGQmVybGluMQ4w +DAYDVQQKEwVCcmVobTEWMBQGA1UECxMNQnJlaG0gU1NMIEtleTEhMB8GA1UEAxMY +d2VibWFpbC5icmVobS1vbmxpbmUuY29tMSUwIwYJKoZIhvcNAQkBFhZmcmFua0Bi +cmVobS1vbmxpbmUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsrn1f +ttalMjRvpAVCkc/CCtprt8ifRyXuiq0njfw5x//eNjxgG551XNrNHOUagA3gwXFJ +aU9ZnjYx0nnzqhIzV3ZySbxXcDM7yDwFsygCgvLlAiO9hiyjGnMGx83Bm+fAYt/U +gyXw1Ur7QjbbKlhZvaIFZprZL3YavjhgQg64dwIDAQABoxUwEzARBglghkgBhvhC +AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAFGM8hI3QLDFaZYuiOMUyZpf1G4Pi +OaFpA+syrqmcZXvVM+ioiRU1+Mbu0FFku0Ac9WWAwMyjIFh4ZQQYWfoEsQrH/hBJ +BkD4zNAhjjPIuJ8iDs1sUqw91yq5UUeRQAzY3/rFZHvbeswQUDVOJaCSYuOt1gOc +oZYY42gyvdmBnWc= +-----END CERTIFICATE----- +-----BEGIN DH PARAMETERS----- +MEYCQQCZLOhh5tHEUjvRnBolCP22LO27aCcqwCfLPtGICExFfUi6dt1uxeTWh3Od +Kr4x2UXbRAyuc7f0/akmlV2iXLNrAgEC +-----END DH PARAMETERS----- diff --git a/ssl/CA-Brehm/cacert.pem b/ssl/CA-Brehm/cacert.pem new file mode 100644 index 0000000..2acae4b --- /dev/null +++ b/ssl/CA-Brehm/cacert.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIJANXZwU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tLW9ubGlu +ZS5jb22CCQDV2cFF8EkhdDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IB +AQCrSRKbFKp7/ZkBTT5zBD+LR3BRyll4dcenp+XdSsjEWCdxEg7b08GaS7NelpwC +Oj4YLZAtCqbsiOIy32FRkb2wdiGR7p1LwAyg4UOIfWjKTMRi9MNaWLMJn2tN1qcH +jzyANwXb/WCRnU8WeGAGKvHWuuGce3lpOnxoX6h3lxAnsD06xGtOQjgvz2OS9ZWF +RFKe96jWVosCFGbkZK4j3rRnW7PgbzMX8gcMISyQXEhhY52YMdLcFaoJhy25m+x3 +DROsgXG4aEVa+vrcXYYBp6PcUgpsRB7rKI41ArSWzF2thdzRPI2SjPwCVQ86373I +R6DAmCw1msB4Do0EaLCoVYTF +-----END CERTIFICATE----- diff --git a/ssl/CA-Brehm/courier-imap/imapd.cnf b/ssl/CA-Brehm/courier-imap/imapd.cnf new file mode 100644 index 0000000..3f67d55 --- /dev/null +++ b/ssl/CA-Brehm/courier-imap/imapd.cnf @@ -0,0 +1,23 @@ + +RANDFILE = /usr/share/imapd.rand + +[ req ] +default_bits = 1024 +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +C=DE +ST=Brehm +L=Brehm +O=Brehm +OU=Courier Mail Server IMAP SSL key +CN=mail.brehm-online.com +emailAddress=postmaster@brehm-online.com + + +[ cert_type ] +nsCertType = server + diff --git a/ssl/CA-Brehm/courier-imap/imapd.pem b/ssl/CA-Brehm/courier-imap/imapd.pem new file mode 100644 index 0000000..076042e --- /dev/null +++ b/ssl/CA-Brehm/courier-imap/imapd.pem @@ -0,0 +1,38 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQC1qOWbPkrY1egkrFuPopaBG3+IFWUuwh9pXu6NpvNnEfuv6WBg +vctKRzYPwtFnCS/5l8UWjKmLI7QEJTfAt7y7+W0A2+YvORT8DU3x3NfppF2NOGRi +jIr3np6nJk7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owgbQxCzAJBgNVBAYTAkRFMQ4wDAYDVQQIEwVCcmVobTEO +MAwGA1UEBxMFQnJlaG0xDjAMBgNVBAoTBUJyZWhtMSkwJwYDVQQLEyBDb3VyaWVy +IE1haWwgU2VydmVyIElNQVAgU1NMIGtleTEeMBwGA1UEAxMVbWFpbC5icmVobS1v +bmxpbmUuY29tMSowKAYJKoZIhvcNAQkBFhtwb3N0bWFzdGVyQGJyZWhtLW9ubGlu +ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALWo5Zs+StjV6CSsW4+i +loEbf4gVZS7CH2le7o2m82cR+6/pYGC9y0pHNg/C0WcJL/mXxRaMqYsjtAQlN8C3 +vLv5bQDb5i85FPwNTfHc1+mkXY04ZGKMiveenqcmTsAt2NlDr2rKmVeW6/Q0A019 +AtdgngxWK4pOk02Q/krD+5kbAgMBAAGjFTATMBEGCWCGSAGG+EIBAQQEAwIGQDAN +BgkqhkiG9w0BAQUFAAOBgQAJcVq4xxeH1d86DoedzsqMZyT90Y5piL4NarwQekg8 +jP0+HytRdujAJB4ahKkixsUcrFIeO3ct5ZXervdwvLK5GCcnwu3Lxa33UF7HhpOA +5+6bQXl4qh9+sL9UoxoRf2aMObVUsb0vEe7KTUViJ8rA7nI4Iny0icBJYKqvsxeH +5Q== +-----END CERTIFICATE----- +-----BEGIN DH PARAMETERS----- +MEYCQQCd+yD50BV7puqCKcLdensocjp8erVRJ7A5DmjUOicA2Xij9QcHfq7bvN6S +yg50QJ8JcJVV+dyKaEm1zRyRitLzAgEC +-----END DH PARAMETERS----- diff --git a/ssl/CA-Brehm/courier-imap/mkcert b/ssl/CA-Brehm/courier-imap/mkcert new file mode 100755 index 0000000..54edb90 --- /dev/null +++ b/ssl/CA-Brehm/courier-imap/mkcert @@ -0,0 +1,81 @@ +#! /bin/sh +# +# This is a short script to quickly generate a self-signed X.509 key for +# Courier-IMAP/POP3 over SSL. + +test -x /usr/bin/openssl || exit 0 + +CADir="/etc/ssl/CA-Brehm/courier-imap" +prefix="/usr" +randfile="$CADir/courier.rand" +days=1875 + +pemfile_imap="$CADir/imapd.pem" +conffile_imap="$CADir/imapd.cnf" +pemfile_orig_imap="/etc/courier-imap/imapd.pem" + +pemfile_pop3="$CADir/pop3d.pem" +conffile_pop3="$CADir/pop3d.cnf" +pemfile_orig_pop3="/etc/courier-imap/pop3d.pem" + +if [ -f $pemfile_imap ]; then + echo "$pemfile_imap already exists." + exit 1 +fi + +if [ -f $pemfile_pop3 ]; then + echo "$pemfile_pop3 already exists." + exit 1 +fi + +if [ ! -f $conffile_imap ] ; then + echo "$conffile_imap does not exists!" + exit 2 +fi + +if [ ! -f $conffile_pop3 ] ; then + echo "$conffile_pop3 does not exists!" + exit 2 +fi + +cp /dev/null $pemfile_imap +chmod 600 $pemfile_imap +chown root $pemfile_imap + +cp /dev/null $pemfile_pop3 +chmod 600 $pemfile_pop3 +chown root $pemfile_pop3 + +cleanup() { + echo + echo "Emergency Cleanup ..." >&2 + rm -f $pemfile_imap + rm -f $pemfile_pop3 + rm -f $randfile + exit 10 +} + +echo +echo "Generating Random file '$randfile' ..." +dd if=/dev/urandom of=$randfile count=1 2>/dev/null + +echo +echo "Generating Cert for IMAP ..." +/usr/bin/openssl req -new -x509 -days $days -nodes \ + -config $conffile_imap -out $pemfile_imap -keyout $pemfile_imap || cleanup +/usr/bin/openssl gendh -rand $randfile 512 >> $pemfile_imap || cleanup +/usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile_imap || cleanup + +echo +echo "Generating Cert for POP3 ..." +/usr/bin/openssl req -new -x509 -days $days -nodes \ + -config $conffile_imap -out $pemfile_pop3 -keyout $pemfile_pop3 || cleanup +/usr/bin/openssl gendh -rand $randfile 512 >> $pemfile_pop3 || cleanup +/usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile_pop3 || cleanup + +echo +echo "Installing Certificates ..." +cp -pv $pemfile_imap $pemfile_orig_imap +cp -pv $pemfile_pop3 $pemfile_orig_pop3 +rm -f $randfile + diff --git a/ssl/CA-Brehm/courier-imap/pop3d.cnf b/ssl/CA-Brehm/courier-imap/pop3d.cnf new file mode 100644 index 0000000..75af52d --- /dev/null +++ b/ssl/CA-Brehm/courier-imap/pop3d.cnf @@ -0,0 +1,23 @@ + +RANDFILE = /usr/share/pop3d.rand + +[ req ] +default_bits = 1024 +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +C=DE +ST=Berlin +L=Berlin +O=Brehm +OU=Courier Mail Server POP3 SSL key +CN=mail.brehm-online.com +emailAddress=postmaster@brehm-online.com + + +[ cert_type ] +nsCertType = server + diff --git a/ssl/CA-Brehm/courier-imap/pop3d.pem b/ssl/CA-Brehm/courier-imap/pop3d.pem new file mode 100644 index 0000000..bf5575c --- /dev/null +++ b/ssl/CA-Brehm/courier-imap/pop3d.pem @@ -0,0 +1,38 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDeQ2lyjAA32nPw9bGNQ6cJDbgpJVTPircwIjwthdDomVOn6uEZ +s31kUeTHcV1UFYqKQbur7zeW0fl5AHV8fhTWIODuNGUduzgrkl/NMy753s3YJcro +8A4T6JlXz9rHGS0P1rWt/ZJX3zty3gwNZdDLI4tw5ThPkRDGmxYe4tUCMQIDAQAB +AoGBAIQYgIUpm7+WP64H99xDRvTkiH07yKoIgVNEJYvQqhZzefqkZ+BEgtOqsFOw +lo0wuEPvSUCoTdt/M8uscCbrMCnviwxU/DRTEIdHdhpSKK0mJoLoZBM4Ds9/kWv2 +ObkM9injHM814alaeeb9Es8vCH0AlfgZ1UWy1jV840InA3GhAkEA84xxxGygCSix +sYh/1lU6RKgIHlMhVG/2ecjS6TbhtRy4gIzBgobvRgO7Oq788FJ9W0Gl8BpXGJ9H +E4LfJL4/XQJBAOmgYu+NljdEUSRONr0DZYN85ERB39iz2L9ZJucnqrhQz+UHZtfr ++9k5z5hcyVu+joBnme1/P0GCwWfJGPMeZOUCQQDCV6fQ3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3LeDA1l +0Msji3DlOE+REMabFh7i1QIxAgMBAAGjFTATMBEGCWCGSAGG+EIBAQQEAwIGQDAN +BgkqhkiG9w0BAQUFAAOBgQADISOUsK2dtfAD/Go6fGxCA91/SL1FxpkxfWSA9oG0 +9GBZRlEjrbXA5Gn8DijbZ91CArjAEJlYrNPihSD5qzFgbsbD99HDV7js3HW1TODA +QVcrEwQGsYUQyA0UOF0AByx3CuppglkayBNBFxoDYUHfK9SavdMLnUuo68Skd+9g +tA== +-----END CERTIFICATE----- +-----BEGIN DH PARAMETERS----- +MEYCQQChYtoCiG16r+tbnSsmbpI+AMuNv4rmN/hkoTWvAMdmy3OcWIkBuhepTkZA +yF1zxkBIH3wW6w40eqNW0W0j0uxzAgEC +-----END DH PARAMETERS----- diff --git a/ssl/CA-Brehm/postfix/mkcert b/ssl/CA-Brehm/postfix/mkcert new file mode 100755 index 0000000..d2c68c1 --- /dev/null +++ b/ssl/CA-Brehm/postfix/mkcert @@ -0,0 +1,44 @@ +#! /bin/sh +# +# This is a short script to quickly generate a self-signed X.509 key for +# Postfix over SSL. Normally this script would get called by an automatic +# package installation routine. + +test -x /usr/bin/openssl || exit 0 + +CADir="/etc/ssl/CA-Brehm/postfix" +prefix="/usr" +pemfile="$CADir/postfix.pem" +randfile="$CADir/postfix.rand" +conffile="$CADir/postfix-cert.cnf" +pemfile_orig="/etc/postfix/postfix.pem" +days=1875 + +if [ -f $pemfile ]; then + echo "$pemfile already exists." + exit 1 +fi + +if [ ! -f $conffile ] ; then + echo "$conffile does not exists!" + exit 2 +fi + +cp /dev/null $pemfile +chmod 600 $pemfile +chown root $pemfile + +cleanup() { + rm -f $pemfile + rm -f $randfile + exit 1 +} + +dd if=/dev/urandom of=$randfile count=1 2>/dev/null +/usr/bin/openssl req -new -x509 -days $days -nodes \ + -config $conffile -out $pemfile -keyout $pemfile || cleanup +/usr/bin/openssl gendh -rand $randfile 512 >> $pemfile || cleanup +/usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile || cleanup +rm -f $randfile +cp -pv $pemfile $pemfile_orig + diff --git a/ssl/CA-Brehm/postfix/postfix-cert.cnf b/ssl/CA-Brehm/postfix/postfix-cert.cnf new file mode 100644 index 0000000..c0bf6c0 --- /dev/null +++ b/ssl/CA-Brehm/postfix/postfix-cert.cnf @@ -0,0 +1,23 @@ + +RANDFILE = /usr/share/postfix.rand + +[ req ] +default_bits = 1024 +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +C=DE +ST=Berlin +L=Berlin +O=Berlin +OU=Mail Server Postfix SSL key +CN=mail.brehm-online.com +emailAddress=postmaster@brehm-online.com + + +[ cert_type ] +nsCertType = server + diff --git a/ssl/CA-Brehm/postfix/postfix.pem b/ssl/CA-Brehm/postfix/postfix.pem new file mode 100644 index 0000000..bd1f5cf --- /dev/null +++ b/ssl/CA-Brehm/postfix/postfix.pem @@ -0,0 +1,37 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCVlGvxjXWhKDqEUkTPZO9/9b0js236ON9tt9aKDFVSrkRBtMwM +xjkWHpc3jNT5aHtFTvalZHzr/Aa9+NTnJMKtiBTBrcyNnQUtOVQH8zbg8JrqJgj/ +MVS+gF4Aae43ofTk5juYCoh4QDXBAC//+AdhOe/FVs6jybn5G6ir/ekFBwIDAQAB +AoGBAIwKGglbRA6uaCKsFyoIOMYXHo4HFebXSi8hl2VFaLhw2QyfJQ6sopOX7kEe +w+IBNK/N3tM3wlD5cqJ3DXSeEPgR7laeOTC7F5cedC/ISHSvOXLVMYSnauo8H1Wi +oZV7Vq2tKvWBCV5n20c7Q8QEtawEdQeR5Pm2xxMAlbL86+6ZAkEAxCXYH16+luHy +LOUD5PycMu5rfbel8t5ZtKRRpD2K47/XzwSbOWG5Om6Z8mm49NeU8f6IZpiwfAyb +H9atpa/6XQJBAMM45cHZZVjBl/2YfeF1MsFlGz3I7n7yfOHhzfkM3qPQBM0Ll8J5 +RcIADMUsGv4f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U5yTCrYgU +wa3MjZ0FLTlUB/M24PCa6iYI/zFUvoBeAGnuN6H05OY7mAqIeEA1wQAv//gHYTnv +xVbOo8m5+Ruoq/3pBQcCAwEAAaMVMBMwEQYJYIZIAYb4QgEBBAQDAgZAMA0GCSqG +SIb3DQEBBQUAA4GBAGeli/w5sD8LIbhA8qcmdK1QB9w/nvI0RSGDuZtsKl97TVQj +cCAW7FS2U6gyA+7hJfIMZT/kMGVM9ygnU6VKmfuj8q7qsG29jOOleafYuFwKph2D +Ft4m/OauBW0riNbJ7IT923QwBCTgpVo/sf3Hb1HKf3VqGxaPTQU4wrLJWDsj +-----END CERTIFICATE----- +-----BEGIN DH PARAMETERS----- +MEYCQQDjc+Kujf6R+XMJT/3bPZhUBp/67Tano3opslrBIl0vQILYHhUB6yErvMFo +eVYwt/wMP409NZOlIBvkwYemzXz7AgEC +-----END DH PARAMETERS----- diff --git a/ssl/CA-Brehm/private/ca.key.unsecure b/ssl/CA-Brehm/private/ca.key.unsecure new file mode 100644 index 0000000..7581afd --- /dev/null +++ b/ssl/CA-Brehm/private/ca.key.unsecure @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAs3QOLgO3aOSFeqJ7T4i7/nOZt2wumKajfclR3R9ROhshpf2e +eQufsDwEycd9RPm0e20H59QJ2bv2/gTJxVP05kyMjLwXOSL7GIEowX2Q0cLecua9 +tBFpCQ7nRSIrDh9NzFF1WDkreeSbSHS5zKOF9RP76skg6tHQgxVjkL3kFu3Pg3Uk +10mCnkPBkszr9scwuL/u1U4GPdwMWPzOaHaxA/bHMir24naYG2dCkSovICuiClZs +APchUzpe92vqd0liolzy26SdS6QeTrv6zJl7Nv7TPLqTpHmnouqXpkGszFvpA576 +VUID26r+kRG+NDDlE4Wmhs/mFDV0JzKCbWZZRQIDAQABAoIBACA+BtovosF+5Zie +HuewWo6iOIkjL9APiKpuBH5lRRPakhYf1lxLQVrJvdZ/ODuvXcUbVuNJTqfHR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LnJIbYkfeGa2/HXjzpnsNOa6KKLU +9tPY+b5OWejtCiayhuu7ro0yEqaGGJtsdG0JaeSxtsN80jYUUNDhOg== +-----END RSA PRIVATE KEY----- diff --git a/ssl/CA-Brehm/private/cakey.pem b/ssl/CA-Brehm/private/cakey.pem new file mode 100644 index 0000000..8726e72 --- /dev/null +++ b/ssl/CA-Brehm/private/cakey.pem @@ -0,0 +1,30 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,C9EB11CBB307A1DC + +9xwsypRNanPOrJDTAhnq291sYpHTmONc4nmigFl/fQUf4SINjBFnS/AzNXT7n9PY +mN1W9dAhdj8Mn2dJIg7qhIFzmGkXrgJ2wAoM2j9nXCpHcLyeziaILCNHcQWE71yC +8uy7bmSsVMLzuNKbuv2EPa0Jg0oEoxoUcvJ3uTV2frcTxo3dmDtKgAtTAaHCoXZR +skhwVJAn9+qN5ZzJEV1iJPDsvUyx4+PkGL2H2SEpri5WLZoMvBAE7xYD2lQNjCvT +kg0rHbK9xDs9dq0/BmpUWAX4Gt2e6LRXeaYIyGKhxa/k8nnebjgmOnEFUuNnf4dE +PWv1ccyMVmdWzFVqZQeVw4ad9XS9zoX2OoxQTVzq3P+nGUMU5D4Bu4T/z3w7SQvG +DfKldmBLDz/24HpyP5TzRZ3VEjqFos73gmnfbLaZGSWMCRSeDR5x5XnhB4ZfPAxK +qzAgXLtdcqv/j6Y9ucjdjEBOmWFa3TLlvQGFIZdKhdKRDXPT8WqOLb1DO+o2tHXY +bTGqvE6F2uL57tosAatFrn+XLYSpLS/vY9cOs+j2cSKfBe4a4qpAqWx9Tk4pR/nK +VWxyHvLKbjSdFo3Fqq+O/4k1sMd6FpD4oh5WHD1U7/Seoe6HKgi5OkJpwywZxCJC +rRRSPpwI2GKwOR1CzEZm/Z2RAQH2xbhOr95vaPXRGR4yCjQWLSxDdk6qCfPF60mE +ZEtWaDvMSkoBEs+ZHlAgZ/rXtylYdq2AvSD6eMz8zPhKdc+zlMHwl7ZlY8zQbsXZ +8ae4EqgUBczEODOfrYHfjAujDqkE6dqapcMeJlZCVHRXV1IvSItXBfvTN7XPOSAG +7nZ3oR4xdUFiOLZtcQ7okXU95B9isv1Aaix1JSj707f8MlG81qXM5eFJ/Na8fLy/ +4QMhuYazOd9MB/rPHwilUng+Mc0Ih3XChgZxcfMaCqwu87pE7t9WlmjL4KU5nXBK +OwwbaYq3IOuIwb+vYIlR1Dl3uALRTwmaeDbP9D7qPf+sLo3YpKbSaqtIoZOyM33l +zRjZu4lsLIQwHc6HrJCio+VlvzuzXdVAxQ6EHMsuZQXHbHb+qWI/tF/QQchGRvO6 +G8lhAwhiVXOZZxr42rZRfeJvePX2ERl/buAOsOcKZMUz5wWFfB2pX5up1wQpr5ew +XFz7l5LMMytiLSVzskMadZkSoA8Kta6C7eK72nRvg8A3TtL0tgu9a5BZPCngtjRj +qeBbM6ry7idy9uDkLIeX+9t0m25HWNMnFG0xkFmZyw3RSaSDCHKITbnu5xDPh5BD +qZpl9u7ihlrKMvzcy3HYkNuRsofvvE7yz2O9+/WhHjHKx1HEyGFln3OE0+5VMFOM +/fDwxvz8SWso0a/uXnJsO6qssFvGcMTh9YMkUkktwUZW06gQhSVJfq9avnqsOqIJ +BN9JLXVw71u8qqaGjao8fO9XI90X1b49SFYAfTvWHRy9BHNjj31/8rbN4/ZX9Ih/ +uSZ5bN0giKLQ+Gg12HziODsOeSkSVRY+MYeSyFR5X2vrw3ljU7focK3f2N3Uz8z0 +YtHicwrN7j9IgQze9+mrrVQSTast8eL6EK8tYlyw5Floby2NWH8D2/5kETXYaojX +-----END RSA PRIVATE KEY----- diff --git a/ssl/CA-Brehm/stunnel/mkcert b/ssl/CA-Brehm/stunnel/mkcert new file mode 100755 index 0000000..cd3ac76 --- /dev/null +++ b/ssl/CA-Brehm/stunnel/mkcert @@ -0,0 +1,111 @@ +#!/bin/bash +# +# This is a short script to quickly generate a self-signed X.509 key for +# Courier-IMAP/POP3 over SSL. + +set -e + +test -x /usr/bin/openssl || exit 0 + +CADir="/etc/ssl/CA-Brehm/stunnel" +prefix="/usr" +randfile="$CADir/stunnel.rand" +days=1875 +do_install=0 + +if [ "${#BASH_ARGV[@]}" == "0" ]; then + echo "No instances to generate certificates given." >&2 + exit 1 +fi + +echo +echo "Generating Random file '$randfile' ..." +dd if=/dev/urandom of=$randfile count=1 2>/dev/null + +clear_randfile() { + if [ -f "${randfile}" ] ; then + + fi +} + +trap clear_randfile INT TERM EXIT + +for i in "${BASH_ARGV[@]}"; do + echo + echo " - '${i}'" + echo + + target_dir="${CADir}/${i}" + + if [ ! -d "${target_dir}" ] ; then + echo " Creating directory ${target_dir} ..." + mkdir -p "${target_dir}" || exit 3 + fi + + pemfile="${target_dir}/${i}-cert.pem" + conffile="${target_dir}/${i}-cert.cnf" + + if [ ! -f "${conffile}" ] ; then + fi + +done + +exit 0 +Instances="webmail myadmin" + +for i in $Instances ; do + + pemfile="$CADir/$i-cert.pem" + conffile="$CADir/$i-cert.cnf" + + if [ -f $pemfile ]; then + echo "$pemfile already exists." + continue + fi + do_install=1 + + if [ ! -f $conffile ] ; then + echo "$conffile does not exists!" + exit 2 + fi + + cp /dev/null $pemfile + chmod 600 $pemfile + chown root $pemfile + + cleanup() { + echo + echo "Emergency Cleanup ..." >&2 + rm -f $pemfile + rm -f $randfile + exit 10 + } + + echo "Generating Cert for IMAP ..." + /usr/bin/openssl req -new -x509 -days $days -nodes \ + -config $conffile -out $pemfile -keyout $pemfile || cleanup + /usr/bin/openssl gendh -rand $randfile 512 >> $pemfile || cleanup + /usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile || cleanup + +done + +if [ "$do_install" = "1" ] ; then + + echo + echo "Installing Certificates ..." + + for i in $Instances ; do + + pemfile="$CADir/$i-cert.pem" + pemfile_orig="/etc/apache2/ssl/$i-cert.pem" + + cp -pv $pemfile $pemfile_orig + + done + +fi + +rm -f $randfile + + +# vim: ts=4 expandtab diff --git a/ssl/CA-Brehm/stunnel/stunnel-cert.cnf b/ssl/CA-Brehm/stunnel/stunnel-cert.cnf new file mode 100644 index 0000000..dabb192 --- /dev/null +++ b/ssl/CA-Brehm/stunnel/stunnel-cert.cnf @@ -0,0 +1,22 @@ +RANDFILE = /usr/share/webmail.rand + +[ req ] +default_bits = 1024 +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +C=DE +ST=Berlin +L=Berlin +O=Brehm +OU=Frank Brehm SSL Key +CN=myadmin.brehm-online.com +emailAddress=frank@brehm-online.com + + +[ cert_type ] +nsCertType = server + diff --git a/ssl/CA-Brehm/stunnel/stunnel.rand b/ssl/CA-Brehm/stunnel/stunnel.rand new file mode 100644 index 0000000000000000000000000000000000000000..5f47e0594bdac4865e398b96ba3b5a13db246b86 GIT binary patch literal 512 zcmV+b0{{KFaBz##Li$9v5MT!6I2zVxp+alOa@ZoN9<*rFXB$C(bD22$N7Y5B`O?h& zBq41~t_&AZ29Qy8`E!hJl$~=S(8y941GIB4cU#prjL5wEE=K7p6%-9@Kd=F!q0=+q zAe4Tp*A9%D-oB(5BdjBa<^31PeT;v1aa~80;_Lq8sdK4BiZ*mkm2LD^!z4Y6{MXv_ zM+hZtQmaCIf>A>MdqL~KTKdy@wiU2GQW=HISenRt$eDwJND~-xlqq}am6&lSAucYI z=ZyRb)7S4kZOX zDH<86*BrGW#NX71T0@BOue2$V{BMH7sNXCA8ta`=FVbX1sX5KiTH6Mep{0I_%RAj; zm0(=g0MKFo@y;s-ddfIELLqZvAGnKR_ZOXP`5>+Jpw!OW<=nI;iFBG;X$PeuQ{Eq? zL49n`n$f&xO3IVDkL>DVH_`nHY%&1(myoi;