Audit logging  |  Cloud Search  |  Google for Developers (2024)

This page describes the audit logs created by Cloud Search as part ofCloud Audit Logs.

Overview

Google Cloud services write audit logs to help you answer the questions,"Who did what, where, and when" within your resources. Your Cloud projectscontain only the audit logs for resources that are directly within the project.Other entities, such as folders, organizations, and Cloud Billing accounts,contain the audit logs for the entity itself.

For a general overview of Cloud Audit Logs, seeCloud Audit Logs. For a deeperunderstanding of Cloud Audit Logs, reviewUnderstanding audit logs.

Cloud Audit Logs provides the following audit logs for each Cloud project,folder, and organization:

  • Admin Activity audit logs containing entries corresponding to methodsperforming Admin write operations. The methods corresponding toAdmin Activity:Admin write operations are covered in an upcomingAudited operations section.
  • Data Access audit logs containing entries corresponding to methods performingAdmin read, Data write, and Data read operations. The methods corresponding toData Access:Admin read, Data Access:Data write, Data Access:Data readoperations are covered in an upcoming Audited operations section.
  • System Event audit logs
  • Policy Denied audit logs

Cloud Search writes Admin Activity audit logs, which record operations thatmodify the configuration or metadata of a resource. You can't disable AdminActivity audit logs.

Only ifexplicitly enabled,Cloud Search writes Data Access audit logs. Data Access audit logs contain APIcalls that read the configuration or metadata of resources, as well asuser-driven API calls that create, modify, or read user-provided resource data.

Cloud Search doesn't write System Event audit logs.

Cloud Search doesn't write Policy Denied audit logs.

Audited operations

The following summarizes which API operations correspond to each audit log typein Cloud Search:

Audit logs categoryCloud Search operations
Admin Activity: Admin writeindexing.datasources.updateSchema
indexing.datasources.deleteSchema
settings.datasources.create
settings.datasources.delete
settings.datasources.update
settings.searchapplications.create
settings.searchapplications.delete
settings.searchapplications.reset
settings.searchapplications.update
settings.updateCustomer
cloudsearch.IdentitySourceService.create
cloudsearch.IdentitySourceService.update
cloudsearch.IdentitySourceService.delete
Data Access: Admin readindexing.datasources.getSchema
settings.datasources.get
settings.datasources.list
settings.searchapplications.get
settings.searchapplications.list
settings.getCustomer
cloudsearch.IdentitySourceService.get
cloudsearch.IdentitySourceService.list
Data Access: Data writeindexing.datasources.items.delete
indexing.datasources.items.deleteQueueItems
indexing.datasources.items.index
indexing.datasources.items.poll
indexing.datasources.items.push
indexing.datasources.items.unreserve
indexing.datasources.items.upload
media.upload
Data Access: Data readindexing.datasources.items.get
indexing.datasources.items.list
operations.get
operations.list
debug.datasources.items.checkAccess
debug.datasources.items.searchByViewUrl
stats.getIndex
stats.getQuery
stats.getSession
stats.getUser
stats.index.datasources.get
stats.query.searchapplications.get
stats.session.searchapplications.get
stats.user.search applications.get
debug.identitysources.items.listForunmappedidentity
debug.identitysources.unmappedids.list
debug.datasources.items.unmappedids.list
query.sources.list
query.suggest
query.search
stats.getSearchapplication

Audit log format

Audit log entries—which can be viewed in Cloud Logging using the Logs Explorer,the Cloud Logging API, or the gcloud command-line tool—include the followingobjects:

The log entry itself, which is an object of typeLogEntry.Useful fields include the following:

  • The logName contains the resource ID and audit log type.
  • The resource contains the target of the audited operation.
  • The timeStamp contains the time of the audited operation.
  • The protoPayload contains the audited information.
  • The audit logging data, which is anAuditLogobject held in the protoPayload field of the log entry.

Optional service-specific audit information, which is a service-specific object.For earlier integrations, this object is held in the serviceData field of theAuditLog object; later integrations use the metadata field.

For other fields in these objects, and how to interpret them, reviewUnderstanding audit logs.

Log name

Cloud Audit Logs resource names indicate the Cloud project or other Google Cloudentity that owns the audit logs, and whether the log contains Admin Activity,Data Access, Policy Denied, or System Event audit logging data. For example, the followingshows log names for project-level Admin Activity audit logs and an organization'sData Access audit logs. The variables denote project and organizationidentifiers.

projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivityorganizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fdata_access

Service name

Cloud Search audit logs use the service name cloudsearch.googleapis.com.

Resource types

Cloud Search audit logs use the resource type audited_resource for all auditlogs.

