豆包ko 发表于 2018-9-21 08:52:40

运维从入门到放弃

  https://vuls.io/
  一. 安装
  系统管理员有责任定期去检查系统的弱点和更新软件, vuls 可以提供如下功能:


[*]通知管理员机器有安全隐患
[*]支持本地和远程扫描(需要有 ssh 权限)
[*]可以定期去同步最新的安全数据库

  参照官方说明在 centos 安装就可以了, 这个软件是 golang 写的所以先安装 golang
  https://vuls.io/docs/en/install-manually-centos.html
  为了使我们编译的程序可以不依赖具体的系统库文件,我们使用静态编译,这样就能在 centos6和 centos7运行了
  

GOOS=linux GOARCH=amd64 go build -a -ldflags '-linkmode external -extldflags -static' -o vuls  
GOOS
=linux GOARCH=amd64 go build -a -ldflags '-linkmode external -extldflags -static' -o go-cve-dictionary  
GOOS
=linux GOARCH=amd64 go build -a -ldflags '-linkmode external -extldflags -static' -o goval-dictionary  

  vulsrepo 是一个 web ui用来更清楚的展示扫描的结果,推荐使用 https://vuls.io/docs/en/vulsrepo.html
  二. 使用
  

go-cve-dictionary和goval-dictionary 这两个程序是下载 cve 和 oval 漏洞库用的  在安装 vulsrepo 的文档中有个配置 如下
  

  

$ vi vulsrepo-config.toml  

  
rootPath
= "/home/vuls-user/vulsrepo"  
resultsPath
= "/opt/vuls/results"    你需要把你扫描的结果放到这个目录下,方便起见我们直接去这个目录扫描,把那两个数据库也下载到这个位置  
serverPort
= "5111"  

  开始下载数据库
  

cd /opt/vuls/results  

  

for i in `seq 2002 $(date +"%Y")`; do go-cve-dictionary fetchnvd -years $i; done  

  
goval
-dictionary fetch-redhat 7   #如果系统是6 这里改成6  

  开始扫描
  

vuls scan  
vuls report
-format-json   

  扫描完以后的目录结构如下
  

# tree . -L 2  
.
  
├── config.toml
  
├── cve.sqlite3
  
├── cve.sqlite3
-shm  
├── cve.sqlite3
-wal  
├── oval.sqlite3
  
└── results
  
├──
2018-06-07T17:30:03+08:00  
└──
2018-06-08T12:03:05+08:00  

  
[root@kube
-node-01 report]# pwd  
/data/app/vulsrepo/report
  

  这时候打开浏览器 http://your_ip:5111



页: [1]
查看完整版本: 运维从入门到放弃