Push source code to gitlab using PSMP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Push source code to gitlab using PSMP

L5 Sessionator

Hi,

 

Any ideas or suggestions on leveraging PSMP while pushing the source to gitlab/remote repository?

 

Thanks

1 accepted solution

Accepted Solutions

L1 Bithead

Sure, I've done it.

 

1st, generate and register your SSH key for the GitLab user as normal.

2nd, onboard it to PAM as a Unix SSH Key account. The username should be "git", and the address... the GitLab instance address. 🙂

 

Then you have some choices for how to manage performing connections via the PSMP. I've opted to include the following in the SSH clients configuration:

Host gitlab.company.example Hostname proxy-xx.company.example User "vaultuser@[email protected]" IdentityFile ~/.ssh/id_pam IdentitiesOnly yes

Keep in mind that I use the MFA caching feature for PSMP auth. With this config in place, you can for example clone a repo like this:

 

$ git clone gitlab.company.example:cedric/my-repo.git   Cloning into 'my-repo...   This session is being recorded   remote: Enumerating objects: 12, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (9/9), done. remote: Total 12 (delta 0), reused 0 (delta 0), pack-reused 3 (from 1) Receiving objects: 100% (12/12), 7.22 KiB | 7.22 MiB/s, done.

Subsequent actions reuse the username and stuff, so they work seamlessly.

$ git pull   This session is being recorded   Already up to date.

 Depending on your authN mechanism you'll have to manage ssh key validity and things, though, so keep that in mind.

View solution in original post

1 REPLY 1

L1 Bithead

Sure, I've done it.

 

1st, generate and register your SSH key for the GitLab user as normal.

2nd, onboard it to PAM as a Unix SSH Key account. The username should be "git", and the address... the GitLab instance address. 🙂

 

Then you have some choices for how to manage performing connections via the PSMP. I've opted to include the following in the SSH clients configuration:

Host gitlab.company.example Hostname proxy-xx.company.example User "vaultuser@[email protected]" IdentityFile ~/.ssh/id_pam IdentitiesOnly yes

Keep in mind that I use the MFA caching feature for PSMP auth. With this config in place, you can for example clone a repo like this:

 

$ git clone gitlab.company.example:cedric/my-repo.git   Cloning into 'my-repo...   This session is being recorded   remote: Enumerating objects: 12, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (9/9), done. remote: Total 12 (delta 0), reused 0 (delta 0), pack-reused 3 (from 1) Receiving objects: 100% (12/12), 7.22 KiB | 7.22 MiB/s, done.

Subsequent actions reuse the username and stuff, so they work seamlessly.

$ git pull   This session is being recorded   Already up to date.

 Depending on your authN mechanism you'll have to manage ssh key validity and things, though, so keep that in mind.

  • 1 accepted solution
  • 37 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!