
始める前に
- ラボでは、Google Cloud プロジェクトとリソースを一定の時間利用します
- ラボには時間制限があり、一時停止機能はありません。ラボを終了した場合は、最初からやり直す必要があります。
- 画面左上の [ラボを開始] をクリックして開始します
Generate account activity
/ 20
Export the audit logs
/ 20
Generate more account activity
/ 25
Use BigQuery to analyze the audit logs
/ 35
Google Cloud services write audit logs that record administrative activities and access within your Google Cloud resources. Audit log entries help you answer the questions "who did what, where, and when" within your Google Cloud projects. Enabling audit logs helps your security, auditing, and compliance entities monitor Google Cloud data and systems for possible vulnerabilities or external data misuse.
In this lab, you'll investigate audit logs to identify patterns of suspicious activity involving cloud resources.
Cymbal Bank has officially migrated to its hybrid cloud solution and successfully deployed its workflows on the new cloud environment. Unfortunately, the Security Engineering team has been notified of a high severity alert involving unauthorized access to several of its cloud resources. This is alarming since malicious actors can use compromised cloud resources to exfiltrate data and launch attacks on other systems. It is your first time experiencing a security incident. Your team lead, Chloe, recognizes this as a valuable opportunity for you to learn the processes and procedures involved with incident response. You've been assigned to shadow and observe Hannah, an incident responder on the Incident Response Team which is a unit of the Security Engineering department. Hannah has provided you with access to the alert's logs which you'll use to investigate the malicious activity. You want to get a better understanding of the security incident so you have set up a test environment to recreate the incident and analyze the artifacts. You will use two separate user accounts: one account will generate the malicious activity, and the other account will be used to investigate the activity.
Here's how you'll do this task. First, you'll recreate the security incident by generating activity from the first user account. Next, you'll export the logs for further analysis. Then, you'll continue recreating the incident and generate additional user activity. Finally, you'll utilize BigQuery to analyze the logs.
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 practical lab lets you do the 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. 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 Sign in page opens in a new browser tab.
Tip: You can arrange the tabs in separate, side-by-side windows to easily switch between them.
If necessary, copy the Google Cloud username below and paste it into the Sign in dialog. Click Next.
You can also find the Google Cloud username in the Lab Details panel.
You can also find the Google Cloud password in the Lab Details panel.
After a few moments, the Console opens in this tab.
Cloud Shell is an online development and operations environment accessible anywhere with your browser. Cloud Shell provides command-line access to your Google Cloud resources.
After Cloud Shell starts up, you'll see a message displaying your Google Cloud Project ID for this session:
The command-line tool for Google Cloud, gcloud,comes pre-installed on Cloud Shell and supports tab-completion. In order to access Google Cloud, you'll have to first authorize gcloud.
A pop-up will appear asking you to Authorize Cloud Shell. Click Authorize.
Your output should now look like this:
Output:
Example output:
In this task, you'll create and delete cloud resources to generate account activity which you'll access as Cloud Audit Logs.
Click Check my progress to verify that you have completed this task correctly.
The activity you generated in the previous task was recorded as audit logs. In this task you'll export these logs to a BigQuery dataset for further analysis.
Section | Field: values |
---|---|
Sink details | Sink name: AuditLogsExport Click Next. |
Sink destination |
Select sink service: BigQuery dataset Select BigQuery dataset: Create new BigQuery dataset. The Create dataset dialog opens. |
Create dataset |
Dataset ID: auditlogs_dataset Click Create Dataset. The Create dataset dialog closes, and you'll return to the Sink destination dialog. |
Sink destination | Click Next. Uncheck the Use Partitioned Tables checkbox, if it is already selected, and click Next. |
Choose logs to include in sink | Notice the pre-filled Build inclusion filter:logName=("projects/[PROJECT ID]/logs/cloudaudit.googleapis.com%2Factivity") Click Next. Click Create Sink. Return to the Logs Explorer page. |
All future logs will now be exported to BigQuery, and the BigQuery tools can be used to perform analysis on the audit log data. The export does not export existing log entries.
Click Check my progress to verify that you have completed this task correctly.
In this task, you'll create and delete cloud resources to generate additional account activity which you'll then access in BigQuery to extract additional insights from the logs.
These commands generate more activity to view in the audit logs exported to BigQuery.
When prompted, enter Y, and press ENTER. Notice you created two buckets and deleted a Compute Engine instance.
Notice you deleted both buckets.
Click Check my progress to verify that you have completed this task correctly.
You'll need to switch Google Cloud accounts by logging into the Google Cloud console using the second user account provided in the Lab Details panel. You will use this user account to analyze the logs.
In this task, you'll review the Admin activity logs generated in the previous task. Your goal is to identify and apply filters to isolate logs that may indicate suspicious activity. This will enable you to export this subset of logs and streamline the process of analyzing them for potential issues.
Admin Activity logs record the log entries for API calls or other administrative actions that modify the configuration or metadata of resources. For example, the logs record when VM instances and App Engine applications are created when permissions are changed.
This entry refers to storage.googleapis.com, which calls the storage.buckets.delete method to delete a bucket. The bucket name is the same name as your project id:
Notice another line was added to the Query builder text:
The Query results should now display all entries related to deleted Cloud Storage buckets. You can use this technique to easily locate specific events.
Notice the principalEmail field which displays the email address of the user account that performed this action which is the user 1 account you used to generate the user activity.
You've generated and exported logs to a BigQuery dataset. In this task, you'll analyze the logs using the Query editor.
Next, verify that the BigQuery dataset has appropriate permissions to allow the export writer to store log entries.
Click the auditlogs_dataset dataset.
In the auditlogs_dataset toolbar, click the Sharing dropdown menu, and select Permissions.
On the Share permission for "auditlogs_dataset" page, expand the BigQuery Data Editor section.
Confirm that the service account used for log exports is a listed permission. The service account is similar to: service-xxxxxxxx@gcp-sa-logging.iam.gserviceaccount.com
This permission is assigned automatically when log exports are configured so this is a useful way to check that log exports have been configured.
Click Close to close the Share Dataset window.
In the Explorer pane, click the expander arrow next to the auditlogs_dataset dataset to view the cloudaudit_googleapis_com_acitivty table. This table contains your exported logs.
Select the cloudaudit_googleapis_com_acitivty table. The table schema displays. Take a moment to review the table schema and details.
Expand the Query drop-down menu and select In new tab.
This query returns the users that deleted virtual machines in the last 7 days.
After a couple of seconds, BigQuery will return each time a user deleted a Compute Engine virtual machine within the past 7 days. You should notice one entry, which is the activity you generated in the previous tasks as user 1. Remember, BigQuery shows only the activity that occurred after you created the export.
This query returns the users that deleted Cloud Storage buckets in the last 7 days. You should notice two entries, which is the activity you generated in the previous tasks as user 1.
The ability to analyze audit logs in BigQuery is very powerful. In this activity, you viewed just two examples of querying audit logs.
Click Check my progress to verify that you have completed this task correctly.
Great work! You have successfully queried in Logs Explorer. You then exported logs and created a dataset that you analyzed in BigQuery.
You have shown how you can use audit logs and filter for types of malicious activity and then further analyze those logs in BigQuery as a way to analyze the threats.
Before you end the lab, make sure you’re satisfied that you’ve completed all the tasks. When you're ready, click End Lab and then click Submit.
Ending the lab will remove your access to the lab environment, and you won’t be able to access the work you've completed in it again.
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.
このコンテンツは現在ご利用いただけません
利用可能になりましたら、メールでお知らせいたします
ありがとうございます。
利用可能になりましたら、メールでご連絡いたします
1 回に 1 つのラボ
既存のラボをすべて終了して、このラボを開始することを確認してください