For a list of other resource types, seeMonitored resource types.

Enable audit logging

By default, audit logging is disabled for Cloud Search API. To enable auditlogging for Google Cloud Search:

  1. (optional) If you haven't created a Google Cloud Platform project to storelogs, refer toConfigure access to the Google Cloud Search API.

  2. Obtain the project ID for the Google Cloud where youwant to store the logs. To learn how to obtain a project ID, refer toIdentifying projects.

  3. To enable audit logging for a specific API, you need to determine its logcategory to enable. For APIs and their corresponding categories, refer toAudited operations earlier in this document.

  4. Use theupdateCustomer()REST API method to update the auditLogSettings with the log categories toenable:

    1. Obtain an OAuth 2.0 access token from the Google Authorization Server. Forinformation about obtaining the token, refer to step 2 ofUsing OAuth 2.0 to Access Google APIs.Use one of the following OAuth scopes while obtaining the access token:

      • https://www.googleapis.com/auth/cloud_search.settings.indexing
      • https://www.googleapis.com/auth/cloud_search.settings
      • https://www.googleapis.com/auth/cloud_search
    2. Run the following curl command.

    curl --request PATCH \'https://cloudsearch.googleapis.com/v1/settings/customer?updateMask=auditLoggingSettings&key=[YOUR_API_KEY]' \--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \--header 'Content-Type: application/json' \--data '{"auditLoggingSettings": { "project": "projects/PROJECT_ID", "CATEGORY1": "true", "CATEGORY2": "true" } }'

    Where:

    • YOUR_ACCESS_TOKEN is OAuth 2.0 access token obtained in step 4a.
    • PROJECT_ID is the project ID obtained in step 2.
    • CATEGORY1, CATEGORY2, are the categories you chose to enable instep 3. Valid values are logAdminReadActions, logDataWriteActions, andlogDataReadActions. Admin write actions are enabled by default and cannot bedisabled. If you want audit logging for query methods, you must enable theData read category.

    After updating AuditLoggingSettings, further requests to Cloud Search APIgenerate an audit log in the project ID specified in AuditLoggingSettings.

  5. Audit logging for query methods requires the Data read category to be enabled(done in step 4). To enable audit logging for query methods(query.sources.list, query.suggest and query.search) follow theseadditional steps:

    1. For each search application for which you want to enable audit logging,retrieve the name. The name must be in the form ofsearchapplications/<search_application_id>.

    2. Use the name to call settings.searchapplications.update withenableAuditLog set to true.

  6. To enable audit logging for calls from cloudsearch.google.com, ensurethe Data read category is enabled (step 4). Additionally, performstep 5b with a name of searchapplications/default .

Once enabled, logs can be viewed in the Logs Explorer section of the Google CloudConsole. Use the following filter to view only Cloud Search audit logs:

protoPayload.serviceName="cloudsearch.googleapis.com"

For information about how to view logs, refer toLogs explorer overview.

Audit log permissions

Identity and Access Management permissions and roles determine which audit logsyou can view or export. Logs reside in Cloud projects and in some other entitiesincluding organizations, folders, and Cloud Billing accounts. For moreinformation, seeUnderstanding roles.

To view Admin Activity audit logs, you must have one of the following IAM rolesin the project that contains your audit logs:

  • Project Owner, Project Editor, or Project Viewer
  • The LoggingLogs Viewerrole
  • Acustom IAM role withthe logging.logEntries.list IAM permission

To view Data Access audit logs, you must have one of the following roles in theproject that contains your audit logs:

  • Project Owner
  • Logging'sPrivate Logs Viewer role
  • A custom IAM rolewith the logging.privateLogEntries.list IAM permission

If you are using audit logs from a non-project entity, such as an organization,then change the Cloud project roles to suitable organization roles.

View logs

To find and view audit logs, you need to know the identifier of the Cloudproject, folder, or organization for which you want to view audit logginginformation. You can further specify other indexedLogEntryfields, like resource.type; for details, reviewBuild queries in the Logs Explorer.

The following are the audit log names; they include variables for theidentifiers of the Cloud project, folder, or organization:

 projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Factivity projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fdata_access projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fpolicy folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Factivity folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fdata_access folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fsystem_event folders/FOLDER_ID/logs/cloudaudit.googleapis.com%2Fpolicy organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Factivity organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fdata_access organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fsystem_event organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com%2Fpolicy

You have several options for viewing your audit log entries.

Console

You can use the Logs Explorer in the Cloud Consoleto retrieve your audit log entries for your Cloud project:

  1. In the Cloud Console, go to theLogging > Logs Explorer page.

    Go to the Logs Explorer page

  2. On the Logs Explorer page, select an existing Cloud project.

  3. In the Query builder pane, do the following:

    • In Resource, select the Google Cloud resource type whoseaudit logs you want to see.

    • In Log name, select the audit log type that you want to see:

      • For Admin Activity audit logs, select activity.
      • For Data Access audit logs, select data_access.
      • For System Event audit logs, select system_event.
      • For Policy Denied audit logs, select policy.

    If you don't see these options, then there aren't any audit logs ofthat type available in the Cloud project.

    For more details about querying using the new Logs Explorer, seeBuild queries in the Logs Explorer.

gcloud

The gcloud provides a command-line interface to theLogging API. Supply a validPROJECT_ID, FOLDER_ID,or ORGANIZATION_ID in each of the log names.

To read your Google Cloud project-level audit log entries, runthe following command:

gcloud logging read "logName : projects/PROJECT_ID/logs/cloudaudit.googleapis.com" \ --project=PROJECT_ID

To read your folder-level audit log entries, run the following command:

gcloud logging read "logName : folders/FOLDER_ID/logs/cloudaudit.googleapis.com" \ --folder=FOLDER_ID

To read your organization-level audit log entries, run the following command:

gcloud logging read "logName : organizations/ORGANIZATION_ID/logs/cloudaudit.googleapis.com" \ --organization=ORGANIZATION_ID

For more information about using the gcloud tool, seegcloud logging read.

API

When building your queries, replace the variables with valid values,substitute the appropriate project-level, folder-level, ororganization-level audit log name or identifiers as listed inthe audit log names. For example, if your query includes aPROJECT_ID, then the projectidentifier you supply must refer to the currently selected Cloud project.

To use the Logging API to look at your audit log entries, do thefollowing:

  1. Go to the Try this API section in the documentation for theentries.listmethod.

  2. Put the following into the Request body part of the Try thisAPI form. Clicking on this prepopulated formautomatically fills the request body, but you need tosupply a valid PROJECT_ID in each of the lognames.

    { "resourceNames": [ "projects/PROJECT_ID" ], "pageSize": 5, "filter": "logName : projects/PROJECT_ID/logs/cloudaudit.googleapis.com"}
  3. Click Execute.

For more details about querying, seeLogging query language.

For a sample audit log entry and how to find the most importantinformation in it, seeUnderstanding audit logs.

Exporting audit logs

You can export audit logs in the same way that you export other kinds of logs.For details about how to export your logs, seeExporting logs.Here are some applications of exporting audit logs:

  • To keep audit logs for a longer period of time or to use more powerful searchcapabilities, you can export copies of your audit logs to Cloud Storage,BigQuery, or Pub/Sub. Using Pub/Sub, you can export to other applications,other repositories, and to third parties.

  • To manage your audit logs across an entire organization, you can createaggregated sinksthat can export logs from any or all Cloud projects in the organization.

  • If your enabled Data Access audit logs are pushing your Cloud projects overtheir logs allotments, you can export and exclude the Data Access audit logsfrom Logging. For details, seeExcluding logs.

Pricing and retention

Cloud Logging does not charge you for audit logs that cannot be disabled,including all Admin Activity audit logs. Cloud Logging charges you for DataAccess audit logs that you explicitly request.

For more information about audit logs pricing, seeGoogle Cloud's operations suite pricing.

The storage duration associated with Cloud Search audit logs are:

  • Admin Activity logs (or Admin Write) - These logs are retained for 400 days.
  • Data Access logs (Admin Read, Data Write and Data Read) - These logs areretained for 30 days.

For more information about storage duration, seeLogs retention periods.

Current limitations

Cloud Search audit logging has these current limitations:

  • The size of log entry must be less than 512 KB. If the size grows beyond 512KB, then the response is dropped from the log entry. If that doesn't reduce thesize to 512 KB or lower, the request is dropped. Finally, if the size stillexceeds 512 KB, the log entry is dropped.

  • Response bodies aren't logged for list(), get() and suggest() methods.However, response statuses are available.

  • Only Query API calls from cloudsearch.google.com (if enabled) and customersearch applications are logged.

  • For search() calls, only Query, RequestOptions and DataSourceRestrictionare logged in the request. In the response, only the url and metadata (source andobjectType) for each SearchResult are audited.

  • Calls issued to the Cloud Search backend and corresponding to data exportaren’t audited.

Audit logging  |  Cloud Search  |  Google for Developers (2024)

FAQs

Audit logging  |  Cloud Search  |  Google for Developers? ›

Viewing logs

In the Google Cloud console, go to the Logging page. When in the Logs Explorer, select and filter your resource type from the first drop-down list. From the All logs drop-down list, select compute.googleapis.com/activity_log to see Compute Engine activity logs.

