Dieser Parser extrahiert wichtige Informationen wie Zeitstempel, Nutzer-IDs, Quell-IPs, Aktionen und Objekt-IDs aus Logs im JSON- und SYSLOG-Format. Dabei werden Grok-Muster verwendet, um verschiedene Logmeldungsformate abzugleichen und Abweichungen in der Struktur zu berücksichtigen. Außerdem wird ein einheitliches Datenmodell (Unified Data Model, UDM) mit den extrahierten Feldern gefüllt. Der Parser kategorisiert Ereignisse auch anhand von Nutzer- oder IP-Informationen.
Hinweise
Prüfen Sie, ob die folgenden Voraussetzungen erfüllt sind:
Google SecOps-Instanz.
Privilegierter Zugriff auf Google Cloud IAM.
Privilegierter Zugriff auf Google Cloud Storage.
Privilegierter Zugriff auf Jenkins.
Google Cloud Storage-Bucket erstellen
Cloud Storage aufrufen
Erstellen Sie einen neuen Bucket. Wählen Sie einen eindeutigen Namen und eine geeignete Region aus.
Achten Sie darauf, dass der Bucket über die richtigen Zugriffssteuerungen verfügt (z. B. dass nur autorisierte Dienstkonten in den Bucket schreiben können).
Google Cloud Dienstkonto erstellen
Rufen Sie IAM und Verwaltung>Dienstkonten auf.
Erstellen Sie ein neues Dienstkonto. Geben Sie ihm einen beschreibenden Namen, z. B. jenkins-logs.
Weisen Sie dem Dienstkonto die Rolle Storage-Objekt-Ersteller für den GCS-Bucket zu, den Sie im vorherigen Schritt erstellt haben.
Laden Sie eine JSON-Schlüsseldatei für das Dienstkonto herunter.
Google Cloud Storage-Plug-in in Jenkins installieren
Gehen Sie zu Jenkins verwalten>Plug-ins.
Wählen Sie Verfügbare Plug-ins aus.
Suchen Sie nach dem Google Cloud Storage-Plug-in.
Installieren Sie das Plug-in und starten Sie Jenkins bei Bedarf neu.
Google OAuth-Anmeldedaten-Plug-in in Jenkins installieren
Gehen Sie zu Jenkins verwalten>Plug-ins.
Wählen Sie Verfügbare Plug-ins aus.
Suchen Sie nach dem Plug-in Google OAuth Credentials.
Installieren Sie das Plug-in und starten Sie Jenkins bei Bedarf neu.
Jenkins für die Authentifizierung bei Google Cloudkonfigurieren
Rufen Sie Jenkins verwalten>Anmeldedaten>System auf.
Klicken Sie auf
add
Anmeldedaten hinzufügen.
Art: Wählen Sie Google-Dienstkonto von privatem Schlüssel aus.
Projektname: Legen Sie einen Namen für die Anmeldedaten fest.
Laden Sie die JSON-Schlüsseldatei hoch, die Sie beim Erstellen des Dienstkontos erhalten haben. Google Cloud
Klicken Sie auf Erstellen.
Jenkins-Logs für den Upload in Google SecOps konfigurieren
Fügen Sie in der Jenkins-Jobkonfiguration Google Storage Build Log Upload in den Post-Build-Aktionen mit den folgenden Parametern hinzu:
Google Credentials (Google-Anmeldedaten): Der Name der Google-Anmeldedaten, die Sie im vorherigen Schritt erstellt haben.
Log Name (Protokollname): Der Name der Datei, in der das Jenkins-Build-Protokoll unter dem angegebenen Speicherpfad gespeichert werden soll.
Speicherort: Der Name des Buckets, in den Sie Ihre Logs hochladen möchten. Der Bucket muss für das von Ihnen erstellte Dienstkonto zugänglich sein.
Testen Sie den Protokoll-Upload.
Feeds einrichten
So konfigurieren Sie einen Feed:
Rufen Sie die SIEM-Einstellungen>Feeds auf.
Klicken Sie auf Neuen Feed hinzufügen.
Klicken Sie auf der nächsten Seite auf Einen einzelnen Feed konfigurieren.
Geben Sie im Feld Feed name (Feedname) einen Namen für den Feed ein, z. B. Jenkins Logs (Jenkins-Protokolle).
Wählen Sie Google Cloud Storage V2 als Quelltyp aus.
Wählen Sie Jenkins als Logtyp aus.
Klicken Sie auf Dienstkonto abrufen als Chronicle-Dienstkonto.
Geben Sie Werte für die folgenden Eingabeparameter an:
Storage-Bucket-URI: Google Cloud Storage-Bucket-URL im Format gs://my-bucket/<value>.
Optionen zum Löschen von Quellen: Wählen Sie die gewünschte Option aus.
Klicken Sie auf Feed erstellen.
UDM-Zuordnungstabelle
Logfeld
UDM-Zuordnung
Logik
act
security_result.action_details
Aus den Feldern msg1 oder msg2 extrahiert. Stellt die ausgeführte Aktion dar. Vorangehende Leerzeichen werden entfernt.
Daten
principal.user.userid ODER principal.ip ODER metadata.description
Wenn data mit einem IP-Adressmuster übereinstimmt, wird es principal.ip zugeordnet. Wenn sie mit einem Nutzernamenmuster übereinstimmt, wird sie principal.user.userid zugeordnet. Andernfalls wird sie metadata.description zugeordnet.
msg1
target.asset.product_object_id ODER security_result.action_details
Wird verwendet, um object und act zu extrahieren. Wenn / vorhanden ist, wird es in object und act aufgeteilt. Wenn » vorhanden ist, wird es in object und act aufgeteilt. Andernfalls wird es als act behandelt und möglicherweise weiter analysiert.
msg2
metadata.description ODER security_result.action_details
Falls vorhanden, wird sie anfangs metadata.description zugeordnet. Wenn sie „completed:“ enthält, wird der Wert danach extrahiert und security_result.action_details zugeordnet.
Objekt
target.asset.product_object_id
Aus msg1 extrahiert. Stellt das Objekt dar, auf das sich die Aktion bezieht.
object_id
target.resource.attribute.labels.value
Wird aus dem Objekt extrahiert, wenn ein / vorhanden ist. Stellt eine genauere Objektkennung dar. Der Schlüssel ist als „Plugin Name“ hartcodiert.
src_ip
principal.ip
Aus Nachricht oder Daten extrahiert. Stellt die Quell-IP-Adresse dar.
Nutzer
principal.user.userid
Aus Nachricht oder Daten extrahiert. Der Nutzer, der mit dem Ereignis verknüpft ist.
metadata.event_timestamp
Kopiert aus dem berechneten Feld @timestamp.
metadata.event_type
Wird durch die Parserlogik bestimmt. Auf USER_UNCATEGORIZED setzen, wenn user vorhanden ist, auf STATUS_UNCATEGORIZED, wenn src_ip vorhanden ist, und andernfalls auf GENERIC_EVENT.
metadata.product_name
Fest codiert als Jenkins.
metadata.product_version
Fest codiert als Jenkins.
metadata.vendor_name
Fest codiert als JENKINS.
metadata.event_timestamp
Wird aus den Feldern year, month, day, time und ampm erstellt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-02 (UTC)."],[[["\u003cp\u003eThis guide explains how to collect Jenkins logs and send them to Google SecOps for analysis, using a parser to extract key data from JSON and SYSLOG formats.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating a Google Cloud Storage bucket and service account, installing the Google Cloud Storage and OAuth Credentials plugins in Jenkins, and configuring Jenkins to authenticate with Google Cloud.\u003c/p\u003e\n"],["\u003cp\u003eJenkins logs are uploaded to a specified storage location through the configuration of post-build actions and setting Google Cloud as a destination.\u003c/p\u003e\n"],["\u003cp\u003eA feed in Google SecOps is configured to ingest the uploaded Jenkins logs, specifying the source type, log type, and storage bucket URI, along with other parameters for data handling.\u003c/p\u003e\n"],["\u003cp\u003eThe parser will map the Jenkins logs data into the unified data model (UDM), specifying the mapping between the fields in Jenkins logs and UDM fields.\u003c/p\u003e\n"]]],[],null,["# Collect Jenkins logs\n====================\n\nSupported in: \nGoogle secops [SIEM](/chronicle/docs/secops/google-secops-siem-toc)\n| **Note:** This feature is covered by [Pre-GA Offerings Terms](https://chronicle.security/legal/service-terms/) of the Google Security Operations Service Specific Terms. Pre-GA features might have limited support, and changes to pre-GA features might not be compatible with other pre-GA versions. For more information, see the [Google SecOps Technical Support Service guidelines](https://chronicle.security/legal/technical-support-services-guidelines/) and the [Google SecOps Service Specific Terms](https://chronicle.security/legal/service-terms/).\n\nOverview\n--------\n\nThis parser extracts key information such as timestamps, user IDs, source IPs, actions, and object IDs from JSON and SYSLOG formatted logs. It uses grok patterns to match various log message formats, handling variations in structure, and populates a unified data model (UDM) with the extracted fields. The parser also categorizes events based on the presence of user or IP information.\n\nBefore you begin\n----------------\n\nEnsure that you have the following prerequisites:\n\n- Google SecOps instance.\n- Privileged access to Google Cloud IAM.\n- Privileged access to Google Cloud Storage.\n- Privileged access to Jenkins.\n\nCreate a Google Cloud Storage Bucket\n------------------------------------\n\n1. Go to **Cloud Storage**.\n2. Create a new bucket. Choose a unique name and appropriate region.\n3. Ensure the bucket has proper access controls (for example, only authorized service accounts can write to it).\n\nCreate a Google Cloud Service account\n-------------------------------------\n\n1. Go to **IAM \\& Admin** \\\u003e **Service Accounts**.\n2. Create a new service account. Give it a descriptive name (for example, **jenkins-logs**).\n3. Grant the service account the **Storage Object Creator** role on the GCS bucket you created in the previous step.\n4. Create an SSH key for your service account: [Create and delete service account keys](/iam/docs/keys-create-delete).\n5. Download a JSON key file for the service account.\n\n | **Note:** Keep this file secure. You will need it for the **Google OAuth Credentials** plugin to create credentials.\n\nInstall Google Cloud Storage plugin in Jenkins\n----------------------------------------------\n\n1. Go to **Manage Jenkins** \\\u003e **Plugins**.\n2. Select **Available plugins**.\n3. Search for the **Google Cloud Storage** plugin.\n4. Install the plugin and restart Jenkins if required.\n\nInstall Google OAuth Credentials Plugin in Jenkins\n--------------------------------------------------\n\n1. Go to **Manage Jenkins** \\\u003e **Plugins**.\n2. Select **Available plugins**\n3. Search for the **Google OAuth Credentials** plugin.\n4. Install the plugin and restart Jenkins if required.\n\nConfigure Jenkins to authenticate with Google Cloud\n---------------------------------------------------\n\n1. Go to **Manage Jenkins** \\\u003e **Credentials** \\\u003e **System**.\n\n | **Note:** You can use **Global Credentials** or add a new domain (recommended).\n2. Click add **Add Credentials**.\n\n3. **Kind** : select **Google Service Account from private key**.\n\n4. **Project name**: set a name for the credentials.\n\n5. Upload the JSON key file you obtained during the Google Cloud Service account creation.\n\n6. Click **Create**.\n\nConfigure Jenkins logs to upload Google SecOps\n----------------------------------------------\n\n1. In the Jenkins job configuration, add **Google Storage Build Log Upload** in post-build actions, with the following parameters:\n - **Google Credentials**: The name of your Google credentials you created in the previous step.\n - **Log Name**: The name of the file to store the Jenkins build log, under the specified storage path.\n - **Storage Location**: The name of the bucket where you want to upload your logs. The bucket must be accessible to the service account you created.\n2. Test the log upload.\n\nSet up feeds\n------------\n\nTo configure a feed, follow these steps:\n\n1. Go to **SIEM Settings** \\\u003e **Feeds**.\n2. Click **Add New Feed**.\n3. On the next page, click **Configure a single feed**.\n4. In the **Feed name** field, enter a name for the feed; for example, **Jenkins Logs**.\n5. Select **Google Cloud Storage V2** as the **Source type**.\n6. Select **Jenkins** as the **Log type**.\n7. Click **Get Service Account** as the **Chronicle Service Account**.\n8. Specify values for the following input parameters:\n\n - **Storage Bucket URI** : Google Cloud storage bucket URL in **`gs://my-bucket/\u003cvalue\u003e`** format.\n - **Source deletion options**: select deletion option according to your preference.\n\n | **Note:** If you select the `Delete transferred files` or `Delete transferred files and empty directories` option, make sure that you granted appropriate permissions to the service account. \\* **Maximum File Age**: Includes files modified in the last number of days. Default is 180 days.\n9. Click **Create Feed**.\n\nUDM Mapping Table\n-----------------\n\n**Need more help?** [Get answers from Community members and Google SecOps professionals.](https://security.googlecloudcommunity.com/google-security-operations-2)"]]