Cloud Experts Documentation

Forwarding ROSA HCP Control Plane Audit Logs to Microsoft Sentinel

This content is authored by Red Hat experts, but has not yet been tested on every supported configuration. This guide has been validated on OpenShift 4.22. Operator CRD names, API versions, and console paths may differ on other versions.

Overview

ROSA HCP provides a control plane log forwarder that is a separate system outside your cluster. You can use the control plane log forwarder to send your logs to either an Amazon CloudWatch log group or an Amazon S3 bucket.

This guide walks through one way to get those logs into Microsoft Sentinel, a cloud-native Security Information and Event Management (SIEM) solution. There is no native way to ship control plane logs directly to Sentinel, so you configure the ROSA control plane log forwarder to write to S3, then use an AWS Lambda function (triggered by an SQS queue fed by S3 event notifications) to reshape the audit events and push them into a Microsoft Sentinel custom table through the Azure Monitor Logs Ingestion API.

This guide differs from Forwarding and Monitoring ROSA HCP Control Plane Audit Logs with Filebeat by swapping Filebeat for a serverless Lambda function and a Sentinel destination.

High-Level Audit logs Flow from ROSA HCP to Microsoft Sentinel

Architecture Diagram of logs flow

Prerequisites

  • A ROSA HCP cluster. This guide was validated on ROSA 4.22.
  • ROSA CLI v1.2.64 or later, logged in (rosa login).
  • AWS CLIexternal link (opens in new tab) configured with permissions to create, configure, and delete S3 buckets (including bucket policies and notifications), SQS queues, Lambda functions and event source mappings, CloudWatch log groups, and IAM roles and role policies, including iam:PassRole for the Lambda execution role.
  • Azure CLIexternal link (opens in new tab) 2.61.0 or later, logged in (az login) with permissions to register resource providers and to create and delete a resource group, a Log Analytics workspace, Microsoft Sentinel, Data Collection Endpoints and Rules, and role assignments.
  • Microsoft Entra ID permissions to register an application.
  • jq and zip.
  • A Bash shell. Run all commands in the same shell session so the environment variables stay set.

Install the Azure CLI extensions used in this guide:

Many enterprise tenants disable self-service app registration for regular users. If you see “You don’t have permission to register applications in this directory” when you reach Register an application for the Lambda function , ask your Entra ID admin to either grant you the Application Developer role, enable self-service app registration tenant-wide, or create the app registration for you and share the client ID, tenant ID, and a client secret.

Set environment variables

Set the values you choose once. The remaining values in this guide are captured automatically as resources are created.

Forward control plane logs to S3

For an S3 bucket that uses the default SSE-S3 encryption, as in this guide, the log forwarder does not need an IAM role; the bucket policy created below grants the required access. See Forwarding control plane logs for other destinations and encryption options.

  1. Create the S3 bucket.

    The S3 bucket must be in the same AWS region as the ROSA HCP cluster. ROSA validates bucket accessibility from the cluster’s region. A bucket in a different region fails the pre-flight check with Failed to reach bucket, even if the bucket exists and the policy is correct.

  2. Create a bucket policy that allows the ROSA central log distribution role to write to the bucket, and attach it.

  3. Create the log forwarder configuration and the log forwarder.

    This example only specifies log groups. You can also specify one or more applications in addition to the log groups. See Log groups for the log group types and related applications.

  4. Capture the log forwarder ID and confirm that its status is ready.

    Expected output:

  5. Verify that logs are arriving in S3. The first objects usually appear within a few minutes.

    Expected output (objects are grouped by cluster namespace, application, and pod):

See S3 Log Format for the format produced by the ROSA log forwarder.

Configure the Sentinel workspace, custom table, and Data Collection Rule

Log Analytics and Microsoft Sentinel bill per GB of data ingested, and Kubernetes API server audit logs are high volume. Review Microsoft Sentinel pricingexternal link (opens in new tab) before forwarding production clusters.

  1. Select the subscription, register the resource providers used in this guide, and create the resource group.

  2. Create the Log Analytics workspace, capture its resource ID, and enable Microsoft Sentinel on it.

  3. Create the Data Collection Endpoint (DCE) and capture its resource ID and logs ingestion endpoint.

  4. Create the custom table.

  5. Create the Data Collection Rule (DCR). The DCR declares the incoming stream schema and maps it to the custom table’s output stream.

    If the az rest command fails with InvalidOutputTable, the custom table is not available yet. Wait a minute and run this step again.

Register an application for the Lambda function

The Lambda function authenticates to the Logs Ingestion API as a Microsoft Entra ID application.

  1. Create the app registration and its service principal, and capture the IDs and a client secret.

    If your Entra ID admin created the app registration for you, set APP_ID, TENANT_ID, and CLIENT_SECRET to the values they provided, and set APP_SP_OBJECT_ID with az ad sp show --id "${APP_ID}" --query id --output tsv.

  2. Allow the application to send data through the DCR.

Create the SQS queue and Lambda function

  1. Create an SQS queue and allow the S3 bucket to send messages to it.

    The queue’s visibility timeout must be at least as long as the Lambda function’s timeout (60 seconds in this guide), or Lambda rejects the event source mapping. AWS recommends a visibility timeout of six times the function timeout.

  2. Send S3 object-created events for the log prefix to the queue.

    This command replaces the bucket’s entire notification configuration. Use a bucket dedicated to these logs.

  3. Create the Lambda function code and package it. The function keeps only Kubernetes audit events (records from the audit-logs container) and sets ClusterId to the ROSA cluster ID taken from the record’s namespace.

  4. Create the Lambda execution role. It gets the AWS managed policy for reading from SQS and writing logs, plus read access to objects in the log bucket only.

  5. Create the Lambda function and wait until it is active.

    If this fails with “The role defined for the function cannot be assumed by Lambda”, the new IAM role has not propagated yet. Wait a few seconds and run the command again.

    The client secret is stored as a Lambda environment variable. For production, consider storing it in AWS Secrets Manager.

  6. Connect the SQS queue to the Lambda function and capture the mapping ID.

Validate the setup

  1. Confirm that the event source mapping is enabled.

    Expected output:

    If the output is Creating, wait a few seconds and run the command again.

  2. Query the custom table. New log objects are written every few minutes, and the first rows in a new custom table typically appear within 10 minutes. The Monitoring Metrics Publisher role assignment can take up to 30 minutes to take effect; until then, the Lambda function’s ingestion requests fail with HTTP 403 and SQS retries them.

    The setup is working when the output shows a non-zero Rows count for your cluster ID. If no rows appear after 30 minutes, check the Lambda function’s logs with aws logs tail "/aws/lambda/${LAMBDA_FUNCTION_NAME}" --region "${CLUSTER_REGION}" --since 30m.

You can also browse the data in the Azure portal. In your Log Analytics workspace, select Logs, open the Tables tab, and under Custom Logs select ROSAControlPlaneAudit_CL.

Log Analytics Custom logs

Useful queries

Run these in the Logs view of the workspace.

Clean up

These commands delete the S3 bucket and every object in it, and the entire resource group, including the Log Analytics workspace, all data collected in it, and any other resources in the group.

  1. Remove the log forwarder.

  2. Delete the AWS resources.

  3. Delete the Azure resources.

    If your Entra ID admin created the app registration for you, skip az ad app delete and ask them to remove it.

Back to top

Interested in contributing to these docs?

Collaboration drives progress. Help improve our documentation The Red Hat Way.

Red Hat logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy & sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Subscribe to our newsletter, Red Hat Shares

Sign up now
© 2026 Red Hat