Skip to content

feat: 利用Github Action进行代码安全扫描,并生成报告#288

Open
nap0o wants to merge 1 commit intomaillab:mainfrom
nap0o:main
Open

feat: 利用Github Action进行代码安全扫描,并生成报告#288
nap0o wants to merge 1 commit intomaillab:mainfrom
nap0o:main

Conversation

@nap0o
Copy link
Copy Markdown

@nap0o nap0o commented Mar 10, 2026

PR功能介绍

用github action在每次push时自动扫描代码安全漏洞,生成报告并推送到孤儿分支security-audit

检测结果示例
https://github.com/nap0o/cloud-mail/tree/security-audit

代码安全检测项

  • 用Gitleaks检测检查代码中的敏感信息
  • 用CodeQL静态代码安全分析
  • 用Trivy检测Dockerfile容器配置安全,没有Dockerfile则跳过
  • 用Snyk检查依赖包漏洞

配置秘钥
在项目settings -> Actions secrets and variables -> action 配置2个秘钥

秘钥名称
SECURITY_SNYK_TOKEN snyk获取秘钥
SECURITY_PACKAGE mail-vue,mail-worker

ps:我在折腾一个2FA的项目 2FAuth Worker ,顺手写了这个检测脚本,向大佬学习。

@eoao eoao force-pushed the main branch 4 times, most recently from 83cce4e to 6ce918e Compare March 21, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant