Gitlab 之 SAST

1. 简介

Static Application Security Testing,静态应用程序安全测试,就是扫描一下你的源代码有没有已知的安全漏洞。

2. 接入要求

  1. 首先你得用了gitlab的cicd;
  2. gitlab runner 的executor得是docker 或者 k8s;
  3. 必须有 test 的 stage

3. 接入

# 扫描漏洞的镜像由于国内下载可能会有问题,最好提前放到自己的仓库里面去
variables:
  SECURE_ANALYZERS_PREFIX: "www.whyfate.com/analyzers/security-products"
sast:
  stage: test
  tags:
    - builder
# 直接将gitlab提供的模板包含进去即可
include:
- template: Security/SAST.gitlab-ci.yml

用到的镜像

registry.gitlab.com/security-products/brakeman:3
registry.gitlab.com/security-products/flawfinder:3
registry.gitlab.com/security-products/kubesec:3
registry.gitlab.com/security-products/nodejs-scan:3
registry.gitlab.com/security-products/phpcs-security-audit:3
registry.gitlab.com/security-products/pmd-apex:3
# .net 用到的镜像
registry.gitlab.com/security-products/security-code-scan:3
registry.gitlab.com/security-products/semgrep:3
registry.gitlab.com/security-products/sobelow:3
registry.gitlab.com/security-products/spotbugs:3

4. 使用体验

首先暂不支持.net7,其次全给我扫描一些CSRF漏洞,我真的栓Q,gitlab ce不支持在线查看,只能下载report.json,但是够用。
总的来说有用,但是不完全有用。

Gitlab SAST 官方文档

posted @ 2023-01-04 23:42  whyfate  阅读(482)  评论(0编辑  收藏  举报