[Yandex Cloud documentation](../../index.md) > [Tutorials](../index.md) > [Serverless technologies](index.md) > Serverless-based workflows and automation > Configuring responses in Cloud Logging and Yandex Cloud Functions

# Configuring responses in Yandex Cloud Logging and Yandex Cloud Functions


You can configure [Cloud Functions](../../functions/index.md) to automatically respond to audit log events, e.g., to send messages through notification channels you prefer or automatically modify Yandex Cloud resource settings.

## How it works {#scheme}

In general, you will need the following components to configure responses via Cloud Functions:

1. Trail that uploads [audit logs to a log group](../../audit-trails/operations/create-trail.md).
1. [Log group](../../logging/concepts/log-group.md) that acts as an interface between the trail and a Cloud Functions trigger.
1. [Yandex Cloud Logging](../../functions/concepts/trigger/cloud-logging-trigger.md) trigger that invokes a function when adding a record to a log group.
1. [Cloud Functions](../../functions/concepts/function.md) function that implements the response logic.
1. Optional auxiliary component, such as a Telegram bot or mail server.
 
## Implementation example {#example}

[Yc-security-solutions-library](https://github.com/yandex-cloud-examples/yc-security-solutions-library) contains a [solution](https://github.com/yandex-cloud-examples/yc-audit-trails-automatic-response) example that uses Cloud Functions to notify of specific events via a Telegram bot and modify Yandex Cloud resources in line with changes using API methods.

You can get notifications of the following events:

* Security groups: Allowing incoming traffic to all private addresses (`0.0.0.0/0`).
* Object Storage: Enabling public access to buckets.
* Yandex Lockbox: Assigning permissions to a secret. 

The following actions may be performed on Yandex Cloud resources:

* Security groups: Deleting the rule.
* Yandex Lockbox: Removing assigned permissions to the secret.

{% note info %}

[Yandex Cloud Security Solution Library](https://github.com/yandex-cloud-examples/yc-security-solutions-library) is a public repo on GitHub with a set of examples and recommendations on how to build a secure infrastructure in Yandex Cloud.

{% endnote %}

This solution contains the source codes of a Python function and a Terraform script that configures all the required Yandex Cloud components.

## What's next {#whats-next}

* Learn more about the [audit log format](../../audit-trails/concepts/format.md).
* Learn about existing solutions to [export audit logs to SIEM](../../audit-trails/concepts/export-siem.md).