Message ID | a5a1dcb03e18f3b9f3fd77ef94c17a05763a5f13.1654635432.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | config: introduce discovery.bare and protected config | expand |
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes: > From: Glen Choo <chooglen@google.com> > > For security reasons, there are config variables that are only trusted > when they are specified in extra-trustworthy configuration scopes, which Probably better to delete "extra-trustworthy", or at least "extra-" - it's better to explain why and how they're trustworthy, which you have already done in the commit message. > diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt > index 5e4c95f2423..2b4334faec9 100644 > --- a/Documentation/git-config.txt > +++ b/Documentation/git-config.txt [snip] > +Protected config refers to the 'system', 'global', and 'command' scopes. Git > +considers these scopes to be especially trustworthy because they are likely > +to be controlled by the user or a trusted administrator. An attacker who > +controls these scopes can do substantial harm without using Git, so it is > +assumed that the user's environment protects these scopes against attackers. > + > +For security reasons, certain options are only respected when they are > +specified in protected config, and ignored otherwise. Also "especially trustworthy" here.
Jonathan Tan <jonathantanmy@google.com> writes: > "Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes: >> From: Glen Choo <chooglen@google.com> >> >> For security reasons, there are config variables that are only trusted >> when they are specified in extra-trustworthy configuration scopes, which > > Probably better to delete "extra-trustworthy", or at least "extra-" - > it's better to explain why and how they're trustworthy, which you have > already done in the commit message. Hm, do you find it superfluous, misleading or something else entirely? The use of "extra-" was quite intentional. I'm afraid that if we describe protected config as "trustworthy", we insinuate that local/worktree config is "untrustworthy" (but of course this isn't always true, Git usually uses repo config.) >> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt >> index 5e4c95f2423..2b4334faec9 100644 >> --- a/Documentation/git-config.txt >> +++ b/Documentation/git-config.txt > > [snip] > >> +Protected config refers to the 'system', 'global', and 'command' scopes. Git >> +considers these scopes to be especially trustworthy because they are likely >> +to be controlled by the user or a trusted administrator. An attacker who >> +controls these scopes can do substantial harm without using Git, so it is >> +assumed that the user's environment protects these scopes against attackers. >> + >> +For security reasons, certain options are only respected when they are >> +specified in protected config, and ignored otherwise. > > Also "especially trustworthy" here.
diff --git a/Documentation/config/uploadpack.txt b/Documentation/config/uploadpack.txt index 32fad5bbe81..029abbefdff 100644 --- a/Documentation/config/uploadpack.txt +++ b/Documentation/config/uploadpack.txt @@ -49,9 +49,9 @@ uploadpack.packObjectsHook:: `pack-objects` to the hook, and expects a completed packfile on stdout. + -Note that this configuration variable is ignored if it is seen in the -repository-level config (this is a safety measure against fetching from -untrusted repositories). +Note that this configuration variable is only respected when it is specified +in protected config (see <<SCOPES>>). This is a safety measure against +fetching from untrusted repositories. uploadpack.allowFilter:: If this option is set, `upload-pack` will support partial diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 5e4c95f2423..2b4334faec9 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -343,6 +343,7 @@ You can change the way options are read/written by specifying the path to a file (`--file`), or by specifying a configuration scope (`--system`, `--global`, `--local`, `--worktree`); see <<OPTIONS>> above. +[[SCOPES]] SCOPES ------ @@ -380,6 +381,18 @@ Most configuration options are respected regardless of the scope it is defined in, but some options are only respected in certain scopes. See the option's documentation for the full details. +Protected config +~~~~~~~~~~~~~~~~ + +Protected config refers to the 'system', 'global', and 'command' scopes. Git +considers these scopes to be especially trustworthy because they are likely +to be controlled by the user or a trusted administrator. An attacker who +controls these scopes can do substantial harm without using Git, so it is +assumed that the user's environment protects these scopes against attackers. + +For security reasons, certain options are only respected when they are +specified in protected config, and ignored otherwise. + ENVIRONMENT -----------