You are looking at posts in the category Puremessage Unix.
| L | Ma | Me | J | V | S | D |
|---|---|---|---|---|---|---|
| « mai | ||||||
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
Posted on février 1st, 2007 by Océane.
Categories: Puremessage Unix.
La politique de filtrage antispam (AntiSpam Policy Rules) de Sophos Puremesssage Unix qui suit permet :
- Suppression les messages ou mails qui ont un taux de probabilité supérieur à 85% que ce soit du spam
- Mise en quarantaine des mails qui ont un taux de spam compris entre 50% et 85%
- Mise en quarantaine, tag et envoie des mails qui ont un taux de spam compris entre 40% et 50%
- On laisse passer tous les messages qui ont un taux de probabilité inférieur à 40%
Bon tuning de puremessage
# ########## Antispam Rules ############## Lorsque le Spam atteint le score de 85% on discard le mail# attr NAME=AntiSpam Rules - Spam over than 85 % - Action : discard mail.if not pmx_spam_prob :under 85 {pmx_mark1 "Spam-With-SpamProb-Over-Than-85";discard;stop;}# Lorsque le Spam est compris entre 50 et 85 on le met en quarantaine# attr NAME=AntiSpam Rules - Spam ranking between 50% and 85%. - Action : Quarantine, Stop.if allof(pmx_spam_prob :over 49,pmx_spam_prob :under 85){pmx_mark1 "Spam-With-SpamProb-Over-Than-50";pmx_add_header "X-PMX-Spam" "Probability=%%PROB%%";pmx_quarantine "Spam";stop;}# Lorsque le Spam est compris entre 40 et 50 on TAG le sujet# attr NAME=AntiSpam Rules - Spam ranking between 40% and 50%. - Action : Copie to quarantine, Subject Notification, Keep.if allof(pmx_spam_prob :under 49,pmx_spam_prob :over 40){pmx_mark1 "Spam-With-SpamProb-Over-Than-40";pmx_replace_header :index 0 "Subject" "[Suspected Spam with prob = %%PROB%%] : %%SUBJECT%%";pmx_file "Spam";keep;}# Lorsque le Spam est compris en dessous de 40 nous laissons passer# attr NAME=AntiSpam Rules - Spam under 40% - Action : Keep messageif not pmx_spam_prob :over 40 {pmx_mark1 "Spam-With-SpamProb-under-40";keep;stop;}# attr NAME=Add X-Header and deliver messageselse {pmx_replace_header :index 0 "X-PerlMx-Spam" "Gauge=%%XGAUGE%%%%IGAUGE%%, Probability=%%PROB%%, Report='%%HITS%%'";stop;}}
Posted on janvier 16th, 2007 by jerry.
Categories: Puremessage Unix.
Bonjour à toutes et à tous. Je vous propose ci-dessous un modèle de policy rules de Puremessage UX qui est en production sur mes MX et qu’on retrouve dans d’autres grosses boîtes qui utilisent Sophos Puremessage en antispam et antivirus de messagerie… Vous pouvez adapter les règles en fonction de vos besoins, cette configuration marche plutôt bien. :=)
La règle antispam suivante est utilisée : Lorsque la probabilité de Spam est supérieur à 50% on TAG le sujet
Source code for the policy script (Sieve)
File: /usr/opt/pmx/etc/policy.siv
require “PureMessage”;
# The 'pmx-test-mark' command is needed for the sample messages sent by the pmx-test program to be recognized. For sites running with high-mail volumes it might be a good idea to disable this actions as it prevents the relay tests from running as early as they otherwise could. See 'perldoc pmx-policy' for details about this command.
pmx_test_mark;
# attr NAME=Mail from internal hosts
if pmx_relay :memberof “internal-hosts” {
# The ‘pmx-mlog-watch’ depends on this to know which messages are outgoing and which are not.
pmx_mark1 “i”;
# attr NAME=Reject mail containing viruses
if pmx_virus {
# attr NAME=Allow unscannable messages to pass through
if pmx_virus_cantscan {
keep;
stop;
}
reject “One or more viruses were detected in the message.”;
stop;
}
}
# attr NAME=Mail from external hosts
else {
pmx_add_header “X-PMX-Version” “%%PMX_VERSION%%”;
pmx_mark “Size” “%%MESSAGE_SIZE%%”;
pmx_mark1 “Mail-Entrant-Externe”;
# attr NAME=Discard mail containing empty mail from
if not envelope :comparator “i;ascii-casemap” :all :matches [”from”]
[”*”]
{
pmx_mark1 “Mail-With-Empty-Mail-From”;
discard;
stop;
}
# attr NAME=Discard mail containing viruses
if pmx_virus {
# attr NAME=If no virus found but scan failed
if pmx_virus_cantscan {
# attr NAME=Allow mail with SOPHOS_SAVI_FILE_ENCRYPTED
if pmx_virus_id :comparator “i;ascii-casemap” :contains [”SOPHOS_SAVI_FILE_ENCRYPTED”] {
pmx_replace_header :index 0 “Subject” “[FILE_ENCRYPTED] %%SUBJECT%%”;
pmx_mark1 “Mail-With-Encrypted-File”;
keep;
stop;
}
# attr NAME=Allow mail with SOPHOS_SAVI_FILE_TIMEOUT
if pmx_virus_id :comparator “i;ascii-casemap” :contains [”SOPHOS_SAVI_FILE_TIMEOUT”] {
pmx_replace_header :index 0 “Subject” “[FILE_TIMEOUT] %%SUBJECT%%”;
pmx_mark1 “Mail-With-File-TIMEOUT”;
keep;
stop;
}
# attr NAME=Allow mail with SOPHOS_SAVI_NOT_SUPPORTED
if pmx_virus_id :comparator “i;ascii-casemap” :contains [”SOPHOS_SAVI_NOT_SUPPORTED”] {
pmx_replace_header :index 0 “Subject” “[NOT_SUPPORTED] %%SUBJECT%%”;
pmx_mark1 “Mail-With–File-Not-Supported”;
keep;
stop;
}
# attr NAME=Allow mail with SOPHOS_SAVI_FILE_PART_VOL
if pmx_virus_id :comparator “i;ascii-casemap” :contains [”SOPHOS_SAVI_FILE_PART_VOL”] {
pmx_replace_header :index 0 “Subject” “[FILE_PART_VOL] %%SUBJECT%%”;
pmx_mark1 “Mail-With-File-Part-Vol”;
keep;
stop;
}
# attr NAME=Allow mail with SOPHOS_SAVI_FILE_CORRUPT
if pmx_virus_id :comparator “i;ascii-casemap” :contains [”SOPHOS_SAVI_FILE_CORRUPT”] {
pmx_replace_header :index 0 “Subject” “[FILE_CORRUPT] %%SUBJECT%%”;
pmx_mark1 “Mail-With-File-Corrupt”;
keep;
stop;
}
# attr NAME=Allow mail with SOPHOS_SAVI_SCAN_ABORTED
if pmx_virus_id :comparator “i;ascii-casemap” :contains [”SOPHOS_SAVI_SCAN_ABORTED”] {
pmx_replace_header :index 0 “Subject” “[SCAN_ABORTED] %%SUBJECT%%”;
pmx_mark1 “Mail-With-File-Scan-Aborded”;
keep;
stop;
}
}
pmx_mark1 “Mails-With-Virus”;
discard;
stop;
}
# attr NAME=Quarantine mail containing suspicious attachments with TFT
if pmx_suspect_attachment :tft :inspect_archives {
pmx_mark1 “Mails-With-Suspect-Attachment-TFT”;
pmx_quarantine “SuspectTFT”;
stop;
}
# attr NAME=Quarantine mail containing suspicious attachments
if pmx_suspect_attachment :inspect_archives {
pmx_mark1 “Mails-With-Suspect-Attachment”;
pmx_quarantine “Suspect”;
stop;
}
# attr NAME=Deliver mail from whitelisted hosts and senders
if anyof(pmx_relay :memberof “whitelisted-hosts”,
address :all :memberof “From” “whitelisted-senders”,
envelope :memberof “From” “whitelisted-senders”,
address :all :memberof “From” “whitelisted-senders-per-user”,
envelope :memberof “From” “whitelisted-senders-per-user”)
{
keep;
stop;
}
# attr NAME=Deliver mail to anti-spam opt-outs
if envelope :memberof “to” “anti-spam-optouts” {
keep;
stop;
}
# attr NAME=Quarantine mail from blacklisted hosts and senders
if anyof(pmx_relay :memberof “blacklisted-hosts”,
address :all :memberof “From” “blacklisted-senders”,
envelope :memberof “From” “blacklisted-senders”,
address :all :memberof “From” “blacklisted-senders-per-user”,
envelope :memberof “From” “blacklisted-senders-per-user”)
{
pmx_quarantine “Blacklisted”;
stop;
}
# import levels here
# ########## Antispam Rules #############
# Lorsque le Spam est supérieur à 50 on TAG le sujet
# attr NAME=AntiSpam Rules - Spam ranking over 50%. - Action : Copie to quarantine, Subject Notification, Keep.
if pmx_spam_prob :over 50 {
pmx_mark1 “Spam-With-SpamProb-Over-Than-50″;
pmx_file “Spam”;
pmx_replace_header :index 0 “Subject” “[Suspected Spam with = %%PROB%%] : %%SUBJECT%%”;
keep;
}
# Lorsque le Spam est compris en dessous de 50 nous laissons passer
# attr NAME=AntiSpam Rules - Spam under 50% - Action : Keep message
if pmx_spam_prob :under 50 {
pmx_mark1 “Spam-With-SpamProb-under-50″;
keep;
stop;
}
# attr NAME=Add X-Header and deliver messages
else {
pmx_replace_header :index 0 “X-PerlMx-Spam” “Gauge=%%XGAUGE%%%%IGAUGE%%, Probability=%%PROB%%, Report=’%%HITS%%’”;
stop;
}
}
Comments Off
Posted on décembre 26th, 2006 by jerry.
Categories: Puremessage Unix.
Alors voila, je publie ce court post pour donner un coup de pouce à ceux qui ont passé quelques temps à résoudre le problème d’accès à l’interface End User Management de Puremessage au travers d’un firewall IPFilter(IPF) sur FreeBSD.
Le problème est le suivant: on n’arrive pas à accèder à l’interface utilisateur de Puremessage qui utilise le protocole HTTP sur le port 28080 ou HTTPS sur le port 28443. Apache réalise en fait une redirection des pages HTTP vers HTTPS. J’espère que je me fait comprendre. De toute façon, ceux qui sont confrontés à Puremessage voient de quoi je veux parler.
Voyons maintenant pourquoi ma configuration de IPF ne laisse pas passer mes requêtes sur le port 28080 et 28443…
Voici un extrait de mon fichier configuration /etc/ipf.rules de mon firewall FreeBSD possédant l’interface xl0 en entrée :
# Administration Sophos
pass in quick on xl0 proto tcp from any to 2**.***.138.68 port = 18080 keep state
pass in quick on xl0 proto tcp from any to 2**.***.138.68 port = 28080 keep state
pass in quick on xl0 proto tcp from any to 2**.***.138.68 port = 28443 keep state
Bien que correcte, cette configuration ne marche pas pour les ports 28080 et 28443. La barre de chargement du navigateur de la page de l’End User Interface commence à progresser avant d’afficher un timeout très frustrant…
La solution à ce problème est l’introduction du flag S ou flag SYN utilisé lors de l’initialisation d’une connection.
pass in quick on xl0 proto tcp from any to 2**.***.138.68 port = 18080 flags S keep state
pass in quick on xl0 proto tcp from any to 2**.***.138.68 port = 28080 flags S keep state
pass in quick on xl0 proto tcp from any to 2**.***.138.68 port = 28443 flags S keep state
Explication: Mettre le flag S implique que seuls les paquets ayant le flag S (poignet de main comme étant le premier paquet), ou les paquets disposants déjà d’un état pourront passer.
Comments Off
Posted on décembre 22nd, 2006 by jerry.
Categories: Puremessage Unix.
Hello, les pros de la sécurité et de la messagerie sans spam ni virus… Je vais vous présenter ici les astuces que j’ai un peu galérer à trouver pour installer sans trop de peine Sophos Puremessage 5.3 sur une FreeBSD 6.1. Ce ne sont que des astuces d’installation pour vous faciliter la vie si vous butez sur des problèmes. En tout cas pour une installation détaillée, merci de consulter le Puremessage User guide en ligne.
Alors accrochez-vous, c’est dur mais ça a le mérite d’être sûr !
1. Liens des librairies compat4x et compat5x à rajouter éventuellement (problème constaté avec Puremessage 5.2 sur une FreeBSD 6.1):
Créez les liens symboliques suivants si nécessaires après avoir installé les ports compat4x et compat5x.
ln -s /usr/local/lib/compat/libc.so.4 /lib/libc.so.4
Faire de même pour les librairies suivantes:
libc_r.so.4 -> /usr/local/lib/compat/libc_r.so.4
libcrypt.so.2 -> /usr/local/lib/compat/libcrypt.so.2
libm.so.2 -> /usr/local/lib/compat/libm.so.2
libutil.so.3 -> /usr/local/lib/compat/libutil.so.3
2. Les Starting scripts:
Créez les liens symboliques suivants dans /usr/local/etc/rc.d/ pour que Postfix et Puremessage se lancent automatiquement au démarrage.
ln -s /opt/pmx/postfix/etc/init.d/postfix /usr/local/etc/rc.d/postfix.sh
ls -s /opt/pmx/bin/pmx-init /usr/local/etc/rc.d/puremessage.sh
3. Erreur bateau “chiante” avec la librarie libblocklist.so:
Quand on relance Puremessage sous le compte pmx, le Blocker nous affiche un message d’erreur…:
$ pmx restart
Can’t load ‘/opt/pmx/lib/site_perl/5.6.1/i386-freebsd-thread-multi/auto/PureMessage/Blocklist/Blocklist.so’ for module PureMessage::Blocklist: Shared object “libblocklist.so” not found, required by “Blocklist.so” at /opt/pmx/lib/5.6.1/i386-freebsd-thread-multi/XSLoader.pm line 75. Compilation failed in require at /opt/pmx/etc/init.d/pmx-blocker line 13. BEGIN failed–compilation aborted at /opt/pmx/etc/init.d/pmx-blocker line 13. Sending signal 1 to process 19372…..
Pour résoudre le problème il faut mettre à jour ou déclarer la variable d’environnement Dynamic Linker ou LD_LIBRARY_PATH pour le user pmx tout simplement…
En modification temporaire, entrez: export LD_LIBRARY_PATH=”/opt/pmx/lib”
Ou de façon définitive, éditez le fichier .profile dans ~HOME/pmx et insérez:
LD_LIBRARY_PATH=/opt/pmx/lib
export LD_LIBRARY_PATH
Voili, voilu c’est fini pour ce mini-howto sur Puremessage Unix 5.3. :=)
A bientôt pour de nouvelles astuces !!!