---
# System prepended metadata

title: SUSE Linux Openscap scan
tags: [work]

---

# SUSE Linux OpenSCAP scan

## 安裝套件
```
# 在要 scan 的機器上安裝套件
$ sudo zypper in -y openscap-utils scap-security-guide
```

## 透過 OSCAP 掃描 SUSE Linux Enterprise system

```
$ sudo oscap xccdf eval \
    --profile stig \
    --results /tmp/results.xml \
    --report /tmp/report.html \
    /usr/share/xml/scap/ssg/content/ssg-sle15-ds-1.2.xml
```
* 將 report.html 檔案匯出可以在瀏覽器觀看
```
$ ls -l /tmp
-rw-r--r-- 1 root root  6223971 May 30 12:43 report.html
-rw-r--r-- 1 root root 11235997 May 30 12:43 results.xml
```

![image](https://hackmd.io/_uploads/BJJLVFSN0.png)

## 透過 suma 掃描

* 安裝套件
```
$ sudo zypper in -y openscap-utils scap-security-guide
```
![image](https://hackmd.io/_uploads/S1x-rtBNC.png)

* 確認套件已安裝
```
$ sudo zypper info openscap-utils scap-security-guide
```
![image](https://hackmd.io/_uploads/rkzSSFSN0.png)


* 在要 scan 的機器上設以下指令

```
--profile xccdf_org.ssgproject.content_profile_stig
```
```
/usr/share/xml/scap/ssg/content/ssg-sle15-ds-1.2.xml
```

![image](https://hackmd.io/_uploads/r1s_r9HEC.png)

* 查看報表

![image](https://hackmd.io/_uploads/HyZG1CrER.png)

![image](https://hackmd.io/_uploads/SJZNkAB4A.png)

## 參考文件
https://documentation.suse.com/suma/4.3/en/suse-manager/administration/openscap.html#_prepare_clients_for_an_scap_scan