LoginSignup
3
1

More than 1 year has passed since last update.

kicsでInfrastructure-as-Codeの静的解析をしよう

Last updated at Posted at 2021-11-21

kicsとは

Infrastructure-as-CodeのためのOSSアナライザー
セキュリティの脆弱性、コンプライアンスの問題、およびインフラストラクチャの構成ミスを
早期に検知することができる

kicsを使用するメリット

  • デプロイなしでチェック可能
  • 人間によるレビューよりも短い時間でチェック可能
  • 高度な知識を持つレビュアーがいなくてもチェック可能

使用方法

config構成

  • CLI、CI(GitLab)いずれの場合でも共通
kics.config.yaml
path: scan
verbose: true
log-file: true
output-path: "results"
report-formats:
  - html
  - sarif
  - glsast

実行方法

CLIの場合

  • 下記URLからダウンロード、パスを通す

kics scan  --config kics.config.yaml

CI(GitLab)の場合

  • GitLab、GitLab-runnerの構成方法は省略
  • 下記のようにCIを構成する
.gitlab-ci.yml
kics-scan:
  image: 
    name: checkmarx/kics:latest
    entrypoint: [""]
  script:
    - kics scan --config kics.config.yaml
  artifacts:
    paths:
      - results
    reports:
      sast: results/gl-sast-results.json
    when: always

レポート

html

image.png

sarif

  • VSCode拡張で参照可能

image.png

image.png

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1