Add Git configuration command execution rules - #6218
Open
signalblur wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Two
process_creationrule families for Git configuration that names a program Git then runs. No existing rule references any of these keys or options.Shell Command in Git Configuration Value (
high) matches a configuration key set on the command line to a value that invokes a shell or an interpreter. Git executes the values ofcore.pager,core.fsmonitor,core.editor,core.sshCommand,core.alternateRefsCommand,diff.external,sequence.editor,pager.<cmd>andfilter.<name>.cleanduring ordinary operations, and treats acredential.helperoralias.<name>value beginning with!as a shell snippet.Git Pack or Proxy Program Override (
medium) matches--upload-pack,--receive-pack, theremote.<name>.uploadpackandremote.<name>.receivepackconfiguration equivalents,uploadpack.packObjectsHookandcore.gitProxy. Against a local path these run on the host issuing the command.Every primitive listed was confirmed executing on git 2.52.0 before it was included, with the single exception noted at the end. Matching command lines:
Not matched:
git -c core.pager=cat log,git -c core.editor=vim commit,git -c core.fsmonitor=true status,git config credential.helper osxkeychain,git -c filter.lfs.clean='git-lfs clean -- %f' add ., andgit config --global alias.lg '!git log --graph'— the common shell alias, which carries no=before the!.The Windows rule adds the quoted spellings, because Windows records the command line as one string and keeps the quoting the other two platforms strip. It also keeps the Unix interpreter forms, since Git for Windows ships a POSIX shell.
uploadpack.packObjectsHookis the one keyword included on documentation rather than on a local observation. git-config(1) states that whenupload-packwould rungit pack-objects, "it will run this shell command instead", and that the key "is only respected when it is specified in protected configuration" — the scope that covers the-cform this rule matches. It is a server-side key, and I could not drive it from a client-side test here, so I am flagging it rather than implying it was measured like the rest.Changelog
new: Shell Command in Git Configuration Value - Linux
new: Shell Command in Git Configuration Value - MacOS
new: Shell Command in Git Configuration Value - Windows
new: Git Pack or Proxy Program Override - Linux
new: Git Pack or Proxy Program Override - MacOS
new: Git Pack or Proxy Program Override - Windows
Example Log Event
Fixed Issues
SigmaHQ Rule Creation Conventions