How to check logs in Google Cloud Platform? ›

Viewing logs

In the Google Cloud console, go to the Logging page. When in the Logs Explorer, select and filter your resource type from the first drop-down list. From the All logs drop-down list, select compute.googleapis.com/activity_log to see Compute Engine activity logs.

How much does GCP audit log cost? ›

$0.50/GiB; One-time charge for streaming logs into log bucket storage for indexing, querying, and analysis; includes up to 30 days of storage in log buckets. No additional charges for querying and analyzing log data. $0.01 per GiB per month for logs retained more than 30 days; billed monthly according to retention.

What is an audit log in cloud computing? ›

Google Cloud services write audit logs that record administrative activities and accesses within your Google Cloud resources. Audit logs help you answer "who did what, where, and when?" within your Google Cloud resources with the same level of transparency as in on-premises environments.

What is the best practice for GCP logging? ›

Best practice rules for GCP Cloud Logging

Ensure that the retention period configured for your logging buckets is 365 days or greater. Ensure that the log bucket retention policies are using the Bucket Lock feature. Ensure that the location of your Cloud Logging buckets is global.

How to query audit logs in GCP? ›

In the Query builder pane, do the following:
  1. In Resource, select the Google Cloud resource type whose audit logs you want to see.
  2. In Log name, select the audit log type that you want to see: For Admin Activity audit logs, select activity. For Data Access audit logs, select data_access.

How to check Google audit log? ›

Run a search for log events
  1. Sign in to your Google Admin console. ...
  2. In the Admin console, go to Menu Reporting Audit and investigation. ...
  3. Click Add a filter, and then select an attribute.
  4. In the pop-up window, select an operator select a value. ...
  5. Click Search.

What is the difference between audit log and activity log? ›

Compared to activity logs, audit logs have multiple log name values and different payload values. Audit log entries also return fully qualified resource names and versioned method names.

How long do audit logs last? ›

Save all audit logs for at least 6 years if: It's not cost-prohibitive to your organization; and. The logs contain information that is related to actions on systems containing ePHI.

What should be included in an audit log? ›

Audit logs record the occurrence of an event, the time at which it occurred, the responsible user or service, and the impacted entity. All of the devices in your network, your cloud services, and your applications emit logs that may be used for auditing purposes.

What are the four A's of cloud auditing? ›

As organizations increasingly adopt cloud technologies, it is essential to understand the key aspects of Cloud Identity Management. This blog explains the five A's that form the foundation of Cloud Identity Management: authentication, authorization, account management, audit logging, and accountability.

What are the two types of audit logs? ›

There are typically two kinds of audit records, (1) an event-oriented log and (2) a record of every keystroke, often called keystroke monitoring. Event-based logs usually contain records describing system events, application events, or user events.

What is alternative for GCP logging? ›

Other important factors to consider when researching alternatives to Google Cloud Logging include monitoring and security. The best overall Google Cloud Logging alternative is Datadog. Other similar apps like Google Cloud Logging are Splunk Enterprise, Elastic Stack, New Relic, and Mezmo Log Analysis.

What is the difference between GCP cloud logging and monitoring? ›

Cloud Logging automatically ingests Google Cloud audit and platform logs so that you can get started right away. Cloud Monitoring provides a view of all Google Cloud metrics at zero cost and integrates with a variety of providers for non Google Cloud monitoring.

What are the different types of GCP logs? ›

Cloud Logging in GCP offers various types of log entries, including text log entries, structured log entries, log entry payloads, audit log entries, access log entries, error log entries, and system log entries.

How do I check access logs? ›

Open an FTP client, set a new connection to your server, and then authorize with your login and password. After you have entered a server file directory, you can get your access logs. Here are the two most popular types of HTTP servers and locations where access logs can be found: Apache /var/log/access_log.

How do I view Google Drive logs? ›

Sign in to your Google Admin console. Sign in using your administrator account (does not end in @gmail.com). Investigation tool. select Drive log events.

Where are cloud logs stored? ›

Cloud Storage bucket: Provides storage of log entries in Cloud Storage. The Cloud Storage bucket can be in the same project in which log entries originate, or in a different project. Log entries are stored as JSON files.

How do I check my cloud armor logs in GCP? ›

Viewing logs

You can view the logs for a Google Cloud Armor security policy only in the Google Cloud console. In the Google Cloud console, go to Google Cloud Armor policies. Click more_vert Actions. Select View logs.

Top Articles
The Money Needed To Buy an Annuity: Tips & FAQs
Whats the best van? - Sprinter vs Transit vs Promaster - Van Conversion Comparison Guide
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 5362

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.