Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$os_meta is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$os_previous_publish_date is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$os_notification_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Betterleaks, il nuovo scanner open source che vuole superare Gitleaks

Betterleaks, il nuovo scanner open source che vuole superare Gitleaks

BetterLeaks introduce un approccio più preciso alla scansione dei segreti nei repository Git, riducendo i falsi positivi e migliorando l’integrazione CI/CD. Uno strumento utilissimo per evitare l'esposizione di credenziali, token e altri dati riservati.

La gestione dei segreti applicativi ha rappresentato per anni uno dei punti più fragili nello sviluppo software moderno. Token API, chiavi private e credenziali purtroppo finiscono spesso nei repository Git, esponendo infrastrutture e dati riservati a rischi concreti. L’adozione di strumenti automatizzati per individuare queste esposizioni è cresciuta rapidamente a partire dal 2018, quando incidenti legati a repository pubblici hanno mostrato l’impatto reale di una configurazione errata. In questo contesto si inserisce BetterLeaks, un nuovo scanner open source progettato per migliorare precisione e prestazioni rispetto a soluzioni consolidate come Gitleaks.

BetterLeaks nasce con un obiettivo chiaro: ridurre il rumore generato dai falsi positivi e offrire una maggiore capacità di analisi su grandi codebase. Il progetto si colloca nel filone degli strumenti di sicurezza DevSecOps che operano direttamente sul codice sorgente, con un’attenzione specifica alla cronologia delle modifiche del codice (commit storici, cioè le versioni salvate nel tempo) e ai flussi automatizzati di integrazione e distribuzione continua (pipeline CI/CD, processi che testano e rilasciano automaticamente il software).

Architettura e funzionamento dello scanner

BetterLeaks utilizza un approccio ibrido basato su pattern matching e analisi contestuale. Il sistema si fonda su un motore di regole configurabili che identifica stringhe compatibili con formati noti di credenziali, come chiavi AWS, token GitHub e segreti OAuth. A differenza di strumenti precedenti, introduce un livello aggiuntivo di validazione semantica che riduce le segnalazioni errate.

Il parser interno analizza i repository Git a livello di oggetti, analizzando le modifiche del codice attraverso i commit (le registrazioni delle modifiche), i diff (le differenze tra versioni del codice) e i blob (i contenuti completi dei file salvati).

In questo modo diventa possibile individuare segreti anche se successivamente rimossi dal codice. L’elaborazione sfrutta un sistema di scansione incrementale, utile nei contesti CI dove ogni build analizza solo le modifiche recenti.

Un elemento distintivo è la gestione ottimizzata della memoria. BetterLeaks implementa tecniche di streaming per evitare il caricamento completo dei repository di grandi dimensioni. Tale approccio migliora le prestazioni in ambienti enterprise dove i repository possono superare diversi gigabyte di peso.

Limiti dei modelli tradizionali e miglioramenti introdotti

Strumenti come Gitleaks hanno contribuito a diffondere pratiche di scansione dei segreti, ma presentano alcune criticità. L’uso massivo di espressioni regolari porta spesso a un alto numero di falsi positivi, specialmente in progetti con configurazioni complesse o dati sintetici nei test.

BetterLeaks affronta questo problema introducendo un sistema di scoring. Ogni possibile segreto riceve un punteggio basato su vari segnali: ad esempio, una stringa che rispetta il formato di una chiave API ma appare in un file di documentazione riceve un punteggio inferiore rispetto alla stessa stringa trovata in un file di configurazione runtime.

Il progetto integra inoltre blacklist e whitelist dinamiche, permettendo agli sviluppatori di adattare lo scanner al proprio codice. Una flessibilità che risulta particolarmente utile nei monorepo (cioè un unico repository che contiene più progetti o moduli correlati) oppure in progetti caratterizzati da numerose dipendenze, ovvero librerie e componenti esterni da cui il software dipende per funzionare.

BetterLeaks può essere eseguito come step automatico durante le attività di build del codice, bloccando il rilascio in presenza di segreti critici. Supporta ambienti come GitHub Actions, GitLab CI e Jenkins, con configurazioni leggere basate su file YAML.

Mitigazioni e buone pratiche operative

L’utilizzo di uno scanner non elimina la necessità di strategie preventive. La gestione dei segreti dovrebbe sempre prevedere l’uso di sistemi dedicati come vault centralizzati e la rotazione periodica delle chiavi. BetterLeaks si inserisce come strumento di controllo, non come soluzione definitiva.

Quando viene individuato un segreto, la semplice rimozione dal repository non è sufficiente. Occorre procedere con la revoca immediata della credenziale e la sua sostituzione. Inoltre, è consigliabile riscrivere la cronologia Git tramite strumenti come filter-repo per eliminare completamente il dato esposto in precedenza.

La combinazione di scansione automatica, gestione centralizzata dei segreti e formazione degli sviluppatori rappresenta oggi l’approccio più efficace per ridurre il rischio di esposizioni accidentali.

Ti consigliamo anche

Link copiato negli appunti