Class: Rules::GitConfigGlobal
- Defined in:
- lib/rules/git_config_global.rb
Instance Method Summary collapse
Instance Method Details
#check(workflow) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rules/git_config_global.rb', line 7 def check(workflow) findings = [] workflow.lines_of(/git config --global/).each do |line_num| line = workflow.line_content(line_num) next unless line&.match?(/insteadOf|url\.|credential/) findings << finding(workflow, line: line_num, code: line.strip, message: "git config --global writes credentials to ~/.gitconfig — accessible to all subsequent git operations", fix: "Use --local instead of --global to scope to the repo clone" ) end findings end |
#description ⇒ Object
4 |
# File 'lib/rules/git_config_global.rb', line 4 def description = "git config --global persists credentials beyond the repo clone" |
#name ⇒ Object
3 |
# File 'lib/rules/git_config_global.rb', line 3 def name = "git-config-global" |
#severity ⇒ Object
5 |
# File 'lib/rules/git_config_global.rb', line 5 def severity = :medium |