23/03/2021

OVH on fire

As you may heard on march 10th a large fire destroyed part of a big datacenter in Strasbourg owned by OVH (maybe the biggest european service provider), and yes, this blog burned with it.

After the accident there was a huge discussion on the web, flames (sigh…) on Twitter and Reddit about this crazy provider which doesn’t have a disaster recovery plan or some sort of automagic backup, so people get stucked with no options other than start their site/service from scratch…

Some of you may think I’m mad about it and I would run away from this provider… well I’m not and I’ll remain with OVH.

The reasons are very simple, first of all as you can see the blog is back (maybe better than before, things like this always makes you think how can you improve stuff, or at least this is how they work for me) because (surprise surprise!) I had a backup every 6 hours on another location (thanks restic).
The second reason why I decided to stay with OVH is that their vps offer is perfect for my needs, it costs like a shared hosting service and runs so much better, and obviously I can do whatever I want with my private vps, instead of get stucked with only a wordpress hosting service.

And no, I’m not mad with OVH, because even without reading carefully the contract I signed, I knew from the beginning that I had to take care of backups, even if they were included in the service (and they’re not in my case).
Why? Because I want backup made on my way, so I can control them, I can check them, I can figure out the best recovery plan for me.

I understand those who were complaining about backups made in the same location where the burning happened, they payed for a service and it has a flaw (a big one, don’t get me wrong).
But from my perspective there was a bigger flaw, and it was their thinking “ok I paid someone to take care of the backup, job’s done”.
No… no…. NOOOOO!
If you own a service you have the responsibility to take care of the backup, to understand it, to figure out the recovery plan, and to test it; if their backups burned with servers it’s because they missed one, many or all those points.

That’s it, for me the case is closed.

24/12/2019

SPID… grazie ma no grazie

Negli ultimi anni (in particolare in questo 2019 che si sta concludendo) uno dei temi su cui la PA ha più martellato è SPID, il cosidetto Sistema Pubblico di Identità Digitale promosso dal Mise insieme con Agid e il celebre team per la trasformazione digitale del governo.

In questo post vorrei esporre i motivi per cui a mio modestissimo parere non solo SPID è una colossale regressione rispetto al precedente sistema di autenticazione “strong”, ma anche perchè è PERICOLOSO per i soggetti interessati, aziende e soprattutto privati cittadini.

Cominciamo col definire cos’è appunto SPID, trattasi di un sistema di autenticazione strong, ovvero che permette di certificare che il soggetto che si registra è stato verificato da un altro soggetto considerato affidabile (che da ora in poi chiameremo identity provider o idp, in questa sede prenderemo in esame i tre principali, Aruba, TIM e Poste, gli altri si comportano in modo del tutto identico).
Già qui cominciano i distinguo, ovvero effettuare la login tramite SPID non certifica che il soggetto che si sta autenticando sia il soggetto titolare delle credenziali SPID, nulla vieta al soggetto Pippo di consegnare le credenziali SPID al soggetto Pluto, e costui non avrà alcun problema ad autenticarsi come se fosse Pippo.
Si obbietterà che questo vale per qualsiasi altro sistema di autenticazione remota, ed è assolutamente vero a meno che non siano previsti fattori biometrici, ma è sempre bene ricordarlo.

In secondo luogo chiariamo un dettaglio che può sembrare lessicale ma è SOSTANZIALE e che riprenderemo successivamente, l’acronimo SPID viene pubblicizzato come Sistema Pubblico di Identità Digitale, niente di più falso, semmai sarebbe il caso di ribattezzarlo Sistema PRIVATO di Identità Digitale in quanto di pubblico in SPID non c’è proprio nulla.
Già perchè ogni volta che vi loggate ad un servizio pubblico con SPID, in realtà effettuate una login presso un servizio PRIVATO, di una società PRIVATA, perchè tali sono gli identity providers, non ci credete? Controllate voi stessi direttamente sul sito Agid.

