Created
April 11, 2026 22:35
-
-
Save CodeShane/0d6e35b7d86a22bb1b7f468120764b79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # /!\ warning vibeslop /!\ | |
| # bootstrap-devops-mac.sh | |
| # Purpose: | |
| # Install a comprehensive macOS DevOps workstation stack for enterprise engineers: | |
| # - Kubernetes / Istio / AWS / Linux / Windows hybrid administration | |
| # - Corporate SSO environments | |
| # - CyberArk-aware tooling support | |
| # - YubiKey tooling | |
| # - AD querying support | |
| # | |
| # Notes: | |
| # - Uses non-sudo wherever possible | |
| # - Homebrew itself installs in user space on Apple Silicon by default | |
| # - Some components may still require sudo depending on your Mac setup | |
| # - Safe to prune later | |
| # | |
| set -euo pipefail | |
| ############################################ | |
| # Helpers | |
| ############################################ | |
| log() { | |
| echo "" | |
| echo "============================================================" | |
| echo "$1" | |
| echo "============================================================" | |
| } | |
| exists() { | |
| command -v "$1" >/dev/null 2>&1 | |
| } | |
| append_if_missing() { | |
| local line="$1" | |
| local file="$2" | |
| touch "$file" | |
| grep -Fqs "$line" "$file" || echo "$line" >> "$file" | |
| } | |
| ARCH="$(uname -m)" | |
| SHELL_RC="${HOME}/.zshrc" | |
| ############################################ | |
| # Install Homebrew | |
| ############################################ | |
| if ! exists brew; then | |
| log "Installing Homebrew (user-space)" | |
| NONINTERACTIVE=1 /bin/bash -c \ | |
| "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| fi | |
| if [[ "$ARCH" == "arm64" ]]; then | |
| BREW_PREFIX="/opt/homebrew" | |
| else | |
| BREW_PREFIX="/usr/local" | |
| fi | |
| append_if_missing "eval \"\$(${BREW_PREFIX}/bin/brew shellenv)\"" "$SHELL_RC" | |
| eval "$(${BREW_PREFIX}/bin/brew shellenv)" | |
| log "Updating Homebrew" | |
| brew update | |
| ############################################ | |
| # Core CLI Stack | |
| ############################################ | |
| log "Installing core CLI utilities" | |
| brew install \ | |
| git \ | |
| wget \ | |
| curl \ | |
| jq \ | |
| yq \ | |
| ripgrep \ | |
| fd \ | |
| fzf \ | |
| bat \ | |
| eza \ | |
| zoxide \ | |
| delta \ | |
| tmux \ | |
| tree \ | |
| htop \ | |
| btop \ | |
| gnupg \ | |
| pinentry-mac | |
| ############################################ | |
| # Terminal / Editor | |
| ############################################ | |
| log "Installing terminal + editor" | |
| brew install --cask iterm2 | |
| brew install --cask visual-studio-code | |
| ############################################ | |
| # Kubernetes Stack | |
| ############################################ | |
| log "Installing Kubernetes / Istio tooling" | |
| brew install \ | |
| kubectl \ | |
| helm \ | |
| k9s \ | |
| kubectx \ | |
| stern | |
| brew install istioctl | |
| ############################################ | |
| # Kubernetes Desktop | |
| ############################################ | |
| log "Installing Kubernetes desktop tools" | |
| brew install --cask rancher | |
| brew install --cask openlens | |
| ############################################ | |
| # AWS Stack | |
| ############################################ | |
| log "Installing AWS tooling" | |
| brew install \ | |
| awscli \ | |
| eksctl \ | |
| session-manager-plugin | |
| ############################################ | |
| # Terraform / Infra | |
| ############################################ | |
| log "Installing IaC tooling" | |
| brew install \ | |
| terraform \ | |
| terraform-docs \ | |
| ansible | |
| ############################################ | |
| # SSH / Remote Access | |
| ############################################ | |
| log "Installing SSH and remote tools" | |
| brew install \ | |
| mosh \ | |
| openssh | |
| ############################################ | |
| # PowerShell for Windows Server Management | |
| ############################################ | |
| log "Installing PowerShell" | |
| brew install --cask powershell | |
| ############################################ | |
| # YubiKey Tooling | |
| ############################################ | |
| log "Installing YubiKey tooling" | |
| brew install \ | |
| yubikey-manager \ | |
| ykman \ | |
| yubico-piv-tool | |
| ############################################ | |
| # CyberArk Support Tools | |
| ############################################ | |
| log "Installing CyberArk-compatible helpers" | |
| brew install \ | |
| python3 \ | |
| pipx | |
| pipx ensurepath || true | |
| # Optional CyberArk Python SDK: | |
| pipx install cyberark || true | |
| ############################################ | |
| # LDAP / Active Directory Query Tools | |
| ############################################ | |
| log "Installing AD / LDAP tooling" | |
| brew install \ | |
| openldap | |
| ############################################ | |
| # Optional GUI AD Browser | |
| ############################################ | |
| brew install --cask apache-directory-studio || true | |
| ############################################ | |
| # Optional Teleport CLI | |
| ############################################ | |
| log "Installing Teleport CLI" | |
| brew install teleport | |
| ############################################ | |
| # Git / DevOps Helpers | |
| ############################################ | |
| log "Installing GitLab / GitHub helpers" | |
| brew install \ | |
| gh \ | |
| glab | |
| ############################################ | |
| # Configure Shell Enhancements | |
| ############################################ | |
| log "Configuring shell profile" | |
| append_if_missing 'export PATH="/opt/homebrew/bin:$PATH"' "$SHELL_RC" | |
| append_if_missing 'eval "$(zoxide init zsh)"' "$SHELL_RC" | |
| ############################################ | |
| # Configure fzf keybindings | |
| ############################################ | |
| if [[ -f "${BREW_PREFIX}/opt/fzf/install" ]]; then | |
| yes | "${BREW_PREFIX}/opt/fzf/install" --key-bindings --completion --no-update-rc | |
| fi | |
| ############################################ | |
| # AWS SSO Reminder | |
| ############################################ | |
| cat <<EOF | |
| Next steps for AWS: | |
| ---------------------------------------- | |
| aws configure sso | |
| Example: | |
| aws configure sso --profile corp-sso | |
| EOF | |
| ############################################ | |
| # CyberArk Notes | |
| ############################################ | |
| cat <<EOF | |
| CyberArk Notes: | |
| ---------------------------------------- | |
| If your company uses: | |
| - CyberArk Identity | |
| - CyberArk Privileged Cloud | |
| - CyberArk PAS CLI | |
| You may also need: | |
| 1. Vendor-specific CyberArk CLI binaries | |
| 2. Internal tenant URL | |
| 3. SAML auth bootstrap profile | |
| These usually come from your security team. | |
| EOF | |
| ############################################ | |
| # AD Query Examples | |
| ############################################ | |
| cat <<EOF | |
| AD Query Examples: | |
| ---------------------------------------- | |
| 1. Query AD group membership: | |
| ldapsearch -x \ | |
| -H ldap://yourdc.company.com \ | |
| -D "user@company.com" \ | |
| -W \ | |
| -b "dc=company,dc=com" \ | |
| "(sAMAccountName=username)" memberOf | |
| 2. Query all members of a group: | |
| ldapsearch -x \ | |
| -H ldap://yourdc.company.com \ | |
| -D "user@company.com" \ | |
| -W \ | |
| -b "dc=company,dc=com" \ | |
| "(cn=DevOps-Admins)" member | |
| 3. If using PowerShell: | |
| pwsh | |
| Get-ADUser username -Properties MemberOf | |
| (Requires RSAT-compatible remoting endpoint) | |
| EOF | |
| ############################################ | |
| # YubiKey Verification | |
| ############################################ | |
| cat <<EOF | |
| YubiKey Verify: | |
| ---------------------------------------- | |
| ykman list | |
| ykman info | |
| EOF | |
| ############################################ | |
| # Completion | |
| ############################################ | |
| log "Bootstrap complete" | |
| echo "Reload shell:" | |
| echo "source ~/.zshrc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment