Protect Cloud Traffic with Chrome Enterprise Premium Security

Solution for Protect Cloud Traffic with Chrome Enterprise Premium Security. 1 lab: GSP373. Fast copy-paste commands for Google Cloud.

GSP373 — Protect Cloud Traffic with Chrome Enterprise Premium Security: Challenge Lab

Estimated time: 30 minutes

# GSP373: Secure Web App with IAP: Challenge Lab > ⚠️ **Disclaimer:** This guide is for educational purposes only, intended to help you learn Google Cloud concepts. Please ensure you follow Qwiklabs' Terms of Service and YouTube's Community Guidelines. > > **Credits:** DM for credit or removal request (no copyright intended). © All rights and credits for the original content belong to Google Cloud. 🙏 --- # 🛠️ Step-by-Step UI Guide This challenge lab requires a combination of **Cloud Shell

clear
CYAN='\e[1;36m'
BLUE='\e[1;34m'
RESET='\e[0m'
BOLD='\e[1m'
echo -e "${CYAN}${BOLD}"
cat << "EOF"
  ____        _     _ _             __    ___            
 / __ \      | |   (_) |           / _|  / _ \           
| |  | |_ __| |__  _| |_   ___  | |_  | | | |_ __  ___ 
| |  | | '__| '_ \| | __| / _ \ |  _| | | | | '_ \/ __|
| |__| | |  | |_) | | |_ | (_) || |   | |_| | |_) \__ \
 \____/|_|  |_.__/|_|\__| \___/ |_|    \___/| .__/|___/
                                            | |        
                                            |_|        
EOF
echo -e "${RESET}"
echo -e "${BLUE}${BOLD}╔════════════════════════════════════════════════════════════╗${RESET}"
echo -e "${BLUE}${BOLD}║   🚀 BROUGHT TO YOU BY ORBIT OF OPS                        ║${RESET}"
echo -e "${BLUE}${BOLD}╚════════════════════════════════════════════════════════════╝${RESET}\n"

export PROJECT_ID=$(gcloud config get-value project)
export REGION=$(gcloud config get-value compute/region 2>/dev/null)
if [ -z "$REGION" ] || [ "$REGION" == "(unset)" ]; then
    export ZONE=$(gcloud config get-value compute/zone 2>/dev/null)
    export REGION=${ZONE%-*}
fi
if [ -z "$REGION" ] || [ "$REGION" == "(unset)" ]; then
    read -p "Please paste the REGION from your lab instructions (e.g. us-central1) and press Enter: " REGION </dev/tty
fi
gcloud config set compute/region $REGION

echo "Enabling IAP API..."
gcloud services enable iap.googleapis.com

echo "Cloning sample repository..."
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
cd python-docs-samples/appengine/standard_python3/hello_world/

echo "Creating App Engine application in $REGION..."
gcloud app create --project=$PROJECT_ID --region=$REGION

echo "Deploying the web app to App Engine (this takes a few minutes)..."
gcloud app deploy --quiet

# Subscribe to Orbit of Ops https://www.youtube.com/@orbitofops/videos
read -p "Please paste the 'Tester' email from your lab instructions panel and press Enter: " TESTER_EMAIL

echo "Granting 'IAP-secured Web App User' role to the Tester..."
gcloud projects add-iam-policy-binding $PROJECT_ID \
    --member="user:$TESTER_EMAIL" \
    --role="roles/iap.httpsResourceAccessor"

MAGENTA='\e[1;35m'
BOLD='\e[1m'
RESET='\e[0m'
echo -e "\n${MAGENTA}${BOLD}╔════════════════════════════════════════════════════════════╗${RESET}"
echo -e "${MAGENTA}${BOLD}║            🎉 AUTOMATION COMPLETED SUCCESSFULLY 🎉           ║${RESET}"
echo -e "${MAGENTA}${BOLD}╚════════════════════════════════════════════════════════════╝${RESET}"

# Subscribe to Orbit of Ops https://www.youtube.com/@orbitofops/videos