Le blogouille de Caro et Nico

Entre famille, sport et aventures !

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.

 

 

 

 

Debian Live USB 9.4.0 with persistence

Ok, I spent some time to get the Live USB media of Debian Live 9.4.0 working. The documentation and experience is scattered around on Internet, so let’s get this here together so I can reproduce it later.

Scenario : deploy Debian Stretch 9.4.0 Live on USB stick with persistence, from Windows environment.

Source the right ISO : I got the amd 64bits edition with MATE environment, and non-free firmware. The non-free firmware was needed to get things working like in particular the Intel Wifi card.

User the right tool : Rufus was making the best installation, despite it does not provide persistence support, which need to be added after initial install.

Create the image, by using Rufus on your USB stick and selecting the ISO file you downloaded. That initial, primary, active, first permission has to be FAT32. It will take the whole space on the drive, that is OK.

Once the ISO file has been transferred/installed on the stick, time to get a tool like EPM (EaseUS Partition Manager) to resize down the primary FAT32 partition to something much smaller, like 3GB to cover your ISO image (mine was 2.2GB).

Create a new partition after this one (you can user the whole space remaining), and the under Linux Debian reformat it to « ext4 » and label it « persistence ». The persistence is NOT supported on FAT32 file, I figured that out by getting errors in kernel.log.

Then mount this newly created ext4 volume, and on the root of it, create a file named « persistence.conf » and add 2 lines (the second being an empty, blank line), the first just contains :

/ union

Close it all, reboot and select kernel option by pressing « tab » on the boot menu and adding « persistence » (without the quotes) to the boot.
The kernel should get it, and with that union on / level, you simply get full persistence of the environment.
You can happily create folders on Desktop, in your home, change your password as well install and upgrade packages, and find this back when you reboot.