From: Victor Duprez <duprezvictor4@gmail.com>
To: git@vger.kernel.org
Subject: [RFC] git-secure: add explicit authentication before push or clone
Date: Sat, 26 Jul 2025 17:45:28 +0200 [thread overview]
Message-ID: <1753544728-979474@smtp-cli> (raw)
Subject: [RFC] git-secure: add explicit authentication before push or clone
To: git@vger.kernel.org
From: Victor Duprez <duprezvictor4@gmail.com>
Hello Git community,
I would like to propose a new Git feature: a command called git-secure that prompts the user for authentication before executing sensitive Git operations such as git push or git clone.
Motivation:
Today, Git operations like push or clone can be executed as long as credentials (tokens or SSH keys) are available in the environment. While this is efficient, it presents some security risks:
- Users may inadvertently push changes without noticing.
- Machines may store tokens or SSH keys in accessible locations.
- In the case of theft or shared systems, these credentials could be silently misused.
Proposal:
Introduce a git-secure command (or option) that prompts the user interactively for either:
- A GitHub personal access token
- A simple password generated by a secure third-party password manager (optionally linked via API)
This token or password would be used only once, then securely discarded from memory and disk. It would provide an optional extra layer of control and security over Git operations, especially when working in untrusted environments.
Prototype:
A working prototype script is available here:
https://github.com/VictorNafs/git-secure-hub
Example usage:
$ ./git-secure.sh
Enter your GitHub token or generated password:
GitHub username:
Operation (push/clone):
Thank you for your time and feedback.
next reply other threads:[~2025-07-26 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-26 15:45 Victor Duprez [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-26 15:46 [RFC] git-secure: add explicit authentication before push or clone Victor Duprez
2025-07-26 15:35 Victor Duprez
2025-07-26 15:23 Victor Duprez
2025-07-26 15:16 Victor Duprez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1753544728-979474@smtp-cli \
--to=duprezvictor4@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).