-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Avoid exposing password and token from git repositories #105220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Restrict the URL that is exposed to the official LLVM repository at Github in order to avoid exposing usernames, passwords or even private URLS unintentionally. Users willing to expose different Git repositories can continue to do so by setting LLVM_FORCE_VC_REPOSITORY or CLANG_REPOSITORY_STRING.
I added @tstellar and @petrhosek as reviewers. Would one of you be able to help review this? Or do you otherwise have suggestions for who would be good to review this PR? |
While I understand the concern, I'm a bit concerned that this could be undesirable to many vendors and there should be an RFC to raise the awareness and get more feedback. If we decide to go forward with this change, I also think there should be a CMake option controlling this behavior rather than relying on |
Currently the output of dexter --version contains the raw output of `git remote get-url origin`, which may contain a username and password. This patch adds a small change to remove these from the output string. A similar patch for LLVM's default version string[0] also removes the git URL altogether unless opted-in to; it's not clear whether this is a necessary or desirable step yet, but if so we can trivially remove the URL from Dexter as well. [0]: llvm#105220
…105533) Currently the output of dexter --version contains the raw output of `git remote get-url origin`, which may contain a username and password. This patch adds a small change to remove these from the output string. A similar patch for LLVM's default version string* also removes the git URL altogether unless opted-in to; it's not clear whether this is a necessary or desirable step yet, but if so we can trivially remove the URL from Dexter as well. *PR here: #105220
…lvm#105533) Currently the output of dexter --version contains the raw output of `git remote get-url origin`, which may contain a username and password. This patch adds a small change to remove these from the output string. A similar patch for LLVM's default version string* also removes the git URL altogether unless opted-in to; it's not clear whether this is a necessary or desirable step yet, but if so we can trivially remove the URL from Dexter as well. *PR here: llvm#105220
@petrhosek I've just created the RFC at https://discourse.llvm.org/t/rfc-avoid-exposing-unknown-git-repositories/80962
Could you please share your proposal in the Discourse topic, please? |
LGTM, but please get more approvals. |
I updated this PR based on the feedback received on Discourse. Title and description have been updated accordingly. |
As mentioned in the Forum, the discussion on this has been going down. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/1129 Here is the relevant piece of the build log for the reference
|
Adding #undef LLVM_REVISION
#define LLVM_REPOSITORY "test" Considering |
@danilaml could you elaborate, please? What kind of friction was created by the merged commit? |
@tuliom the error is triggered in certain configs/machines we use but
|
@danilaml I'm afraid I still don't fully understand the impact you're seeing, but let me try to suggest a solution anyway: do you think that setting |
@tuliom setting them both (or just LLVM_FORCE_VC_REVISION) means we'd have to manually duplicate the logic the old cmake was already doing to get the revision (and hope it matches whatever is used on other machines). |
Try to detect if the git remote URL has a password or a Github token and
return an error teaching the user how to avoid leaking their password or
token.