Checkpoint
Install prisma Cloud Compute
/ 25
Deploy the Host Defender
/ 25
Protect Host with Runtime Defense
/ 25
Gain visibility to attacks and conduct an investigation
/ 25
Prisma Cloud: Protect your Cloud Instance with Host Defender
This lab was developed with our partner, Palo Alto Networks. Your personal information may be shared with Palo Alto Networks, the lab sponsor, if you have opted in to receive product updates, announcements, and offers in your Account Profile.
GSP838
Overview
Prisma Cloud provides comprehensive visibility and threat detection for cloud workload. Prisma Cloud software consists of two components: Console and Defenders. There are a number of Defender types. For this lab we will focus on the Securing Compute Engine instances with the Prisma Cloud Host Defender. The Console is Prisma Cloud's management interface where you manage the Host Defenders you will be deploying in this lab. The Console also allows you to define security policies and monitor your environment. Host Defender is deployed to each Compute Engine instance to secure the cloud workload deployed. The Host Defender protects your environment according to the security policies configured in the Prisma Cloud Console.
In this lab, you will use Prisma Cloud Host Defender to protect your Compute Engine Instances.
What you'll do:
- Deploy Prisma Cloud Compute on a Google Kubernetes Engine (GKE) Cluster
- Deploy Host Defender to Compute Engine Instances.
Setup and and requirements
Before you click the Start Lab button
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:
- Access to a standard internet browser (Chrome browser recommended).
- Time to complete the lab---remember, once you start, you cannot pause a lab.
How to start your lab and sign in to the Google Cloud Console
-
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:
- The Open Google Console button
- Time remaining
- The temporary credentials that you must use for this lab
- Other information, if needed, to step through this lab
-
Click Open Google Console. 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.
Note: If you see the Choose an account dialog, click Use Another Account. -
If necessary, copy the Username from the Lab Details panel and paste it into the Sign in dialog. Click Next.
-
Copy the Password from the Lab Details panel and paste it into the Welcome dialog. Click Next.
Important: You must use the credentials from the left panel. Do not use your Google Cloud Skills Boost credentials. Note: Using your own Google Cloud account for this lab may incur extra charges. -
Click through the subsequent pages:
- Accept the terms and conditions.
- Do not add recovery options or two-factor authentication (because this is a temporary account).
- Do not sign up for free trials.
After a few moments, the Cloud Console opens in this tab.
Task 1. Connect to the Kubernetes Cluster
A Kubernetes cluster has been provisioned so you can get started with your lab.
- From the Navigation menu, go to Kubernetes Engine > Clusters.
You may have to wait for your Kubernetes Cluster. You should see a green check mark next to the cluster named k8-cluster.
- Click the Connect button which will launch an option to run Cloud Shell.
- Click Run in Cloud Shell.
Cloud Shell will launch below the Cloud Console.
- Click Continue.
This will take a few moments as this is a persistent image (container) giving full shell access to your project. It comes with a number of useful tools pre-installed, such as Terraform. In a production environment, the best reason to use Cloud Shell vs. your own laptop shell is that you do not have to worry about storing authentication tokens. Cloud Shell automatically inherits all permissions from your account.
-
Press Enter in Cloud Shell to run the pre-populated
gcloud
command. -
Click Authorize.
Task 2. Install Prisma Cloud Compute
From Cloud Shell execute the following commands.
- Download and install the latest Prisma Cloud Compute Console software image:
- Make a directory to decompress the file to:
- Then decompress the file:
- Change directory to the
prisma_cloud_compute_edition
folder and use the Linuxtwistcli
to generate a YAML file for the Prisma Cloud Compute console:
- Retrieve the Prisma Cloud Token.
After executing the following command in the next step you will be asked for the Token you just retrieved.
- Execute the following Linux
twistcli
command to generate the YAML file for the Prisma Cloud Compute console:
- Paste the Prisma Cloud Token into Cloud Shell.
- Press ENTER after the paste and the command will complete. Your output should resemble the following:
The script is adding the token to the yaml
file for initial authentication.
- Now use
kubectl
to create thetwistlock_console
:
Output:
- Run the following command to check and see if the service has come up fully. The command uses a
-w
flag which means wait. This flag will auto refresh the screen:
The External IP will show once the service is available.
The public IP under the EXTERNAL-IP heading will be used to gain access to the Prisma Cloud Compute Console.
-
Once you see the EXTERNAL-IP use Ctrl-C to stop the wait flag and return to the command line.
-
Copy the External IP address for the console. You will use it for testing the connectivity from the hosts.
Click Check my progress to verify the objective.
Task 3. Connect to the console of the lab instances
There are 3 Linux Compute Engine instances pre-deployed in the lab named, jenkins-vm, juice-shop and kali. You are going to deploy the Prisma Cloud Host Defender on these instances.
To find these instances, in the Cloud Console navigate to Compute Engine > Virtual machines > VM instances.
- Connect to the instances through the following procedures:
- SSH to jenkins-vm server by clicking on SSH
- SSH to juice-shop by clicking on SSH
- SSH to kali from Cloud Shell with the following command, replacing
[external IP of kali]
with your external IP.
When asked if you want to connect, type "yes", then use the password: kali
.
- Verify that the instances where you will be installing Host Defender can connect to the Prisma Cloud Console. Execute the following
curl
command from kali, juice-shop and jenkins-vm, replacing[CONSOLE_IP_ADDRESS|HOSTNAME]
with the External IP address of thetwistlock-console
from the previous step:
The curl
will return an HTTP response status code of 200 indicating you have connectivity to the Console.
- Log in to the Prisma Cloud Console by opening a browser window, and browsing to https://[YOUR-EXTERNAL-IP]:8083. By default, the Console uses HTTPS on port 8083.
- At the certificate warning, click Advanced, the Proceed to .... link.
- Log in with the following credentials:
User:
Password:
- Then click Create Account.
- In Cloud Shell, retrieve the Prisma Cloud license key.
- Paste the license key in the update field and click Register.
- Once the key has been registered a first use menu will become available, select the X in the upper right hand corner to exit out.
Task 4. Deploy the Host Defender
Now you will install the Prisma Cloud Compute Host Defender. Host Defender communicates with the Prisma Cloud Compute Console using Transport Layer Security (TLS). You will update the list of identifiers in Console's certificate that the Host Defenders will use to validate the Console's identity.
- Install Prisma Cloud Compute Single Defender. From the Prisma Cloud Compute Console go to Manage > Defenders > Deploy
- Adding Subject Alternative Names (SAN):
Add the public Console IPaddress to SAN list if you see a banner:
Or you can add a SAN to Console's certificate directly from Console's web interface.
- Go to Manage > Defenders > Names.
- Click Add SAN.
- Enter a DNS name or Console External IP address.
- Click Add.
- Deploy the Single Defender. In the Console Step 1 the client defender name should be the External IP address of the Prisma Cloud Console. On the same page scroll down the page to Step 2. Select the Defender Type and choose Host Defender - Linux. Then on Step 3 click the Copy button for the Install script.
- You will paste the install script into Cloud Shell to install the Host Defender to all three linux instances.
Please keep these command shell connections to the three linux instances open, you will issue commands in each of them in later exercises.
- In the Prisma Cloud Console, navigate to Manage > Defenders > Manage to see a list of deployed defenders, you will see something similar to the following:
- Navigate to the Radar View on the left menu and select Hosts from the menu. You will see the defender has begun to scan the existing environment and populate the Console with information.
Click Check my progress to verify the objective.
Task 5. Gain visibility into all applications running on a host
- Navigate to Monitor > Runtime > Host Observations, then select jenkins to review the application with multiple processes.
- Scroll down to click on twistlock-defender-server to review all of the following information:
- Enriched information on the application for known applications.
- Listening ports.
- Outgoing ports.
- All processes used including full path, the command used, parent path, user, and when the process was first observed.
Task 6. Gain visibility to hosts exposed to known vulnerabilities
- Navigate to Radars > Hosts and click on Jenkins then click on Vulnerabilities to review the Vulnerabilities details.
- Click on Package Info.
- Review the details of the Packages.
Close this view.
- Review a list of missing security updates via Monitor > Runtime > Host Observations. Open juice-shop and navigate to the Security Updates tab.
Close this view when you're finished reviewing.
Task 7. Protect Host with Runtime Defense
Prisma Cloud secures hosts with file integrity monitoring (FIM); log inspection; application, capability, and activity rules; custom runtime rules; and more, to ensure running workloads are secure. Quickly view all audit or security events with automated, secure forensic data captures. Prisma Cloud provides out of the box easy protection against a large range of attacking tools including crypto miners, exploitation tools, C2 infrastructure, password attacks, sniffing and spoofing tools. The Runtime rules are customizable to protect against any emerging threats or organization specific requirements.
Protect hosts against specific command or domain
In addition to the out of the box protection, you can create a Runtime rule to block execution of a specific command and accessing a domain name.
Create a runtime rule to prevent a process to run
- In the Prisma Cloud console, select Defend > Runtime, select the Host Policy tab, click Add rule.
- Add the Rule name "prevent ls", and select all of the Hosts you want to protect.
-
On the Processes tab, switch Effect from Alert to Prevent.
-
Add the ls command to Prevent processes.
- On the Networking tab:
- Enable DNS
- Turn Effect to Prevent
- Add
*.google.com
to the Prevented domains list
- Click Save.
Execute the command and lookup the domain
You may have to re-log in to kali.
- If so, use the following command:
password: kali
- From kali shell, issue
ls
command:
the command will be blocked.
- Now try a dns lookup:
The operation will fail.
- Try lookup for a known good domain:
This lookup will succeed.
Task 8. Gain visibility to attacks and conduct an investigation
With Host Audits you can see:
- All audits associated with the incident in the incident explorer page.
- Forensics data for the incident and explain how everything that occurred during the incident is presented in a timeline view.
- In the Prisma Cloud console select Monitor > Events.
Hosts can be filtered by Collections, Hostname, Last Audit.
-
At the top, select Host Audits.
-
Find the events for kali.
-
Then click Forensic in the Network row.
- Uncheck Process spawned and SSH event. To only review Runtime audits, find the alerts for blocking ls command and nslookup for www.google.com.
- Remove the process rule that is blocking ls command and the domain rule that is blocking www.google.com, repeat the test.
Close this view when you're finished. Both ls
and nslookup
should be allowed.
<! ## Review Host Activity
In the Prisma Cloud console, select Monitor > Event, then select Host Activities.
Click Check my progress to verify the objective.
Monitor Hosts for SSH Access
- In the Prisma Cloud console, select Monitor > Runtime, select Host Observations tab, then select kali from the host list.
- Click on the SSH Events tab to review the SSH activities.
Monitor Application Logs for Suspicious Activities
Review predefined templates for log inspection policy
-
In the Prisma Cloud console, select Defend > Runtime on the Host Policy tab.
-
Then click Add Rule and add the rule name "ql-nov-10".
-
Select the Log Inspections tab and click on Create from Template.
- Review the log inspection template, then click cancel.
Create log inspection policy
- Add log path:
- Add inspection expression:
- Click Add Rule:
- Click Save.
Generate Log Inspection Events
- Use a web browser to access
http://<external IP__ of juice-shop>
Reminder: To obtain the external IP of juice-shop, in the Cloud Console go to Navigation menu > Compute Instance.
-
Create a juice-shop account,
-
Then buy some juice to generate traffic to the juice-shop web application.
-
Now check the access log.
-
In the juice-shop shell, issue the following command:
Output:
Note there are multiple matches to the inspection expression "Mozilla".
- In Prisma Cloud Console go to Monitor > Events, select Host Log Inspection and review the Host Log Inspection.
- Confirm that the inspection expression matches have triggered Host Log Inspection events.
Monitor suspicious activity on the host based on expected usage
Create rules to monitor Host activities
Prisma Cloud lets you audit security-related activity on hosts protected by Defender. The default host runtime rule alerts on the host activities including user, access, and application activities.
You can create additional runtime rules to control which type of events are captured on which hosts. You will create a rule to monitor Docker commands that alter state: create, run, exec, commit, save, push, login, export, kill, start, stop, and tag.
- In Prisma Cloud Console, select Defend > Runtime select Host Policy tab Add Rule, then give the rule name docker.
- Select the Activities tab, then turn On the switch at Docker commands.
- Click Save.
Create an Host Activity event
- Navigate to the jenkins shell and issue the following commands to create a container:
Review Host Activity log
- In the Prisma Cloud console Monitor > Events.
- Click on Host Activities, and note the Docker activity entry.
Monitor sensitive files
Create a Host Defend Runtime File Integrity Rule
-
In Prisma Cloud console, select Defend > Runtime.
-
Select the Host Policy tab, click add rule, and give a rule name "etc".
-
Select the File Integrity tab, leave Effect to Alert selected, then click on Add Rule.
Add a new file integrity rule with the followings:
- Path: /etc
- Write: checked
- Read: checked
- Metadata: checked
- scroll down and click Add File Integrity Rule
- Click Save to save the file integrity rule.
Create an Host File Integrity event
- Navigate to the jenkins host shell and issue the following command to create a container:
- Change the nameserver to
8.8.8.8
.
- Save the changes and exit nano: Ctrl-X > Y.
- Press Enter to save the file.
Review Host Activity log
-
In the Prisma Cloud console select Monitor > Events.
-
Click on Host File Integrity.
Click Check my progress to verify the objective.
Congratulations!
You have successfully deployed Palo Alto Networks Prisma Cloud Compute and Host Defender. Through the exercises, you have experienced how Prisma Cloud secures hosts with file integrity monitoring (FIM); log inspection; application, capability, and activity rules; custom runtime rules; and more, to ensure running workloads are secure. Quickly view all audit or security events with automated, secure forensic data captures.
Finish Your Quest
This self-paced lab is part of the Securing Cloud with Palo Alto Networks quest. A quest is a series of related labs that form a learning path. Completing this quest earns you a badge to recognize your achievement. You can make your badge or badges public and link to them in your online resume or social media account. Enroll in this quest and get immediate completion credit. See the Google Cloud Skills Boost catalog to see all available quests.
Next steps / Learn more
- Palo Alto Networks on the Google Cloud Marketplace!
End your lab
When you have completed your lab, click End Lab. Your account and the resources you've used are removed from the lab platform.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
- 1 star = Very dissatisfied
- 2 stars = Dissatisfied
- 3 stars = Neutral
- 4 stars = Satisfied
- 5 stars = Very satisfied
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Manual Last Updated: August 21, 2023
Lab Last Tested: December 20, 2021
Copyright 2023 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.