blogy

Reader

Read the latest posts from blogy.

from linarphy

I was trying to push a new git repo on another git server (git is peer-to-peer) to publish transparent open access data for my work. For the record, it was using Gitlab 😼‍💹.

Imagine my surprise (not) when I saw the message “Received disconnect from X.X.X.X port 22:2: Too many authentication failures”. Being a good pupil, all my SSH connections are protected with SSH key (except for one organization, but this will maybe be explained in another post). All my SSH keys expire (manually, as I delete them) every year, and this was the second time I used this SSH key.

I have two mirrors : one on my personal repo, one on the office repo. Two different SSH keys, of course, and the configuration worked for the first one
 So, why should I get this 😧 ?

git push
ÉnumĂ©ration des objets: 26, fait.
Décompte des objets: 100% (26/26), fait.
Compression par delta en utilisant jusqu'à 14 fils d'exécution
Compression des objets: 100% (23/23), fait.
Écriture des objets: 100% (26/26), 120.55 Kio | 15.07 Mio/s, fait.
Total 26 (delta 0), réutilisés 0 (delta 0), réutilisés du pack 0
remote: Checking connectivity: 26, done.
To git.linarphy.net:linarphy/step2angle.git
 * [new branch]      main -> main
La branche 'main' est paramétrée pour suivre la branche distante 'main' depuis 'origin'.
Received disconnect from X.X.X.X port 22:2: Too many authentication failures
Disconnected from X.X.X.X port 22
fatal: Impossible de lire le dépÎt distant.

Veuillez vérifier que vous avez les droits d'accÚs
et que le dépÎt existe.

