
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Check that all three instances are configured properly
/ 25
Check proper firewall rules have been created
/ 25
Check that IAM roles have been set for the service account
/ 25
Confirm VM is accessible via IAP enabled SA (ssh and RDP ability for both VMs.)
/ 25
In this lab, you will learn how to use Chrome Enterprise Premium and Identity-Aware Proxy (IAP) TCP forwarding to enable administrative access to VM instances that do not have external IP addresses or do not permit direct access over the internet.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
You will need a RDP client pre-installed so that you can connect and test Windows instances.
Open the Navigation Menu and select APIs and Services > Library.
Search for IAP and select Cloud Identity-Aware Proxy API.
Click Enable.
Create three instances for this lab: - Two for demonstration purposes (Linux and Windows) - One for testing connectivity (Windows)
From the Navigation Menu and select Compute Engine.
Click Create instance.
In the Machine configuration:
Select the following values:
Click Networking.
For Network interfaces, click the default network dropdown to edit. Then change the External IPV4 address to None.
Click Done.
Then click create. This VM will be referred to as linux-iap
To create the Windows Demo VM click Create instance.
In the Machine configuration:
Select the following values:
Click OS and Storage section.
Click Change to begin configuring your boot disk and select the following values:
Click Select.
Click Networking.
For Network interfaces, click the default network dropdown to edit. Then change the External IPV4 address to None. Click Done.
Then click create. This VM will be referred to as windows-iap
To create the Windows Connectivity VM, click Create instance.
In the Machine configuration:
Select the following values:
Click OS and Storage section, click on Change
For the OS, set the following on the Custom Images tab:
Qwiklabs Resources
iap-desktop-v001
Click Select.
Click Security.
In the Access scopes section, select Allow full access to all Cloud APIs.
Do not disable external IP for this instance
Then click create. This VM will be referred to as windows-connectivity
After the instances are created, You will test access to linux-iap and windows-iap to ensure that you aren’t able to access the VMs without the external IP.
For linux-iap click on the SSH button to get into the machine and ensure you get a message similar to the following.
For windows-iap: click the RDP button and ensure you get a message similar to the following:
Open the Navigation Menu and select VPC Network > Firewall and click Create Firewall Rule
Configure the following settings:
Field | Setting |
---|---|
Name | allow-ingress-from-iap |
Direction of traffic | Ingress |
Target | All instances in the network |
Source filter | IPv4 Ranges |
Source IPv4 Ranges | 35.235.240.0/20 |
Protocols and ports | Select TCP and enter 22, 3389 to allow both SSH and RDP respectively |
Use the following steps to configure the iap.tunnelResourceAccessor role by VM.
It is possible to use IAP Desktop to connect to instances using a graphical user interface from an instance with Windows Desktop. You can read more about IAP Desktop on the GitHub repository hosting the download for the tool.
To use IAP Desktop to connect to the instances in this lab:
RDP to the windows-connectivity
instance by downloading the RDP file. Go to the Compute Engine > VM Instances page. Select the down arrow next to the windows-connectivity instance on the Compute Engine landing page and download the file.
Open the RDP file to connect to the instance via Remote Desktop Protocol. You will use the credentials below to connect to the instance once prompted:
Once connected to the windows-connectivity instance, locate and open the IAP Desktop application on the desktop of the instance.
Once the application opens, click on the sign in with Google button to log in. Use the username and password provided in the lab console to authenticate with IAP Desktop. When you're prompted to continue, click Continue, and click Allow.
Double click on the windows-iap instance in the IAP Desktop application to log into the instance.
You may be prompted to provide credentials for the instance the first time you try to connect to it through IAP Desktop. Select "Generate new credentials" the first time logging into the instance.
Click OK for Generate logon credentials popup.
After the credentials are created you will be taken to the desktop of the windows-iap
instance and can see the end user experience.
You will test connectivity to the RDP instance using an RDP client. This is because you need to connect to the instance via an IAP tunnel locally.
Go to the Compute Engine > VM Instances page.
For the windows-connectivity instance click the down arrow and select Set windows password. Copy the password and save it.
Then click down arrow next to connect and click download the RDP file. Open the RDP file with your client and enter in your password.
Once you have connected to the windows-connectivity instance. Open the Google Cloud Shell SDK:
Now from the command line enter the following command to see if you can connect to the linux-iap instance:
Click Y when prompted to continue and to select the zone.
Make sure that you select the right zone for the instance when prompted.
Then Accept the Putty security alert.
Update Putty Settings to allow Tunnel connections locally. Click the top left corner of the Putty Window > Change Settings.
Allow local ports to accept connections from other hosts by checking the checkbox "Local ports accept connections from other hosts".
Close the Putty session and click Apply. Use the following command to create an encrypted tunnel to the RDP port of the VM instance:
Once you see the message about “Listening on port [XXX].” Copy the tunnel port number.
Return to the Google Cloud Console and go to the Compute Engine > VM Instances page.
Set and copy the password for the windows-iap instance.
Return to the RDP session now.
Leave gcloud running and open the Microsoft Windows Remote Desktop Connection app.
Enter the tunnel endpoint where the endpoint is the tunnel port number from the earlier step like so:
Click Connect.
Then enter the previous credentials you copied earlier. You will be successfully RDPed into your instance now!
If prompted click Yes.
You learned how to use BeyondCorp Enterprise (BCE) and
Identity-Aware Proxy (IAP) TCP forwarding by deploying 2 VM's, windows-iap
and linux-iap
, without IP addresses and configuring an IAP tunnel which gave you access to both instances using a third VM, windows-connectivity
.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated December 11, 2024
Lab Last Tested November 25, 2024
Copyright 2024 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one