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

网站seo优化费用百度电脑版网页版

网站seo优化费用,百度电脑版网页版,怎么做网站和注册域名,wordpress管理面板关于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.yayakq.cn/news/314735/

相关文章:

  • 职高门户网站建设标准成都网站建设scjsc888
  • 怎么做一个门户网站电子商务网站与建设课件
  • 电商网站建设技术可行性分析企业如何做好网络营销
  • 网站建设图片怎么加水印修改网站主目录的位置
  • 怎么用阿里云建设网站策划公司英文
  • 药企网站怎么做个人网站做公司网站
  • 提供网站制作公司深圳网站设计深圳设计公司
  • 常州市网站建设wordpress和dedecms哪个好
  • 大学做机器人比赛的网站论坛创建网站需要什么条件
  • 关于建立网站的申请青岛网站开发培训
  • 做网站建立数据库最大的设计公司
  • wordpress如何删除永久链接杭州江干区抖音seo哪里有
  • 站长统计app官方网站手机排行榜2021前十名最新性价比
  • 信息网站建设的意义西安百度代运营
  • 林和西网站建设用python做网站怎么赚钱
  • 国际摄影作品网站seo具体是什么
  • 嘉定网站公司好人一生平安网站哪个好
  • 用vs做购物网站代码wordpress首页不显示图片
  • 上海网站建设哪什么是网站功能需求
  • 百度网站说明书仿360电影网站源码
  • 在线看网站源码wordpress 配置说明
  • 生活分类网站建设怎么开自己的网站
  • 加盟企业网站建设目的乐清网站制作电话
  • 家具外贸网站it外包公司招聘
  • 杭州拱墅区网站建设南宁市住房和城乡建设局网站
  • 网站建设资讯站手机百度2020
  • 光谷做网站推广哪家好龙岩网站建设亿网行
  • 网站怎么做背景不变页面滑动外卖网站建设的策划方案
  • 四川有什么好的网站建设公司优化大师的功能有哪些
  • 类qq留言网站建设表格在网站后台是居中可到前台为什么不居中