That’s not good. So I try to ssh in the server, directly, with `ssh git@hostname -vvv', and
 surprise ! It doesn’t look at the good key. I check my configuration, everything looks good
 I re-check with the exact same command and configuration and
 TADAAAA, it works now đŸ„ł.

So, I try to git push again, and everything works again.

I don’t know what the root cause is, and I may never know đŸ€š. But there are multiple identifiable cause that increase the frequency of this type of issues.

First, OpenSSH client. It has a great history, one of the oldest SSH server and client, still there and doing great, implementing tons of stuff 🧓. Yet, it still forces people to create a .ssh folder in their $HOME directory without caring about .config which is a specification that has more than 20 years (for the 0.6 version). I was not born when the specification was starting to be crafted, and OpenSSH still does not care 😡.

Even Mozilla now (since one month) respect this specification.

Yes, you can force OpenSSH to use a custom config file with the -F option. But then, you have to work additional hours to adapt every software configuration that uses OpenSSH in the background to add this flag everywhere (when it is possible !).

Speaking about configuration file, its syntax is weird. I know how to read the doc, so it’s fine, but still.

But the strangest thing is its inability to select ONLY ONE key. When you add the nice -i /path/to/ssh/key argument, OpenSSH will still try others keys. I KNOW other keys won’t work. Stop trying everything you can to connect to the server. That is not sane default đŸ€Ź ! If you don’t ask for any key, I understand, but if you ask specifically for one, why using other keys ?

And it’s worse than what you think: If there is a mistake in your configuration, OpenSSH will accept it and if a valid key still exists, the user won’t know the key specified in the configuration is bad. So when you will clean your devil ~/.ssh folder and delete «unused keys », the surprise of being locked out, without any SSH key to connect to your server, will not be nice. Don’t worry, even if you don’t delete any keys, adding too many keys will make OpenSSH take minutes to find the good one, and you will think that the server is slow 🕜.

Erratum: I just discovered the -o IdentitiesOnly=yes option, but the fact that it not the default when specifying -i /path/key is beyond my comprehension.

Let’s speak about the verbosity of the SSH client, too. I want to know, first, if everything go right, then, how my configuration file is used, then what packet I send and receive with their code. Right now, you can get the first and last information, but good luck understanding if OpenSSH does what it does because you wrote something or if this is default behavior.

The second factor is Gitlab connection. Sometimes it works, sometime not. And being self-hosted software is no excuse. Codeberg, with forgejo, does well better, and without the AI bullshit đŸ’© and without being a huge company. Gitlab has a lot of feature, that you will absolutely never use, and this clutters your entire screen, which makes every operation harder than it should.

 
Lire la suite...

from linarphy

L’incident

Il est tard, et je reçois deux mails d’OVH m’indiquant que Hetzner et CSIRI-MU se plaigne de scan d’IP de la part d’un de mes VPS.

PremiĂšre hypothĂšse : l’email est un scam et ne provient pas d’OVH. Je vĂ©rifie la source du mail, ça a bien l’air de provenir de chez eux. Je regarde attentivement le contenu : pas de lien bizarre associĂ© Ă  un quelconque scam. Je mets l’hypothĂšse de cĂŽtĂ© et vĂ©rifie si le serveur incriminĂ© m’appartient. C’est bien le cas. Premiers frissons. Je regarde ce serveur et m’aperçois que le port 443 d'admin0.linarphy.net (le serveur ayant effectuĂ© les opĂ©rations malveillantes) ne rĂ©pond pas.

C’est confirmĂ©, on a pĂ©nĂ©trĂ© dans mon systĂšme. C’est bizarre, mais juste ce fait me met mal Ă  l’aise, comme si on avait pĂ©nĂ©trĂ© dans mon intimitĂ©. Beaucoup plus grave, admin0 est un composant essentiel de mon infrastructure. Par chance, admin1 rĂ©plique toutes les donnĂ©es, et ce backup n’est pas compromis. Heureusement, car ces serveurs hĂ©bergent mon DNS, mon LDAP et tout plein de trucs essentiels au fonctionnement des autres serveurs. J’en conclus directement que l’attaque n’est pas ciblĂ©e et a probablement Ă©tĂ© automatique, ou au moins semi-automatique. De toute façon, le pirate aurait mieux fait de rester discret et non de scanner des IP si cela avait Ă©tĂ© le cas. Me voici (un peu) rassurĂ©.

La solution est simple : reset le serveur, mettre admin1 en tant que main dns et de crĂ©er une rĂ©plique sur admin0. admin1 et admin0 hĂ©berge FreeIPA. Je remarque tout de mĂȘme que le port 443 d’admin1 ne rĂ©pond pas non plus. Tant qu’à faire, autant essayer de comprendre ce qu’il s’est passĂ©. Une chose est sĂ»re : je ne vais pas beaucoup dormir cette nuit (si je dors).

La connexion Ă  mon compte LDAP via clef privĂ© gĂ©rĂ© par nsss fonctionne, mais je n’y suis plus sudoer. La configuration LDAP a donc changĂ©. Je peux me connecter avec le mot de passe root qui ne semble pas avoir Ă©tĂ© modifiĂ© (quelle erreur). Je regarde les logs d’Apache (aprĂšs tout, il ne rĂ©pond pas), et je vois un restart Ă  minuit. Bizarre. En tout cas, Apache dit qu’il Ă©coute aux ports 443 et 80 en ce moment. J’en conclus que ma configuration Apache a Ă©tĂ© modifiĂ©e. Ça pue. Je peux initier un ticket Kerberos avec mon mdp admin : il n’a pas Ă©tĂ© modifiĂ©.

Je redĂ©marre tout avec systemctl restart ipa et tout redevient comme avant. Si ça se trouve, la panne n’est pas liĂ©e Ă  l’incident. Je me rends compte que ma mĂ©connaissance des rouages interne de FreeIPA ne me permet pas de tracer correctement un coupable.

Je cherche dans le syslog, je cherche dans les bash_history, sans rien trouver, à part un restart du service httpd à minuit pile, des heures avant l’incident.

ParanoĂŻa ?

Plus j’y regarde, plus les “preuves de hack” me paraissent faibles. La non-rĂ©ponse du port 443 ? Largement possible qu’il soit dĂ» Ă  une erreur du cĂŽtĂ© de FreeIPA. AprĂšs tout, ce logiciel est trĂšs complexe et une malfonction peut arriver.

Je ne suis plus sudoer ? En fait, avais-je fait le setup qui me permet d’ĂȘtre sudoer dans les serveurs d’administration ? AprĂšs quelques recherches, non.

Qu’est-ce qui a Ă©tĂ© modifiĂ© ? Rien.

Pourtant, OVH m’a transmis des plaintes de scans d’IPs. Que s’est-il passĂ© ? Je n’en sais rien.

J’envoie un mail de rĂ©ponse Ă  OVH en expliquant mes recherches, et le fait qu’aucune brĂšche n’est visible, en leur demandant s’ils avaient d’autres explications.

Je change toutes les clefs ssh, je change tous les mots de passes, et je m’arrĂȘte lĂ .

Conclusion

Plusieurs mois aprùs cet incident, j’en tire deux leçons :

  • ça ne mĂ©ritait pas d’y passer une nuit blanche comme je l’ai fait. Je n’ai de toute façon pas les compĂ©tences en cybersĂ©curitĂ©. Aujourd’hui encore, il est dur d’affirmer avec certitude si quelqu’un a tentĂ© (ou tente) de pĂ©nĂ©trer un de mes systĂšmes. Tout ce que je sais, c’est que je n’ai pas reçu de nouvelles plaintes (pour le moment !), et que mes systĂšmes sont sĂ©curisĂ©s de la meilleure maniĂšre possible, d’aprĂšs mes connaissances.
  • ça ne sert de paniquer (oui, c’était Ă©vident), et OVH s’en fout. Ils doivent envoyer ce genre de mail toutes les minutes et n’ont Ă©videmment pas vu ma rĂ©ponse.
 
Lire la suite...

from linarphy

Je lisais ce vieil article sur systemd et la structure des dĂ©bats en ligne le concernant. On y lit, en trĂšs rĂ©sumĂ©, que les dĂ©fenseurs et les dĂ©tracteurs de systemd n'ont pas la bonne foi suffisante pour dĂ©battre de ce sujet. Et cela m'a d'abord fait tiquer, parce qu'on confond ici les prises de positions avec les gens qui les donnent. Puis-je me suis rappelĂ© des dĂ©bats en lignes auxquels je participe (par chance, assez peu tout de mĂȘme).

Il ne faut jamais confondre ce qui a Ă©tĂ© dit et qui le dit. J'ai souvent tendance Ă  Ă©mettre un discours simple au dĂ©part d'un dĂ©bat, quelle que soit sa complexitĂ©. On pourrait alors croire que j'ai un avis tranchĂ© et non informĂ©. Parfois, c'est le cas, mais parfois, non. J'ajoute juste une brique Ă  un inventaire dĂ©jĂ  existant d'argument, gĂ©nĂ©ralement dĂ©jĂ  disponible sur cette mĂȘme discussion.

Il y a un discours consensuel sur “les minoritĂ©s qui parlent fort”. Mais dans les faits, ce n'est pas la seule grille d'analyse. Les discours sont certes sĂ»rement plus tranchĂ©s en ligne, mais ce n'est pas plus le fait des individus que celui de la structure des Ă©changes.

Engager un dĂ©bat avec une personne qu'on ne connaĂźt pas est complexe. Cela nĂ©cessite de comprendre ses dĂ©finitions et sa logique (s'il y en a đŸ« ). Sur internet, c'est possiblement avec des centaines de personnes qu'un dĂ©bat a lieu. S'attendre Ă  ce que tout se passe comme lors de discussion orale est irrationnel.

Entre le post qui n'emploie pas le bon mot, celui qui dĂ©veloppe mal un bon argument, ou celui qui est rempli d'implicites dont l'interprĂ©tation varie pour chaque lecteur, le dĂ©bat d'idĂ©e est complexe. Ce n'est pas forcĂ©ment nĂ©gatif, les combats sur terminaux interposĂ©s sont aussi l'occasion de former des alliances, des amitiĂ©s. L'Ă©coute des autres sur internet est Ă©tonnamment bonne, dans la plupart des cas. Ce qui rappelle que l'humain est un animal empathique qui a tendance Ă  se soucier des autres, malgrĂ© ce que l'on croit. Si les oppresseurs ont plus la parole, c’est aussi le cas dans la vraie vie.

Il est trop facile de condamner des “internautes moyen” trop bĂȘtes pour avoir un avis constructif en ligne. Dans la rĂ©alitĂ©, on en fait tous partie, et c'est normal. Je me mĂ©fierai toujours beaucoup plus d'un discours qui se clame nuancĂ© en appelant Ă  l'apaisement via des solutions individuelles que d'un autre qui se prend pour ce qu'il est : un bruit de plus dans l'ocĂ©an d'internet.

Car on lit des discours de beaucoup d'individus différents. Cependant, on les aperçoit surtout lorsque ielles crient fort. Mais presque tout le monde crie fort au moins une fois dans sa vie. En soi, rien de grave. Tant qu'on comprend qu'on lit la transcription de l'avis d'une personne inconnue, et non son avis directement.

 
Lire la suite...

from linarphy

I always had this project to have THE đŸȘ„ perfect tagging system, that will let hierarchical directories and files explode đŸ’„ in their stupidity. The Thing that will allow anyone to search for a study on penguins made less than 2 years ago and published in any open science libraries that I read about between two and one month. The kind of thing everyone dream about.

I first tried to implement a tagging đŸ· system as my first rust project (which didn't go very far, I admit). It showed me how hard it is to set up metadata, you have to define a grammar 🗂, that determine what data can have a metadata. Then I tried to document it, defining a set of rule to create such a system. First, by describing two concepts: tag, and relationship.

I quickly realized that you can implement boolean logic here, with set and sub-set. So I had: tags, relationships and operations, at the end. The missing piece was a taxonomy.

Then I tried to model simple system, and failed to determine which grammar would describe the best what is a resource, even what is a location of a resource (because then, you need a protocol, an authority, and at this point, you understand you just need to follow URI format, but you want to go beyond that, so you try to model authority, etc.).

Then I discovered it đŸ€©. The name of what I was thinking of. It already exists. Made by smart (weird?) people: ontology. Seems hard, but fun (at least for me, at first glance !). I'll try to experiment with that in a (hopefully) near future. I always try too much to go fully abstract/conceptual, which can be a curse. It's seem cool for this at least.

Now the trap to avoid is redefining the wheel, I hope think all these smart people already defined norm to follow. Have to find (and understand !) them now.

The more I go into this rabbit hole 🕳, the more I feel like it take a long time to get it done right. If I want to tag a document (let's say a scientific paper 📕), I have to define what metadata I CAN add to this “type” of document (and then, is “type” a metadata ?).

I have to install protĂ©gĂ© (to edit OWL and/or RDF files) to define a knowledge graph stored in a Neo4j/GraphDB database. Maybe I'll post on this kind of thing in a (hopefully 😅) near future.

At least I know where I am headed now đŸ«Ą !

 
Read more...

from linarphy

and why it should be a default for JSON and why everyone should use tab

First, let's be honest, it will be a half-troll/half-serious post.

Not too long ago, I had to manually edit a JSON file (don't ask why đŸ«ą). And like always, it took me 15 minutes to understand why things didn't work. And like always, it was because I put a comma at the end of a list
 It's 2025 ! I know about JSON5, but how it's not a default for every JSON parser ? It's crazy. Right ?

This led to me thinking of the magnificent advantages trailing commas have. How cute 😾 and dependable these , were. And how I loved them so much 💖.

In the not less beautiful language that is the noble PHP, I can put these cuties after the last element of any list, of course đŸ€­, but also after the last argument in a function call, and even after the last argument in a function definition ! The mighty PHP even allows them in use list !

Now the long awaited ode to trailing commas

I love how fast I can add an element in a long list, thanks to you ! I love how easy it is to read a commit diff, thanks to you ! I love how beautiful are my calls over 72 characters wide, now divided in several pretty lines ! How could I ever stop dreaming of you when writing JSON ? The JSON5 standard should definitely always be turned on You're the sunshine in my life, the standard of standards, the truth that everyone should listen to ! And I know you love me too !

And thanks to all the other serious language that that allows this gem to express itself every day !

That's all, folks đŸ«Ą !

And one day I'll really post a thesis about how tab indent should be the only accepted truth

 
Lire la suite...