Già signore e signori, non esiste un idp pubblico, non è mai esistito dal lancio del servizio e non ci sono informazioni che facciano pensare al lancio di un idp pubblico (non mancherebbero di certo le risorse alla PA per istituirne almeno uno…), quindi semmai non ve ne foste resi conto le vostre credenziali SPID non stanno affatto sul sito del vostro comune, regione, provincia, INPS o Agenzia delle Entrate, ma risiedono fisicamente nelle banche dati di queste società private, e indovinate un po’… quei dati danno accesso a TUTTI I VOSTRI DATI PIU’ SENSIBILI E PIU’ PERSONALI: fascicolo sanitario con tutta la vostra storia clinica, fascicolo previdenziale, dichiarazioni dei redditi, multe, pagamenti, rette scolastiche e chi più ne ha più ne metta, tutto in mano a un unico soggetto che ha (giustamente) l’obbiettivo di fare utili, non certo di fornire un servizio pubblico.

Qualcuno obbietterà che SPID prevede una autenticazione di secondo livello, ovvero quella che si definisce 2FA (autenticazione multifattore), ovvero un ulteriore dato oltre alle classiche username e password per autenticarsi; questo è vero, è previsto ed è fornito tramite app mobile (es Aruba e Poste) o SMS (es TIM).
Pensateci un attimo però, chi fornisce i fattori di autenticazione di secondo livello (2FA), nel caso di Aruba è una app sviluppata da Aruba stessa, idem per Poste, nel caso di TIM il mittente dell’SMS è TIM stessa; ovvero il soggetto che detiene i primi due fattori di autenticazione (username e password) è lo stesso che fornisce il terzo fattore di autenticazione, non proprio una best practice in termini di sicurezza e riservatezza dei dati, non trovate?

Alquanto curiosa come soluzione considerando che esistono degli standard specifici per i dispositivi per l’autenticazione multifattore, ed esiste una discreta quantità di dispositivi software e hardware che le implementano (Google Authenticator, Microsoft Authenticator, Authy, FreeOTP, tanto per citare alcune delle più celebri); usare queste non avrebbe comportato alcun costo e avrebbe permesso di scorporare i fattori di autenticazione riducendo drasticamente la criticità rappresentata dagli idp.

Si può obbiettare che gli idp sono soggetti selezionati e che danno garanzie ben precise in termini di professionalità, onorabilità e sicurezza.
Ebbene, ricordiamoci che il pericolo può provenire dall’interno di queste organizzazioni, ma soprattutto dall’esterno, un data breach su questi dati e una manomissione dei meccanismi di autenticazione multifattore avrebbero conseguenze CATASTROFICHE, sia quantitativamente(si stanno concentrando questi dati ipercritici in pochissimi soggetti) e qualitativamente (come dicevo poco sopra, accesso ai dati più sensibili e personali che esistano).

Quali garanzie forniscono Agid e idp? Un pezzo di carta, e mi si lasci aggiungere, che vale meno della carta su cui è scritto.
Già perchè di fatto l’unica garanzia fornita all’utente è puramente formale, una convenzione stipulata tra idp e Agid (qui un esempio) che non varrà assolutamente nulla in termini pratici una volta che il danno sarà stato fatto (le informazioni trafugate non torneranno magicamente indietro con qualche risarcimento).

Passiamo ora ad un aspetto sicuramente meno importante, SPID in fin dei conti è gratis, a caval donato non si guarda in bocca, giusto?
Beh sì… ni… no.
La creazione di un account SPID viene pubblicizzata come gratuita, in realtà è in promozione gratuita a certe condizioni, ovvero solo per privati e solo se ci si identifica con un altro meccanismo di autenticazione strong (es CRS/CNS), in caso contrario in alcuni casi occorre recarsi fisicamente presso uno sportello dell’idp (es Poste o TIM) oppure identificarsi tramite webcam ad un costo che varia mediamente tra le 14 e le 20 €,
Sia chiaro che se si vogliono attivare ulteriori meccanismi di autenticazione (es livello 2 con token fisico o livello 3) occorre sborsare altra pecunia.

