Le blogouille de Caro et Nico

Entre famille, sport et aventures !

Catégorie dans Informatique / Computers

Playing with sa-learn

Showing the DB status

sa-learn --dump magic

Learning spam, Maildir format

sa-learn --no-sync --spam /var/vmail/caronico.fr/nico/Maildir/.INBOX.virusmails/{cur,new}

Learning Ham, Maildir format

sa-learn --no-sync --ham /var/vmail/caronico.fr/nico/Maildir/.INBOX.Societes/{cur,new}

Resetting permissions

chown -R debian-spamd.debian-spamd /var/spamassassin

Postfix : reject specific source domains

Edit the postfix main.cf configuration file to add a rejection on sender source :

smtpd_sender_restrictions = pcre:/etc/postfix/rejected_domains

Create the rejected_domains file, enter proper filtering like :

/facture.info$/ PERMIT specific sender from @facture.info
/\.info$/   REJECT All info other info domains are rejected

Compile the file into a database with postmap command :

postmap rejected_domains

This will update/create the postmap rejected_domains.db

Reload the postfix configuration

service postfix reload

Renouvellement certbot pour apache debian avec http-01

Bon Let’s Encrypt met fin au support du challenge type TLS-SNI. Donc on passe à autre chose, si possible automatisé. On se tente un challenge type http-01, qui passe finalement avec

certbot certonly –webroot -w /var/www -d www.caronico.fr

Tout simplement. Possibilité de le faire un mode –dry-run pour le faire un coup à blanc, ensuite pour de vrai, possibilité de vérifier la date et les détails du certificat dans le navigateur web.

Enfin refaire un coup de certbot renew –dry-run

pour simuler un nouveau rafraichissement du certificat. Attention à bien se positionner dans le dossier /var/www pour faire ces commandes.

Enfin, il faut relancer le service dovecot, pour recharger les nouveaux certificats mis à jour, sinon celui ci garde en mémoire les anciens certs.

Mise en place du DKIM

DKIM (DomainKeys Identified Mail) permet de protéger le nom de domaine au niveau des mails pour éviter qu’une autre personne en usurpe l’identité. Il faut plusieurs composants pour que cela fonctionne :

Installer opendkim et le configurer avec postfix. Attention sur le package debian il y a une certaine confusion sur le port de socket d’écoute entre 8891 et8892 dans les fichiers de config. Tout doit pointer vers le 8891.

Vérifier le tout dans un email de trafic de test de base que postfix arrive bien à communiquer avec opendkim et que tout circule. Bonus : les emails entrants bénéficient maintenant de vérification DKIM à leur tour.

Générer la clef de sécurité DKIM et l’intégrer aux records DNS domaine. Attention la clef étant assez grande (2048 bits) certaines interfaces de contrôle des DNS ont du mal à accepter une telle chaine. On peut passer en TXT / mode brut et éditer, sinon maintenant l’interface de OVH gère correctement l’insertion de de la chaine DKIM.

Ensuite on peut tester immédiatement avec un outils comme https://dkimvalidator.com/ si cela fonctionne. L’outils ne met pas en cache le DNS, donc dès que la modification est faîte on peut envoyer un mail signé. L’outils fournit pas mal de renseignements, en particulier si le mail est bien signé, si la signature publique est bien lisible dans le DNS (et quelle signature/record il tente de chercher) et enfin si la signature match. Bonus : on peut voir une analyse SpamAssassin de cet email et voir si des ajustements sont nécessaires.

Ensuite il faut ajuster le record DNS progressivement, en vérifiant bien l’impact sur le trafic de mails, ainsi que les reports DMARC des principales plateforme. Il y a plusieurs outils de tests sympa pour vérifier le handshake end-to-end, en envoyant un test de mail qui passe toute la chaîne de sécurité, avec vérification antispam complète, SPF, DKIM et spamassassin. Faire monter progressivement le niveau de policy du DKIM, de test vers prod, puis renforcer la policy vers QUARANTAINE, puis quelques jours plus tard vers REJECT.

En surveillant les rapports DMARC j’ai pu noter que le nombre de tentatives de spoofing a baissé, voir passé à zéro sous quelques semaines. Rudement efficace la policy reject !

Get the Dell HSPA 5530 WWAN working on any modern Dell Latitude laptop with Windows 7 x64bits.

Ok, after many (many) attempts and research, finally got the Dell HSPA 5530 WWAN Mini card working on a Dell Latitude laptop (in that case a 6420 XFR rugged) under Windows 7 x64Bits. The challenge is that you have to get the right combination of device drivers, and wireless manager version, as well force through the installation of the 5530 device, that check for a valid combination of laptop model / device and will reject the 5530 on this device.

Here is what you need :

  • A Dell Latitude laptop with a WWAN mini card slot, and the SIM Card slot (usually behind the battery), with pre-cabled antennas in the chassis. Fit the card into the chassis, shoud appear in Windows as an unknown device. Make sure BIOS setting is not interferring with disabled WWAN option.
  • The Windows 7 driver for the WWAN 5530 card, version A07, for Windows x64bits. You can find it here on Dell support web site Dell Wireless 5530 HSPA Mini-Card, v.Driver: v4.50.6.0 Co-installer: v1.0.12.1, A07. The name of the file is « DELL_WIRELESS-5530-HSPA-MINI_A07_R220899.exe ». This is a 10MBytes file.
  • The Dell Wireless Manager software, that comes inside a 10Mbytes file you can find on Dell Support at Dell Wireless 5530 HSPA Mini-Card, v.5.2.1045.60, A02
  • The Microsoft Orca MSI editor file, you can  find details and download link here
  • The approach used by Remko to force through the installation of the driver on the laptop (3x deactivating Authentication checks in MSI) documented on his blog here. 

Here are the steps :

  • Install the A02 applicatin 100Mbytes package first. This will get you the Wireless Manager on your Laptop. It won’t detect the device, because the WWAN card driver is not installed. That is OK.
  • Install the A07 driver of the card, this will fail with an error message that this card is not valid for this laptop. Use Remko’s approach, to NOT terminate the installer, but before closing it copy paste from the temp folder the whole temporary decompressed install folder, and then paste this somewhere in a place you have write access to. Terminate the installer that rejected the install, then edit the MSI file as documented by Remko by removing in 3 different places the authentication check. Re-run then the MSI package from there, that should install 3 new devices on your unit, that is a HSPA network card, a HSPA Modem, and a SIM Card slot.
  • Reboot, you are good to go. You shall now open the Wireless Manager application and see your card, turn the radio on, input your PIN code for the SIM and get connected. This will appear as a wired LAN connection to other programs when connected.

I tried other combination of Dell Control Point Connection Manager, or newer Wireless Manager, or not using Wireless Manager at all, or using different driver release, they all failed. The only one found working is A07 for the driver, and then A02 for the application call Wireless Manager.