avatarTeri Radichel

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3912

Abstract

overflow.com/questions/68775869/message-support-for-password-authentication-was-removed"> <div> <div> <h2>Message "Support for password authentication was removed."</h2> <div><h3>I got this error on my console when I tried to use git pull: remote: Support for password authentication was removed on…</h3></div> <div><p>stackoverflow.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*4CcZbDM3Wj5b4XXH)"></div> </div> </div> </a> </div><p id="3a83"><b><i>I can’t create a personal access token on AWS.</i></b></p><p id="9332">I can only create a user name and password.</p><p id="18f3">I tried passing a password in the header instead, with the username in the URL just to see if it would work. No.</p><p id="3636">I’m getting a 403 error.</p><p id="fd86">As noted already this was not my first choice an I don’t like it but I could not get the AWS CodeCommit authentication via a role working in the Lambda function.</p><p id="9c62">So then I resorted to the username and password in the URL which I really, really don’t like.</p><p id="8bf9">This error message demonstrates exactly why I don’t like this method:</p><blockquote id="9f63"><p>Cloning into bare repository ‘dev.rainierrhododendrons.com’… fatal: unable to access ‘<a href="https://WebAdmin-at-464339214996:CA84GWEnWgTJIIiTO+CxzP1/7/OSC+n+8ISTiT+ZmDY=<a href=">@git</a>-codecommit.us-east-2.amazonaws.com/v1/repos/dev.rainierrhododendrons.com/’”>https://<b>[USERNAME]:[PASSWORD]<a href="http://twitter.com/git"></a></b><a href="http://twitter.com/git">@git</a>-codecommit.us-east-2.amazonaws.com/v1/repos/dev.rainierrhododendrons.com/': URL rejected: Port number was not a decimal number between 0 and 65535.</p></blockquote><p id="ba7e">Note that the error above will gladly print out the username and password, not to mention it doesn’t work. Gross.</p><p id="1086">I was using the methods described in this post that work with git.</p><div id="7b8c" class="link-block"> <a href="https://readmedium.com/getting-git-credentials-out-of-the-url-f953a61286aa"> <div> <div> <h2>Getting Git Credentials Out of the URL</h2> <div><h3>ACM.327 Attempting to use Git Credential Helper cache option in Lambda not working —an alternate solution</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*VdgaocZuW8jJ2Onv8LHbtw.png)"></div> </div> </div> </a> </div><p id="5707">Let’s see what other options we have.</p><p id="bfa2">The documentation is sending me here —</p><div id="b436" class="link-block"> <a href="https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage"> <div> <div> <h2>Git - Credential Storage</h2> <div><h3>The "store" mode saves the credentials to a plain-text file on disk, and they never expire. This means that until you…</h3></div> <div><p>git-scm.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*rSxYEBGfJYRkVaMK)"></div> </div> </div> </a> </div><p id="b542">Hardcoded credentials. Great.</p><p id="94b6">I try running this command:</p><div id="620c"><pre>git config <span class="hljs-attr">--global</span> user<span class="hljs-selector-class">.name</span> <span class="hljs-variable">$ghuser</span></pre></div><p id="9207">Fatal. Not in a git directory. Well I can’t be in a git directory until I clone the repo and I can

Options

’t clone the repo without credentials, and I’m trying to clone bare so I don’t get the git files when I clone. Big, circular, catch-22.</p><p id="373a">Anyway,<b><i> this is all just wrong</i></b>…and I finally found the documentation for how to configure my solution without using hardcoded credentials which I never wanted to do in the first place.</p><p id="a46f">TG I found a different solution by way of a blog post that led me to the AWS instructions listed under a somewhat obscure and overly wordy name that I didn’t initially recognize as being what I was looking for…phew. Found it.</p><p id="b914">Thank you to this blogger for giving me a clue. However, I don’t think this is exactly the correct approach.</p><div id="60ed" class="link-block"> <a href="https://msimpson.co.nz/Github-CodeCommit/"> <div> <div> <h2>How to clone Github repos to CodeCommit using Lambda</h2> <div><h3>Backup your backups I've always had backups of my stuff, first it was photos on multiple hard drives in different…</h3></div> <div><p>msimpson.co.nz</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*skh7QsUQle7oW78M)"></div> </div> </div> </a> </div><p id="fbb5">I am working on a solution that I will write about shortly for proper use of the above method without changing the home directory. See my next post.</p><p id="1132">Bottom line: Don’t use user names and passwords and these solutions didn’t work anyway!</p><p id="2623">I’ll add a link to the solution here after I publish it.</p><div id="963f" class="link-block"> <a href="https://readmedium.com/git-and-github-security-8728bef0a057"> <div> <div> <h2>Git and GitHub Security</h2> <div><h3>Stories about securing git, GitHub, and your code</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*LQ5l21ueAnPOGOnhukzTCQ.png)"></div> </div> </div> </a> </div><p id="4ac7">Follow for updates.</p><p id="4a3a">Teri Radichel | <i>© <a href="https://2ndsightlab.com/?source=post_page---------------------------">2nd Sight Lab</a> 2023</i></p><div id="8b5f"><pre><span class="hljs-section">About Teri Radichel:

⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab</pre></div><div id="caae"><pre><span class="hljs-section">Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span>
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation</pre></div><div id="5a42"><pre>Follow <span class="hljs-keyword">for</span> more stories like <span class="hljs-keyword">this</span>:

❤️ Sign Up my Medium Email List ❤️ Twitter: <span class="hljs-meta">@teriradichel</span> ❤️ LinkedIn: https:<span class="hljs-comment">//www.linkedin.com/in/teriradichel</span> ❤️ Mastodon: <span class="hljs-meta">@teriradichel</span><span class="hljs-meta">@infosec</span>.exchange ❤️ Facebook: 2nd Sight Lab ❤️ YouTube: @2ndsightlab</pre></div><figure id="7286"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*4oxP4LXk8l8c3mpRvO7ejg.png"><figcaption></figcaption></figure></article></body>

Cannot Pass Tokens in Headers With AWS CodeCommit

From one problem to the next…struggling to get this working in Lambda

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️ Check out my series on Automating Cybersecurity Metrics | Code.

🔒 Related Stories: Bugs | AWS Security | Secure Code

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

One of my stories on Git Security and AWS CodeCommit Security.

I don’t know if I was just doing something wrong but I could not get a simple git clone working in Lambda for AWS CodeCommit as documented here:

So I thought, oh fine. I’ll just use git credentials and pass an authorization header. I already did that in this post where I showed how to get your credentials out of a URL when using GitHub.

But what I forgot was that I was using GitHub — not AWS CodeCommit for that example.

What I also forgot is that I was using a personal access token. GitHub no longer allows account passwords for these types of operations.

I can’t create a personal access token on AWS.

I can only create a user name and password.

I tried passing a password in the header instead, with the username in the URL just to see if it would work. No.

I’m getting a 403 error.

As noted already this was not my first choice an I don’t like it but I could not get the AWS CodeCommit authentication via a role working in the Lambda function.

So then I resorted to the username and password in the URL which I really, really don’t like.

This error message demonstrates exactly why I don’t like this method:

Cloning into bare repository ‘dev.rainierrhododendrons.com’… fatal: unable to access ‘@git-codecommit.us-east-2.amazonaws.com/v1/repos/dev.rainierrhododendrons.com/’”>https://[USERNAME]:[PASSWORD]@git-codecommit.us-east-2.amazonaws.com/v1/repos/dev.rainierrhododendrons.com/': URL rejected: Port number was not a decimal number between 0 and 65535.

Note that the error above will gladly print out the username and password, not to mention it doesn’t work. Gross.

I was using the methods described in this post that work with git.

Let’s see what other options we have.

The documentation is sending me here —

Hardcoded credentials. Great.

I try running this command:

git config --global user.name $ghuser

Fatal. Not in a git directory. Well I can’t be in a git directory until I clone the repo and I can’t clone the repo without credentials, and I’m trying to clone bare so I don’t get the git files when I clone. Big, circular, catch-22.

Anyway, this is all just wrong…and I finally found the documentation for how to configure my solution without using hardcoded credentials which I never wanted to do in the first place.

TG I found a different solution by way of a blog post that led me to the AWS instructions listed under a somewhat obscure and overly wordy name that I didn’t initially recognize as being what I was looking for…phew. Found it.

Thank you to this blogger for giving me a clue. However, I don’t think this is exactly the correct approach.

I am working on a solution that I will write about shortly for proper use of the above method without changing the home directory. See my next post.

Bottom line: Don’t use user names and passwords and these solutions didn’t work anyway!

I’ll add a link to the solution here after I publish it.

Follow for updates.

Teri Radichel | © 2nd Sight Lab 2023

About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
Error Message
Lambda
AWS
Codecommit
Password
Recommended from ReadMedium