Vuls運用を始めたのですが、(devとかstgから)
定期実行は週3の朝に実行しようと決めました。
毎日とかさすがにslackうるさいので(白目)
→結局月~金にしました
※前回のブログ
■cron(例)
| 1 2 3 4 5 6 7 8 9 10 11 | # crontab -l #vuls dictionary update 00 6 * * * sudo -u vuls /home/vuls/go/bin/go-cve-dictionary fetchnvd -last2y -dbpath=/home/vuls/cve.sqlite3 00 9 * * * sudo -u vuls /home/vuls/go/bin/go-cve-dictionary fetchjvn -latest -dbpath=/home/vuls/cve.sqlite3 #vuls scan/report 00 10 * * 1,2,3,4,5 sudo -u vuls /home/vuls/go/bin/vuls scan -config=/home/vuls/config.toml -results-dir=/home/vuls/results -cachedb-path=/home/vuls/cache.db 20 10 * * 1,2,3,4,5 sudo -u vuls /home/vuls/go/bin/vuls report -cvedb-path=/home/vuls/cve.sqlite3 -ovaldb-path=/home/vuls/oval.sqlite3 -config=/home/vuls/config.toml -results-dir=/home/vuls/results -format-short-text -format-json -to-slack -lang=ja -cvss-over=7 #vuls results remove 00 5 * * * sudo find /home/vuls/results/ -mtime +5 -exec rm -f {} \; | 
・vuls dictionary update
毎日脆弱性情報の更新をしないとアカンので、
「過去2年間の最新情報を取得」+「最新の日本語脆弱性辞書を更新」
するように入れています。
・vuls scan
cvssスコア7以上のものはslackとメールで飛ばしてます。(潰すのが辛いためw重要なのだけ!)
・結果
朝に・・・・
ひゃあああ(汗)
・fluentd/td-agent.conf
| 1 2 | $ td-agent --version td-agent 0.12.40 | 
こんなかんじでfluentdを設定すればresults配下のログをvuls report時にS3に投げてくれる。
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <source>   @type tail   format none   path /home/vuls/results/current/*_short.txt   pos_file /var/log/td-agent/vuls.access.log.pos   tag s3.vuls.access   time_format %d/%b/%Y:%H:%M:%S %z </source> <match s3.*.*>   type s3   aws_key_id XXXXXXXXXXXXXXXX   aws_sec_key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   s3_bucket vuls-results-adachinnnnn   s3_region ap-northeast-1   path results/   buffer_path /var/log/td-agent/s3   timestamp_key_format %Y%m%d/%Y%m%d-%H%M   time_slice_format %Y%m%d%H   time_slice_wait 10m   utc   flush_interval 1m   buffer_chunk_limit 256m   format json </match> | 
■まとめ
confファイルはansible化で!

 
													 
													 
													
0件のコメント