Qualcuno obbietterà che quella spesa (soldi o tempo perso allo sportello) è ben poca cosa rispetto ai vantaggi di SPID.
E se vi dicessi che in realtà tutto questo esisteva già da tempo (2007, forse prima) grazie alla Carta Regionale dei Servizi e Carta Nazionale dei Servizi?
E se vi dicessi che CRS/CNS:

  • sono erogate esclusivamente da soggetti pubblici
  • prevedono meccanismi di autenticazione materialmente diversi (certificato nella smartcard fisica e PIN)
  • prevedono il possesso da parte dell’utente di entrambi i meccanismi di autenticazione (il PIN può essere modificato a piacimento da parte dell’utente)
  • sono gratuite

L’unica criticità storica di CRS/CNS è legata al dispositivo materiale (smartcard) che richiede un lettore dedicato e del relativo software, criticità vere con le quali mi sono scontrato io stesso, ma facilmente risolvibili cambiando il formato del dispositivo (da smartcard a pendrive usb? Magari micro o type-C e comunque compatibile con smartphone?) o con un miglior supporto software, tutte cose che avrebbero un costo irrisorio rispetto alla montagna di soldi spesi con SPID per rifare (MALE) qualcosa che già esisteva e funzionava (BENE).

Last but not least faccio presente che tutti i principali servizi pubblici, zitti zitti stanno gradualmente bandendo ogni meccanismo di autenticazione strong differente da SPID, resiste ancora qualche baluardo con CNS/CRS ma le amministrazioni stanno facendo di tutto per nasconderlo agli utenti e prevedono di eliminarlo a breve (es Comune di Roma): RESISTANCE IS FUTILE!

Lasciatemi concludere questa piccola rassegna degli orrori di SPID con un simpatico scambio che ho avuto su Twitter con Team Digitale, alla mia richiesta di chiarimento sulle criticità relative a sicurezza, riservatezza dei dati, fattori di autenticazione etc etc mi è stato risposto che: SPID è sicuro perchè gli identity providers verificano tramite webcam la registrazione degli utenti, non vi sentite più sicuri ora? :\

05/08/2019

On containers and orchestration

I don’t know what do you think about containers and orchestration tools, but for me it’s been a while since I started discussing on those topics on forum and various platforms, and I can’t say It’s an easy discussion.
To be honest I’m quite tired of repeating the same concepts so I thought this blog could be help me to express my point of view, at least in future I only have to copy and paste this post url and not waste time anymore :)

For someone my point of view on containers and microservices could sound a bit grumpy, but I can assure that I’m not against them, or think they are bad or simply some nasty trend.

First of all It’s imperative to distinguish between two main scenarios: development/test and production environment.

For the first one containers are wonderful, they are the Nirvana and Shangri-La all together, they give developers the opportunity to setup dev environment in no time, no setups, no hard requirements, everything is perfectly consistent and works in the same way as the tools they are familiar with (think about git or other versioning softwares), everything is perfectly reproducible on whatever platform, their work pc, home pc, a server, a laptor, everything.

For production… well It’s not the same.
First of all: the most important requirement for a production environment is reliability, then comes security, then everything else.
Literature, research, experience and logic taught us that these two basic requirements could be reached only following the KISS principle (Keep It Simple Stupid) which is not a joke, It’s real, It’s true and It works, period.
Second, when your application moves from development to production It moves from developers to sysadmins, It’s the sysadmin the guy which must maintain It, that must provide resources and guarantee that the application (and all its requirements) are working, are reliable and kept secure.
Third: if you think about the lifecycle of an application most of It is in production, an application could require a few months of development but will remain online for years, and usually the more It will require for the development the more It will remain in production.

