Benchmark
Un’analisi di conformità confronta il sistema target con un riferimento (il benchmark), ovvero un insieme di regole di sicurezza che consente di valutare la conformità o la non conformità del sistema.
Un benchmark viene definito utilizzando lo standard SCAP, che consente alle organizzazioni di automatizzare il modo in cui monitorano le vulnerabilità e verificano la propria conformità alle policy di sicurezza.
Struttura di un benchmark
Un benchmark comprende un file XCCDF che descrive le regole di conformità e i test che consentono di valutarle. Tali test possono essere scritti in formato OVAL o SCE.
Cyberwatch supporta due formati di benchmark:
- un file ZIP contenente come minimo un file XCCDF ed eventualmente gli altri file (script SCE o OVAL) i cui percorsi relativi sono stati dichiarati nel file XCCDF
- un file in formato DataStream
Esempio minimo di file XCCDF
Esempio di file XCCDF estratto dal benchmark CIS per Ubuntu Linux 22.04 LTS, che definisce un benchmark contenente una sola regola di conformità:
<xccdf:Benchmark id="xccdf_org.cisecurity.benchmarks_benchmark_1.0.0_CIS_Ubuntu_Linux_22.04_LTS_Benchmark" xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2" xmlns="http://checklists.nist.gov/xccdf/1.2" >
<xccdf:title>CIS Ubuntu Linux 22.04 LTS Benchmark</xccdf:title>
<xccdf:platform idref="cpe:2.3:o:canonical:ubuntu_linux:22.04:*:*:*:lts:*:*:*"/>
<xccdf:Rule id="xccdf_org.cisecurity.benchmarks_rule_1.1.5.3_Ensure_noexec_option_set_on_varlog_partition" role="full" selected="false" weight="1.0">
<xccdf:title xml:lang="en">Ensure noexec option set on /var/log partition</xccdf:title>
<xccdf:description xml:lang="en">
<xhtml:p><xhtml:span class="inline_block">noexec</xhtml:span> mount option specifies that the filesystem cannot contain executable binaries.</xhtml:p>
</xccdf:description>
<xccdf:rationale xml:lang="en">
<xhtml:p> Since the <xhtml:span class="inline_block">/var/log</xhtml:span> filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from <xhtml:span class="inline_block">/var/log</xhtml:span>.</xhtml:p>
</xccdf:rationale>
<xccdf:fixtext xml:lang="en">
<xhtml:div>
<xhtml:p><xhtml:strong>IF</xhtml:strong> the <xhtml:span class="inline_block">/var/log</xhtml:span> partition exists, edit the <xhtml:span class="inline_block">/etc/fstab</xhtml:span> file and add <xhtml:span class="inline_block">noexec</xhtml:span> to the fourth field (mounting options) for the <xhtml:span class="inline_block">/var/log</xhtml:span> partition.</xhtml:p>
<xhtml:p>Run the following command to remount <xhtml:span class="inline_block">/var/log</xhtml:span> with the configured options: </xhtml:p>
<xhtml:code class="code_block"># mount -o remount /var/log</xhtml:code>
</xhtml:div>
</xccdf:fixtext>
<xccdf:complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_22.04_LTS_Benchmark_v1.0.0-oval.xml" name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_22:def:2956581"/>
</check>
</xccdf:complex-check>
</xccdf:Rule>
</xccdf:Benchmark>
Alcuni elementi da notare in questo documento:
- L’identificativo del benchmark, definito dall’attributo
iddel tag<xccdf:Benchmark>, che funge da riferimento per Cyberwatch - La piattaforma target è definita in formato CPE dall’attributo
idrefdel tag<xccdf:platform>. È inoltre possibile dichiarare una o più piattaforme a livello di una regola se si desidera limitarne l’applicazione - Nella definizione della regola
<xccdf:Rule>, il contenuto del tag<xccdf:complex-check>consente di elencare i test da eseguire e i percorsi relativi per accedere ai file in cui sono definiti
In questo esempio, l’unica regola fa riferimento a un test in formato OVAL: il benchmark conterrà quindi questo file XCCDF e il file OVAL dichiarato. Potrà quindi essere distribuito in formato ZIP o in formato DataStream.
Se invece la regola avesse fatto riferimento a uno script in formato SCE, dichiarando ad esempio:
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/ensure_no_exec_option.sh"/>
</check>
Il benchmark conterrebbe il file XCCDF e una directory sce contenente lo script Shell ensure_no_exec_option.sh. Il tutto dovrebbe essere compresso in formato ZIP per poter essere aggiunto a Cyberwatch, come descritto di seguito.
La struttura dei file all’interno del file ZIP deve rispettare obbligatoriamente i percorsi relativi dichiarati nel file XCCDF.
Aggiungere un benchmark
- Accedere a Amministrazione > Benchmark
- Cliccare sul pulsante «Aggiungi»
- Selezionare il benchmark da aggiungere, in formato ZIP o DataStream
- Cliccare su «Importa»
Durante l’importazione, se l’identificativo del benchmark esiste già in Cyberwatch, il benchmark viene aggiornato. In caso contrario, viene creato un nuovo benchmark.
È possibile importare nuovi benchmark solo per le piattaforme supportate dal modulo di gestione della conformità di Cyberwatch. È quindi possibile importare un benchmark per altre versioni di sistemi operativi, come macOS o Ubuntu 12.04 ad esempio, ma non un benchmark che consenta di verificare la configurazione di un software o di un dispositivo di rete, ad esempio.
Elenco delle piattaforme supportate
Nella tabella seguente sono elencati le piattaforme supportate e i benchmark già installati:
| Sistemi operativi | CPE della piattaforma | Benchmark installati |
|---|---|---|
| AlmaLinux | cpe:/o:almalinux:almalinux:8, … | CIS Alma Linux OS 8 Benchmark CIS AlmaLinux OS 9 Benchmark |
| Amazon Linux 2 | cpe:/o:amazon:linux_2 | CIS Amazon Linux 2 Benchmark CIS Amazon Linux 2023 Benchmark |
| Apple macOS | cpe:/o:apple:mac_os_x:10.15.0, … | CIS Apple macOS 10.15 Catalina Benchmark CIS Apple macOS 11.0 Big Sur Benchmark CIS Apple macOS 12.0 Monterey Benchmark CIS Apple macOS 13.0 Ventura Benchmark CIS Apple macOS 14.0 Sonoma Benchmark CIS Apple macOS 15.0 Sequoia Benchmark |
| CentOS Linux | cpe:/o:centos:centos:6, … | CIS CentOS Linux 6 Benchmark CIS CentOS Linux 7 Benchmark |
| Debian | cpe:/o:debian:debian_linux:9.0, … | CIS Debian Linux 9 Benchmark CIS Debian Linux 10 Benchmark CIS Debian Linux 11 Benchmark CIS Debian Linux 12 Benchmark |
| Fedora Linux | cpe:/o:fedora:linux:28 | CIS Fedora 28 Family Linux Benchmark |
| Microsoft Windows 8 | cpe:/o:microsoft:windows_8 | CIS Microsoft Windows 8 Benchmark |
| Microsoft Windows 10 | cpe:/o:microsoft:windows_10 | CIS Microsoft Windows 10 Enterprise Benchmark CIS Microsoft Intune for Windows 10 Benchmark |
| Microsoft Windows 11 | cpe:/o:microsoft:windows_11 | CIS Microsoft Windows 11 Enterprise Benchmark CIS Microsoft Intune for Windows 11 Benchmark |
| Microsoft Windows Server 2008 | cpe:/o:microsoft:windows_server_2008, cpe:/o:microsoft:windows_server_2008:r2 | CIS Microsoft Windows Server 2008 (non-R2) Benchmark CIS Microsoft Windows Server 2008 R2 Benchmark |
| Microsoft Windows Server 2012 | cpe:/o:microsoft:windows_server_2012, cpe:/o:microsoft:windows_server_2012:r2 | CIS Microsoft Windows Server 2012 (non-R2) Benchmark CIS Microsoft Windows Server 2012 R2 Benchmark |
| Microsoft Windows Server 2016 | cpe:/o:microsoft:windows_server_2016 | CIS Microsoft Windows Server 2016 Benchmark |
| Microsoft Windows Server 2019 | cpe:/o:microsoft:windows_server_2019 | CIS Microsoft Windows Server 2019 Benchmark |
| Microsoft Windows Server 2022 | cpe:/o:microsoft:windows_server:2022 | CIS Microsoft Windows Server 2022 Benchmark |
| Microsoft Windows Server 2025 | cpe:/o:microsoft:windows_server:2025 | CIS Microsoft Windows Server 2025 Benchmark |
| Oracle Linux | cpe:/o:oracle:linux:6, … | CIS Oracle Linux 6 Benchmark CIS Oracle Linux 7 Benchmark CIS Oracle Linux 8 Benchmark CIS Oracle Linux 9 Benchmark |
| Red Hat Enterprise Linux | cpe:/o:redhat:redhat_enterprise_linux:6, … | CIS Red Hat Enterprise Linux 6 Benchmark CIS Red Hat Enterprise Linux 7 Benchmark CIS Red Hat Enterprise Linux 8 Benchmark CIS Red Hat Enterprise Linux 9 Benchmark |
| Rocky Linux | cpe:/o:rocky:rocky_linux:8, … | CIS Rocky Linux 8 Benchmark CIS Rocky Linux 9 Benchmark |
| SUSE Linux Enterprise Server OpenSUSE Leap | cpe:/o:suse:suse_linux_enterprise_server:12, … | CIS SUSE Linux Enterprise 12 Benchmark CIS SUSE Linux Enterprise 15 Benchmark |
| Ubuntu | cpe:/o:canonical:ubuntu_linux:16.04, … | CIS Ubuntu Linux 14.04 LTS Benchmark CIS Ubuntu Linux 16.04 LTS Benchmark CIS Ubuntu Linux 18.04 LTS Benchmark CIS Ubuntu Linux 20.04 LTS Benchmark CIS Ubuntu Linux 22.04 LTS Benchmark CIS Ubuntu Linux 24.04 LTS Benchmark |
| Kernel Linux | cpe:/o:linux:linux_kernel:* | CIS Docker Benchmark |
Standard supportati
Le versioni dei componenti SCAP supportati, con il relativo namespace XML, sono:
I namespace XML non riconosciuti vengono ignorati. Un tentativo di importazione di un benchmark con una versione DataStream o XCCDF sconosciuta terminerà quindi con un errore di file XCCDF non trovato.
Link utili
Glossario
SCAP
Lo standard SCAP (Security Content Automation Protocol) comprende diversi standard di componenti progettati per funzionare insieme. Per ciascun componente, lo standard definisce un formato di documento con la sintassi e la semantica delle strutture dati interne. Tutti gli standard di componenti sono basati su XML e ciascuno di essi definisce il proprio namespace XML.
XCCDF
XCCDF (Extensible Configuration Checklist Description Format) è il linguaggio utilizzato per descrivere le checklist di sicurezza. Il linguaggio è progettato per supportare lo scambio di informazioni, la generazione di documenti, l’adattamento organizzativo e situazionale, i test di conformità automatizzati e l’assegnazione di un punteggio di conformità.
Il linguaggio non contiene alcun comando per eseguire l’analisi ed è principalmente descrittivo. Altri documenti di componenti (OVAL e script SCE) possono essere referenziati a partire dal documento XCCDF.
OVAL
OVAL (Open Vulnerability and Assessment Language) è un linguaggio dichiarativo per formulare asserzioni logiche sullo stato del sistema. Viene utilizzato per descrivere le vulnerabilità di sicurezza o la configurazione desiderata dei sistemi. Le definizioni OVAL definiscono uno stato sicuro di determinati oggetti in un computer, ad esempio i file di configurazione, le autorizzazioni dei file, i processi. Le definizioni OVAL vengono valutate tramite un interprete chiamato scanner.
I concetti principali del documento OVAL sono le definizioni, i test, gli oggetti e gli stati. Ogni definizione specifica i test che devono essere soddisfatti. Un test collega un oggetto a uno stato. Il test ha esito positivo quando una risorsa designata da un oggetto dato soddisfa i requisiti di uno stato corrispondente.
SCE
SCE (Script Check Engine) è un’estensione che consente l’esecuzione di script (scritti ad esempio in Bash, PowerShell, …) a partire dalla policy SCAP. Consente di rendere i propri script interoperabili con la propria policy di sicurezza.
DataStream
DataStream è un formato che consente di raggruppare in un unico file XML i diversi componenti SCAP del benchmark, nel nostro caso: XCCDF e OVAL.
CPE
Il CPE (Common Platform Enumeration) serve a identificare le piattaforme e i sistemi informatici mediante nomi definiti in modo univoco.