当前位置: 首页 > news >正文

顺德做pc端网站厦门seo优化

顺德做pc端网站,厦门seo优化,武汉百度做网站,服装公司logo设计关于Git-Secrets Git-secrets是一款功能强大的开发安全工具,该工具可以防止开发人员意外将密码和其他敏感信息上传到Git库中。 Git-secrets首先会扫描提交的代码和说明,当与用户预先配置的正则表达式模式匹配时,便会阻止此次提交。该工具的优…

关于Git-Secrets

Git-secrets是一款功能强大的开发安全工具,该工具可以防止开发人员意外将密码和其他敏感信息上传到Git库中。

Git-secrets首先会扫描提交的代码和说明,当与用户预先配置的正则表达式模式匹配时,便会阻止此次提交。该工具的优势在于可以集成到CI/CD管道中以实时监控提交信息,但不足之处在于,该工具主要基于正则表达式实现其检测功能,因此可能会有一定程度的误报。

工具安装

广大研究人员可以使用下列命令将该项目源码克隆至本地:

git clone https://github.com/awslabs/git-secrets.git

然后切换到项目目录中,根据对应的操作系统执行不同的安装命令:

cd git-secrets

*nix(Linux/macOS)

make install

Windows

PS > ./install.ps1

Homebrew安装

brew install git-secrets

工具使用命令

git secrets --scan [-r|--recursive] [--cached] [--no-index] [--untracked] [<files>...]git secrets --scan-historygit secrets --install [-f|--force] [<target-directory>]git secrets --list [--global]git secrets --add [-a|--allowed] [-l|--literal] [--global] <pattern>git secrets --add-provider [--global] <command> [arguments...]git secrets --register-aws [--global]git secrets --aws-provider [<credentials-file>]

--scan命令

扫描代码库中所有文件:

git secrets --scan

扫描单个文件:

git secrets --scan /path/to/file

递归扫描目录:

git secrets --scan -r /path/to/directory

扫描多个文件:

git secrets --scan /path/to/file /path/to/other/file

全局扫描:

git secrets --scan /path/to/directory/*

从stdin扫描:

echo 'hello!' | git secrets --scan -

--add命令

向当前代码库添加禁止的正则模式:

git secrets --add '[A-Z0-9]{20}'

向全局git配置添加禁止的正则模式:

git secrets --add --global '[A-Z0-9]{20}'

添加一个逐字扫描的字符串(+字符会被转义):

git secrets --add --literal 'foo+bar'

添加允许的正则模式:

git secrets --add -a 'allowed pattern'

工具使用样例

假设我们给定下列主题的文本信息(存储在/tmp/example中):

This is a test!password=ex@mplepasswordpassword=******More test...

并注册以下正则检测模式:

git secrets --add 'password\s*=\s*.+'git secrets --add --allowed --literal 'ex@mplepassword'

运行下列命令:

git secrets --scan /tmp/example

执行后工具会输出下列错误信息:

/tmp/example:3:password=******[ERROR] Matched prohibited patternPossible mitigations:- Mark false positives as allowed using: git config --add secrets.allowed ...- List your configured patterns: git config --get-all secrets.patterns- List your configured allowed patterns: git config --get-all secrets.allowed- Use --no-verify if this is a one-time false positive

上述正则表达式模式“password\s*=\s*.+”将匹配下列内容:

/tmp/example:2:password=ex@mplepassword/tmp/example:3:password=******

不过,第一行password会被忽略,因为它匹配第一个允许通过的正则表达式“'ex@mplepassword'”。

我们还可以使用下列命令将整个文件列入白名单中:

git secrets --add --allowed '/tmp/example:.*'git secrets --scan /tmp/example && echo $?# Outputs: 0

或者指定某个文件的指定行代码列入白名单:

git secrets --add --allowed '/tmp/example:3:.*'git secrets --scan /tmp/example && echo $?# Outputs: 0

许可证协议

本项目的开发与发布遵循Apache-2.0开源许可证协议。

项目地址

Git-Secrets:【GitHub传送门】

http://www.mmbaike.com/news/30760.html

相关文章:

  • 做盘石信用认证网站网络广告策划案例
  • 2018年淘宝客网站怎么做中山网站建设
  • 一开始用php做网站seo入门培训
  • 教你做cpa单页网站百度软件应用中心
  • 电影网站如何优化用网站模板建站
  • 西安建设厅官方网站爱站官网
  • 顺义深圳网站建设公司seo服务公司怎么收费
  • iis php服务器搭建网站百度新闻网
  • 做消费金融网站关键词语有哪些
  • 网站文件保护怎么做百度百科官网
  • 无锡 网站 seo 优化微信朋友圈广告推广
  • 做网站banner课程封面网络营销怎么做
  • 百度怎么做网站广告深圳优化seo
  • 现在还有没有做任务的网站百度seo课程
  • 贝贝网网站开发背景最近大事件新闻
  • 阿里国际网站做免费有用吗重庆seo网站推广费用
  • 网站做京东联盟360seo关键词优化
  • asp网站下载免费友情链接
  • 网站建设有哪些步骤百度权重什么意思
  • 怎么改一个网站的关键词密度排行榜123网
  • 罗湖网站建设哪家好互联网运营自学课程
  • 做网站的费用营销自动化
  • 大连建站系统模板seo网站推广的主要目的
  • 国外家谱网站的建设加盟教育培训机构
  • 公司制作网站怎么做建立营销型网站
  • 怎么在手机上做企业网站如何制作网页链接
  • 什么网站做生鲜比较好互联网营销顾问
  • 电子工厂网站建设站长之家域名信息查询
  • 网站制作应该注意到的问题如何进行网站的宣传和推广
  • 动漫风格网站seo综合