Following the KISS principle means REDUCE COMPLEXITY, containers ADD COMPLEXITY :\
This may sound strange to containers users because “well it’s a piace of cake, launch a couple of commands and you’re ready to go”, well stop for a moment and think about it.

  • On a “legacy” environment you have, applications (your site, your database, etc etc) on top of services (webservers, application servers, rdbms, etc etc shared by several applications) on top of an OS (shared by several services) on top of some sort of hardware (which could be very complex in production, and could be shared between several OSs if you’re using virtual machines).
  • With containers and orchestrators (like Kubernetes or Openshift) you have a LOT more complexity, you still have your applications, on top of services (which are the same as before for instance…), on top of containers, on top of a container environment (for example Docker), on top of orchestrators, on top of a OS (usually installed on a vm, so add also the hypervisor complexity) on top of hardware.

More complexity means less reliability and less security, or a least a lot more work and variables to manage to reach the same level of those requirements.

Like everything there are pros and cons, and someone could argue that beside that added complexity containers and orchestrators give you a lot of benefits, mainly:

  1. reproducibility
  2. horizontal scalability (adding more “nodes” and distribute load across them).

We already talked about the first before, It’s awsome for a developer, but for a sysadmin on a production environment?
Well, not really, simply we don’t need it because move an application between different environments is really rare (in 20+ years of IT consultant work It happened to me only one time, moving and Oracle 10g rdbms from Windows Server 2003 to RHEL) and usually any service have its own backup and restore procedures to accomplish this goal.

Scalability is another story, in theory it’s an awsome thing, in real world it’s not a big deal in 99% of companies or services.
The idea of having some black magic that will add more and more instances of your application and distribute the load on those is good and managers love it, they simply think this is the solution for every problem because, let’s be honest, they don’t understand the complexity behind an application and they think that all the problems come from lack of resources.

In the real world any experienced sysadmin can confirm that usually resources are enough and when an application have problems it’s all about some bug, exception, unmanaged situations (for example the application use a third party service which doesn’t work and the application does not manage it), all those things can lead to a slow or unresponsive application even if you have a lot of resources available.
Adding more and more application instances and balance load across them will lead to a simple result: more and more exceptions.

Ok, let’s ride our fantasy horse and think about a bug free application, can we scale up with containers with no worries?
Sure you can, but do you really need it?
For 99% of companies nowadays it’s really rare that an application don’t have enough resources, or have such a huge amount of requests to run out of resources.
If you are Google, Facebook, Netflix, Amazon or any other global huge company maybe you really need horizontal scalability, so orchestrators and containers are very useful (it’s not surprising that one of the most popular orchestrators, Kubernetes, came from Google), otherwise… well no, you don’t need it.

So that’s all?
No, there are a lot of smaller pros and cons (most cons to be honest imho…) on this topic, like security, access on third party resources, logging, service redundancy vs consolidation and many more.
Most of these are huge problems with containers (and most of the times they are ignored) while with a traditional architecture they simply aren’t, even a simple stdout append on a log is a pain in the ass with containers, and require to add a lot of complexity to reach this simple goal (remember KISS principle).

Let me add a small personal thought on this subject that can be extended in many other areas of the IT universe.
As you probably understood I think that containers are a really good tool for developers and not a good one for sysadmins, containers are born from developers for developers.
Why people always think that a development tool should work for production?
Why people don’t think from a production perspective when they develope tools for production?

If you are a developer and you’re working on a tool that will be used in production, please ask your sysadmin what does he think about it, what’s its requirements, what are the problems that he usually have in production and he need to fix.
Maybe if we start to develope tools from the right perspective we’ll have better results, otherwise we will continue to have always the same problems.

[EDIT 23/04/2021]
Let me just add a little contribute from John Carmack, one of the greatest developers of all times, the father of DooM and Quake, and in general of modern FPS videogames.

17/10/2018

Wind Infostrada FTTC

Dopo tanto tempo ho deciso di scrivere uno post in italiano sperando che possa agevolarne la diffusione tra gli utenti del nostro Paese che si accingono ad aderire alle varie offerte di connettività propinate dai diversi operatori tlc.

Nel mio caso si tratta di Wind, operatore con il quale ho iniziato ad avere rapporti nel 2007 dopo una iniziale esperienza con NGI.
A onor del vero devo confessare di non aver mai avuto problemi catastrofici, la mia vecchia linea ADSL (seppur limitata a 4Mbps in downstream) si è sempre dimostrata stabile, affidabile e con una latenza decisamente superiore alla media.
A parte il feedback tecnico (variabile da zona a zona a causa dell’infrastruttura spesso in stato di abbandono) quello che mi ha favorevolmente impressionato è la flessibilità di Wind nell’applicare profili di connettività differenti da quelli proposti come standard, nel mio caso alzando la banda di upstream da 128Kbps a 512Kbps.

Poco meno di un anno fa scopro di avere copertura FTTC, viste la tariffe vantaggiose e il buon rapporto maturato decido di rimanere con questo operatore, tutto perfetto fino allo scorso agosto, quando noto un sensibile rallentamento nel downstream e un drastico aumento nella latenza.
Provo a lanciare qualche test con Speedtest.net utilizzando il server per me più affidabile (Fastweb Milano) e ottengo un ping aumentato da 5/6 a 25 ms e una banda in downstream diminuita da 60/70Mbps a 15/20Mbps.

Ripeto il test ogni giorno e ottengo lo stesso risultato, schedulo un test ogni 15 minuti utilizzando l’ottimo speedtest-cli da cui emerge un evidente problema di saturazione nelle ore serali, con qualche anticipo pomeridiano nel week end,  questo è il risultato, giudicate voi.

 

 

22/06/2015

Riattivazione fallback https su Firefox

Di recente il protocollo HTTPS è al centro di attenzioni di cui purtroppo fin’ora non aveva mai goduto, per questo stanno emergendo una serie di vulnerabilità che fino ad oggi sono state sottovalutate dalla gran parte degli utenti e degli addetti ai lavori.

Per adeguarsi alle nuove best practice i browser si sono evoluti inserendo configurazioni sempre più restrittive nell’accesso https ai siti.
Tutto bene, tutto bello (e ci mancherebbe), purtroppo però come sappiamo il mondo dell’IT è tutt’altro che uniforme o allineato alle ultime versioni di ogni tecnologia; specialmente in ambito lavorativo capita di trovare prodotti vetusti, interfacce web per la gestione di dispositivi hardware, piuttosto che architetture che per mille motivi non possono essere aggiornate, e quindi utilizzano il vecchio e insicuro protocollo SSL2 o SSL3.
Sia chiaro, si tratta di servizi non esposti sul web, dove quindi il rischio di attacco è estremamente basso o comunque gestito mediante opportune politiche di accesso perimetrali (anche su più livelli).

Che fare quindi per riattivare la compatibilità con il vecchio protocollo e accedere in https a questi servizi ritenuti insicuri dai browser?
Firefox ci viene incontro dando la possibilità di riattivare manualmente la considetta fallback ssl3.

Aprire il browser e digitare nella barra degli indirizzi about:config, nel caso vi comparisse un warning di sicurezza come questo confermate premendo l’apposito pulsante.

Clipboard01

Inserite nella campo cerca la stringa security.tls.version.min e settatene il valore a zero.

Clipboard02

Fate lo stesso per il campo security.tls.version.fallback-limit settandone il valore a zero.

Clipboard03

A questo punto non vi resta che riavviare il browser per rendere effettiva la modifica.

Ricordate di ripristinare il valori di questi due parametri di configurazione al termine dell’attività o comunque prima di accedere a siti web.

« Post precedenti