thiagowfx's avatar

¬ just serendipity 🍀 (not just serendipity)

prodaccess

• 358 words • 2 min • updated

⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.

At Google we had a prodaccess command used to log in and authenticate in all sorts of internal corp systems1 for 20 hours. It became a daily ritual to run prodaccess first thing in the morning when logging in upon unlocking our physical workstations2.

During the pandemic, when heavily using our virtual workstations (dubbed cloudtops, think of an EC2 instance or a VPS) it was common to hook prodaccess into ssh. There was a prodcertstatus command that would tell you when prodaccess would expire. A common pattern was to modify your ssh startup command to automatically run prodaccess whenever prodcertstatus indicated that access would expire within 2-4 hours, depending on the user’s preference.

Given my trained muscle memory, I wanted to continue to use this alias even in environments other than Google:

~/.profile.d/functions_corp.sh bash
[...]
prodaccess() {
	echo "--> VPN"
	vpn_login

	echo "--> Teleport"
	teleport_login

	echo "--> AWS"
	aws_login

    echo "--> Azure"
    azure_login

	case "$1" in
		-u|--update)
			echo "--> mr"
			# Update all well-known corp repositories
			(cd ~/Corp && mr update && mr run git world)

			# Package manager upgrade
			echo "--> sd-world"
			sd-world

			shift
			;;

		-a|--all)
			echo "--> Atlas Mongo"
			atlas_login

			shift
			;;
	esac
}
[...]

Notes:

  • mr is https://myrepos.branchable.com/ (“a tool to manage all your version control repositories”)3
  • sd-world was introduced in a previous post: it performs a full system upgrade
  • --all holds services I only need / use from time to time.
  • shift is not really needed, but IMHO it’s a good practice (and another ingrained habit of mine), especially when inside for loops
  • git world is an alias in my ~/.gitconfig that runs git fetch --all && git remote prune origin

Every morning I invoke prodaccess -u when starting my work day. A few password prompts and touch IDs later and I do not need to worry about logging in anymore during the middle of the day, which reduces overall context switching and stress.


  1. Until someone in CorpEng decided it was a good idea to deprecate it in favour of a new gcert command, destroying many SWE-years of developed muscle memory. ↩︎

  2. Ah, the good ol’ times↩︎

  3. I should write a post about it sometime. ↩︎