Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung |
centos:mail_c7:zeyple [09.08.2016 08:09. ] – [zeyple Konfigurationsdatei] django | centos:mail_c7:zeyple [20.05.2021 06:05. ] (aktuell) – django |
---|
Verschlüsselung vertraulicher Daten dürfte in sensiblen Bereichen kaum mehr weg zu diskutieren sein. Sehr oft werden eMails genutzt, um einen Systemadministrator über Stati, (Fehl-)Funktionen und aussergewöhnliche Situationen zu informieren. | Verschlüsselung vertraulicher Daten dürfte in sensiblen Bereichen kaum mehr weg zu diskutieren sein. Sehr oft werden eMails genutzt, um einen Systemadministrator über Stati, (Fehl-)Funktionen und aussergewöhnliche Situationen zu informieren. |
| |
| <WRAP center round tip 90%> |
Besser als der Programm-Author //Cédric Félizard// des Encyption-Daemons **[[http://blog.infertux.com/2015/10/25/announcing-zeyple/|ZEYPLE]]** kann man es nicht besser beschreiben: | Besser als der Programm-Author //Cédric Félizard// des Encyption-Daemons **[[http://blog.infertux.com/2015/10/25/announcing-zeyple/|ZEYPLE]]** kann man es nicht besser beschreiben: |
| |
<WRAP center round alert 90%> | <WRAP center round alert 100%> |
\\ | **//Why should I care? If you are a sysadmin who receives emails from various monitoring tools like Logwatch, Monit, Fail2ban, Smartd, Cron, whatever - it goes without saying that those emails contain lots of information about your servers. Information that may be intercepted by some malicious hacker sniffing SMTP traffic, your email provider, <insert your (paranoid) reason here>... Why would you take that risk - encrypt them all!//** |
//Why should I care? If you are a sysadmin who receives emails from various monitoring tools like Logwatch, Monit, Fail2ban, Smartd, Cron, whatever - it goes without saying that those emails contain lots of information about your servers. Information that may be intercepted by some malicious hacker sniffing SMTP traffic, your email provider, <insert your (paranoid) reason here>... Why would you take that risk - encrypt them all!// | |
\\ | \\ |
</WRAP> | </WRAP> |
| </WRAP> |
| |
| |
In unserem Anwendungsbeispiel wollen wir alle eMails, die unsere Monitoring-Umgebeung **[[centos:web_c7:icinga:start|Icinga 2]]** verschickt automatisch verschlüsseln, sofern die Nachrichten den geschützen Bereich der eigenen Infrastruktur verlässt. | In unserem Anwendungsbeispiel wollen wir alle eMails, die unsere Monitoring-Umgebung **[[centos:web_c7:icinga:start|Icinga 2]]** verschickt automatisch verschlüsseln, sofern die Nachrichten den geschützen Bereich der eigenen Infrastruktur verlässt. |
| |
===== Kommunikationsablauf ===== | ===== Kommunikationsablauf ===== |
Nachfolgende Übersichsskizze zeigt diese Verarbeitungsschritte. | Nachfolgende Übersichsskizze zeigt diese Verarbeitungsschritte. |
| |
<uml width=900 title="Verarbeitungsschritte einer eMail"> | <uml> |
skinparam defaultFontName Courier | skinparam defaultFontName Courier |
| |
</uml> | </uml> |
| |
===== GutHub ===== | ===== GitHub ===== |
==== Download ==== | ==== Download ==== |
Bevor wir uns nun dieses Projekt auf unseren Rechner clonen, wechseln wir in das Prokekt-Verzeichnis unseres Servers. | Bevor wir uns nun dieses Projekt auf unseren Rechner clonen, wechseln wir in das Prokekt-Verzeichnis unseres Servers. |
| |
==== zeyple Konfigurationsdatei ==== | ==== zeyple Konfigurationsdatei ==== |
Damit nun der zeyple encryption deamon weiß, wo er sein Schlüsselmaterial findet und wie dieser mit dem SMTP-Relayhost kommunizieren soll, müssen wir ihm ein paar Informationen bereitstellen. Hierzu wird die Konfigurationsdatei //**/tec/zeyple.conf**// verwendet. Wir kopieren uns daher die Beispielskonfigurationsdatei aus dem GitHUB-Projektverzeichnis nach //**/etc**//. | Damit nun der zeyple encryption deamon weiss, wo er sein Schlüsselmaterial findet und wie dieser mit dem SMTP-Relayhost kommunizieren soll, müssen wir ihm ein paar Informationen bereitstellen. Hierzu wird die Konfigurationsdatei //**/etc/zeyple.conf**// verwendet. Wir kopieren uns daher die Beispielskonfigurationsdatei aus dem GitHUB-Projektverzeichnis nach //**/etc**//. |
# cp /usr/local/src/zeyple/zeyple/zeyple.conf.example /etc/zeyple.conf | # cp /usr/local/src/zeyple/zeyple/zeyple.conf.example /etc/zeyple.conf |
| |
Änderungen an dieser datei sind in aller Regel nicht nötig. | Änderungen an dieser Datei sind in aller Regel nicht nötig. |
<file bash /etc/zeyple.conf>[zeyple] | <file bash /etc/zeyple.conf>[zeyple] |
log_file = /var/log/zeyple.log | log_file = /var/log/zeyple.log |
<font style="color: rgb(29, 180, 29)"><b>●</b></font> postfix.service - Postfix Mail Transport Agent | <font style="color: rgb(29, 180, 29)"><b>●</b></font> postfix.service - Postfix Mail Transport Agent |
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled) | Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled) |
Active: active (running) since Tue 2016-08-09 10:01:21 CEST; 1min 23s ago | Active: <font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Tue 2016-08-09 10:01:21 CEST; 1min 23s ago |
Process: 25123 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS) | Process: 25123 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS) |
Process: 25141 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS) | Process: 25141 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS) |
</html> | </html> |
| |
| ===== Systemtest ===== |
| Nun ist es an der Zeit unsere Konfiguration zu testen. Als erstes schicken wir von der Konsole aus eine Testnachricht an eine Adresse, bei der wir zuvor den zugehörigen **[[/centos:mail_c7:zeyple#pgp-keys_der_empfaenger_importieren|PGP-Schlüssel importiert]]** hatten. |
| $ echo "very important top secret stuff" | mailx -s "secured message" thomas@gelf.net |
| |
| Im Logfile unseres Postfix MTA sehen wir die Abarbeitung dieser Nachricht. |
| <code>Aug 9 10:39:40 vml000117 postfix/pickup[27862]: 6172B1811270: uid=1000 from=<django> |
| Aug 9 10:39:40 vml000117 postfix/cleanup[28680]: 6172B1811270: message-id=<20160809083940.6172B1811270@vml000117.dmz.nausch.org> |
| Aug 9 10:39:40 vml000117 postfix/qmgr[27863]: 6172B1811270: from=<django@nausch.org>, size=484, nrcpt=1 (queue active) |
| Aug 9 10:39:40 vml000117 postfix/smtpd[28710]: connect from localhost[127.0.0.1] |
| Aug 9 10:39:40 vml000117 postfix/smtpd[28710]: 8A6AE183645E: client=localhost[127.0.0.1] |
| Aug 9 10:39:40 vml000117 postfix/cleanup[28680]: 8A6AE183645E: message-id=<20160809083940.6172B1811270@vml000117.dmz.nausch.org> |
| Aug 9 10:39:40 vml000117 postfix/qmgr[27863]: 8A6AE183645E: from=<django@nausch.org>, size=2343, nrcpt=1 (queue active) |
| Aug 9 10:39:40 vml000117 postfix/smtpd[28710]: disconnect from localhost[127.0.0.1] |
| Aug 9 10:39:40 vml000117 postfix/pipe[28682]: 6172B1811270: to=<thomas@gelf.net>, relay=zeyple, delay=0.21, delays=0.02/0/0/0.18, dsn=2.0.0, status=sent (delivered via zeyple service) |
| Aug 9 10:39:40 vml000117 postfix/qmgr[27863]: 6172B1811270: removed |
| Aug 9 10:39:41 vml000117 postfix/smtp[28712]: 8A6AE183645E: to=<thomas@gelf.net>, relay=10.0.0.87[10.0.0.87]:25, delay=0.99, delays=0.01/0/0.01/0.98, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 91DF3C00088) |
| Aug 9 10:39:41 vml000117 postfix/qmgr[27863]: 8A6AE183645E: removed |
| </code> |
| |
| Im Logfile des //**zeyple encryption daemon**// wird die Verarbeitung auch entsprechend dokumentiert. |
| <code>2016-08-09 10:39:40,484 28857 INFO Zeyple ready to encrypt outgoing emails |
| 2016-08-09 10:39:40,486 28857 INFO Processing outgoing message <20160809083940.6172B1811270@vml000117.dmz.nausch.org> |
| 2016-08-09 10:39:40,486 28857 INFO Recipient: thomas@gelf.net |
| 2016-08-09 10:39:40,486 28857 INFO Trying to encrypt for thomas@gelf.net |
| 2016-08-09 10:39:40,514 28857 INFO Key ID: 5D3F54A8637EE91F |
| 2016-08-09 10:39:40,560 28857 INFO Sending message <20160809083940.6172B1811270@vml000117.dmz.nausch.org> |
| 2016-08-09 10:39:40,578 28857 INFO Message <20160809083940.6172B1811270@vml000117.dmz.nausch.org> sent</code> |
| |
| Verschicken wir nun eine Nachricht an einen Empfänger für den wir keinen PGP-Schlüssel haben, kann diese natürlich __nicht__ verschlüsselt werden. |
| $ echo "very important top secret stuff" | mailx -s "secured message" bigchief@omni128.de |
| |
| Im Logfile des //**zeyple encryption daemon**// wird die Verarbeitung auch entsprechend dokumentiert. |
| <code>2016-08-09 10:43:16,882 29254 INFO Zeyple ready to encrypt outgoing emails |
| 2016-08-09 10:43:16,884 29254 INFO Processing outgoing message <20160809084316.BCE621811270@vml000117.dmz.nausch.org> |
| 2016-08-09 10:43:16,884 29254 INFO Recipient: bigchief@omni128.de |
| 2016-08-09 10:43:16,885 29254 INFO Trying to encrypt for bigchief@omni128.de |
| 2016-08-09 10:43:16,909 29254 INFO Key ID: None |
| 2016-08-09 10:43:16,909 29254 WARNING No keys found, message will be sent unencrypted |
| 2016-08-09 10:43:16,910 29254 INFO Sending message <20160809084316.BCE621811270@vml000117.dmz.nausch.org> |
| 2016-08-09 10:43:16,949 29254 INFO Message <20160809084316.BCE621811270@vml000117.dmz.nausch.org> sent</code> |
| |
| In der Postfix Logdatei wird der ordnungsgemäße Verarbeitungsablauf wie gewohnt festgehalten. |
| <code>Aug 9 10:43:16 vml000117 postfix/pickup[27862]: BCE621811270: uid=1000 from=<django> |
| Aug 9 10:43:16 vml000117 postfix/cleanup[29251]: BCE621811270: message-id=<20160809084316.BCE621811270@vml000117.dmz.nausch.org> |
| Aug 9 10:43:16 vml000117 postfix/qmgr[27863]: BCE621811270: from=<django@nausch.org>, size=488, nrcpt=1 (queue active) |
| Aug 9 10:43:16 vml000117 postfix/smtpd[29267]: connect from localhost[127.0.0.1] |
| Aug 9 10:43:16 vml000117 postfix/smtpd[29267]: E4D1E183645E: client=localhost[127.0.0.1] |
| Aug 9 10:43:16 vml000117 postfix/cleanup[29251]: E4D1E183645E: message-id=<20160809084316.BCE621811270@vml000117.dmz.nausch.org> |
| Aug 9 10:43:16 vml000117 postfix/qmgr[27863]: E4D1E183645E: from=<django@nausch.org>, size=685, nrcpt=1 (queue active) |
| Aug 9 10:43:16 vml000117 postfix/smtpd[29267]: disconnect from localhost[127.0.0.1] |
| Aug 9 10:43:16 vml000117 postfix/pipe[29253]: BCE621811270: to=<bigchief@omni128.de>, relay=zeyple, delay=0.21, delays=0.05/0.01/0/0.15, dsn=2.0.0, status=sent (delivered via zeyple service) |
| Aug 9 10:43:16 vml000117 postfix/qmgr[27863]: BCE621811270: removed |
| Aug 9 10:43:17 vml000117 postfix/smtp[29269]: E4D1E183645E: to=<bigchief@omni128.de>, relay=10.0.0.87[10.0.0.87]:25, delay=0.64, delays=0.01/0.01/0.07/0.54, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 0FE1EC00088) |
| Aug 9 10:43:17 vml000117 postfix/qmgr[27863]: E4D1E183645E: removed</code> |
| |
| ====== Links ====== |
| * **[[centos:mail_c7:start|Zurück zum Kapitel >>Mailserverinstallation unter CentOS 7<<]]** |
| * **[[wiki:start|Zurück zu >>Projekte und Themenkapitel<<]]** |
| * **[[http://dokuwiki.nausch.org/doku.php/|Zurück zur Startseite]]** |
| |
| |