# Auditing Service

ESS Auditing Service audits various activities from the ESS services, including itself.

{% hint style="success" %}
For more information on auditing, see [auditing](https://docs.inrupt.com/security/auditing "mention")
{% endhint %}

By default, auditing is enabled and logs the audit events to **`sysout`**.

ESS uses asynchronous messaging for auditing.

To ensure that audit messages are delivered, the Audit Service may send the message more than once.

For instance, multiple instances of the Audit Service may exist when applying configuration changes or when performing a rolling upgrade. During this time, duplicate messages (i.e., messages with the same unique **`id`** value) can occur if the old Audit instance processes a message but shuts down before acknowledging the message on Kafka, and then, the new Audit instance processes the unacknowledged message.

{% hint style="info" %}
**Note**

The Auditing Service continues to run when auditing is disabled; instead, disabling auditing stops the ESS services from publishing audit events.
{% endhint %}

## Audit Events

A complete list of Audit Events can be found at [#audit-events](https://docs.inrupt.com/security/auditing#audit-events "mention"). For auditing event examples, see [appendix-audit-events-examples](https://docs.inrupt.com/security/auditing/appendix-audit-events-examples "mention").

## Integration with External Logging Systems

The ESS Auditing Service can log to:

* **`sysout`** (default)
* Syslog
* [Microsoft Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview)

When logging audit messages to **`sysout`** (the default), Auditing service uses the [shared ESS logging components](https://docs.inrupt.com/ess/2.3/administration/logging), which use JSON as the default formatting for log messages. As such, audit messages logged to **`sysout`** are contained in the **`auditEvent`** field of the log message. The audit event message itself (i.e., the **`auditEvent`** value) is serialized as a JSON-LD documents.

### Integration with Syslog

The ESS Auditing Service can integrate with Syslog. When integrating with Syslog, ESS audit events are converted to [Syslog message format](https://datatracker.ietf.org/doc/html/rfc5424#section-6):

```none
<priority>version timestamp hostname service processId messageId message
```

Where:

* **`hostname`** , **`service`** , **`processId`** and **`messageId`** values are taken extracted from the audit event **`agent`** field.
* **`message`** is the full ESS audit event message in JSON.

For example (the event message has been abbreviated):

```none
<110>1 2022-01-12T20:17:08.387Z ess-pod-storage-84648cfc95-qs865 inrupt-storage-postgres-s3 85 urn:uuid:579668c1-4e14-4fad-aea3-0000000005 { "@context": [ "https://www.w3.org/ns/activitystreams", "https://schema.inrupt.com/audit/v1.jsonld" ], "id": "urn:uuid:579668c1-4e14-4fad-aea3-0000000005", "type": ["Activity", "Create"], "name": "resource-created", "summary": "Resource has been created", ... }
```

By default, the Auditing service logs to **`sysout`** . To have the service output to Syslog instead, see [Manage Auditing](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-auditing).

See also [Syslog configuration options](#auditing-service-syslog-configuration).

For more information on Syslog, see [**RFC 5424**](https://datatracker.ietf.org/doc/html/rfc5424.html).

### Integration with Sentinel

The ESS Auditing Service can integrate with [Microsoft Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview).

When integrating with Microsoft Sentinel, the ESS audit events are converted into a Sentinel-specific format and **`POST`** ’ed to the Sentinel service.

By default, the Auditing Service logs to **`sysout`** . To have the service output to Sentinel instead, see [Manage Auditing](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-auditing).

See also [Sentinel configuration options](#auditing-service-syslog-configuration).

## Configuration

As part of the [installation process](https://docs.inrupt.com/ess/2.3/installation) , Inrupt provides base Kustomize overlays and associated files that require deployment-specific configuration inputs.

The following configuration options are available for the service and may be set as part of [updating the inputs for your deployment](https://docs.inrupt.com/ess/installation#step-1-initialize-the-installation-directory). The Inrupt-provided base Kustomize overlays may be using updated configuration values that differ from the default values.

### Auditing Service: General Configuration

#### QUARKUS\_HTTP\_PORT

*Default* : **`8080`**

The HTTP port the audit service runs on.

#### QUARKUS\_LOG\_LEVEL

*Default* : **`INFO`**

Logging level.

### Audit Service: Kafka

{% hint style="info" %}
**Tip**\
See also [ESS’ Kafka Configuration](https://docs.inrupt.com/ess/latest/services/appendix/appendix-kafka-configuration).
{% endhint %}

#### INRUPT\_KAFKA\_AUDITV1EVENTSENCRYPTED\_CIPHER\_PASSWORD

The strong cipher key to use when running auditing with encrypted messages over the **`auditv1eventsencrypted`** topic.

#### INRUPT\_KAFKA\_AUDITV1EVENTSPRODUCERENCRYPTED\_CIPHER\_PASSWORD

The strong cipher key to use when running auditing with encrypted messages over the **`auditv1eventsproducerencrypted`** topic.

#### KAFKA\_BOOTSTRAP\_SERVERS

*Default* : **`localhost:9092`**

Comma-delimited list of Kafka broker servers for use by ESS services, including this service.

Setting [**`KAFKA_BOOTSTRAP_SERVERS`**](#kafka_bootstrap_servers) [message channels](https://quarkus.io/guides/kafka#kafka-configuration) (e.g., **`solidresource`** and **`auditv1out`** message channels). This service uses the **`auditv1in`** and **`auditv1out`** channels.

{% hint style="info" %}
**Note**\
Inrupt-provided overlays default to using [**`KAFKA_BOOTSTRAP_SERVERS`**](#kafka_bootstrap_servers)

To use a different Kafka instance for the **`auditv1in`** and **`auditv1out`** channels, use specific [message channel](https://quarkus.io/guides/kafka#kafka-configuration) configuration.
{% endhint %}

### Auditing Service: Syslog Configuration

By default, the Auditing service logs to **`sysout`** . To have the service output to Syslog instead:

* Customize your deployment to output to Syslog. See [Manage Auditing](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-auditing) for details.
* Update configuration for Syslog integration. The following configuration options are available for integration with Syslog.

#### INRUPT\_AUDIT\_SYSLOG\_HOST

*Default* : **`localhost`**

The syslog server hostname that the audit service will connect to.

#### INRUPT\_AUDIT\_SYSLOG\_PORT

*Default* : **`514`**

The syslog server port that the audit service will connect to.

#### INRUPT\_AUDIT\_SYSLOG\_PROTOCOL

*Default* : **`SSL_TCP`**

The protocol used to connect to the syslog server. Valid values are:

* **`TCP`**
* **`SSL_TCP`**

### Auditing Service: Sentinel Configuration

By default, the Auditing service logs to **`sysout`** . To have the service output to [Microsoft Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview) instead:

* Customize your deployment to output to Sentinel. See [Manage Auditing](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-auditing) for details.
* Update configuration for Sentinel integration. The following configuration options are available for integration with [Microsoft Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview).

#### INRUPT\_AUDIT\_SENTINEL\_API\_VERSION

The [Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview) API version.

#### INRUPT\_AUDIT\_SENTINEL\_LOG\_TYPE

*Default* : **`Audit`**

The Sentinel [Log-Type](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/data-collector-api#request-headers) of the message.

#### INRUPT\_AUDIT\_SENTINEL\_SHARED\_KEY

Shared key used to access the [Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview) API.

#### INRUPT\_AUDIT\_SENTINEL\_WORKSPACE\_ID

Workspace ID used to access the [Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview) API.

#### QUARKUS\_REST\_CLIENT\_SENTINEL\_API\_URL

The [Sentinel](https://azure.microsoft.com/en-us/services/microsoft-sentinel/#overview) base URL that the audit service will connect to.

### Log Redaction

#### INRUPT\_LOGGING\_REDACTION\_NAME\_ACTION

*Default* : **`REPLACE`**

Type of the redaction to perform. Supported values are:

| Action           | Description                                                                                                                                   |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **`REPLACE`**    | *Default.* Replaces the matching text with a specified replacement.                                                                           |
| **`PLAIN`**      | Leaves the matching field unprocessed. Only available if the redaction target is a field (i.e., **`INRUPT_LOGGING_REDACTION_{NAME}_FIELD`**). |
| **`DROP`**       | Suppresses the matching field. Only available if the redaction target is a field (i.e.,**`INRUPT_LOGGING_REDACTION_{NAME}_FIELD`**).          |
| **`PRIORITIZE`** | Changes the log level of the matching message.                                                                                                |
| **`SHA256`**     | Replaces the matching text with its hash.                                                                                                     |

* If the action is **`REPLACE`** ( *default* ), see also **`INRUPT_LOGGING_REDACTION_{NAME}_REPLACEMENT`** .
* If the action is to **`PRIORITIZE`** , see also **`INRUPT_LOGGING_REDACTION_{NAME}_LEVEL`** .

For more information on log redaction, see [Logging Redaction](https://docs.inrupt.com/ess/2.3/administration/logging/logging-redaction)

#### INRUPT\_LOGGING\_REDACTION\_NAME\_ENABLED

*Default* : **`true`**

A boolean that determines whether the redaction configurations with the specified **`INRUPT_LOGGING_REDACTION_{NAME}_`** prefix is enabled.

For more information on log redaction, see [Logging Redaction](https://docs.inrupt.com/ess/2.3/administration/logging/logging-redaction) .

#### INRUPT\_LOGGING\_REDACTION\_NAME\_EXCEPTION

Fully qualified name of the exception class to match in the log messages (includes inner exception). Configure to target an exception message class.

For more information on log redaction, see [Logging Redaction](https://docs.inrupt.com/ess/2.3/administration/logging/logging-redaction)

#### INRUPT\_LOGGING\_REDACTION\_NAME\_FIELD

Exact name of the field to match in the log messages. Configure to target a specific log message field for redaction.

For more information on log redaction, see [Logging Redaction](https://docs.inrupt.com/ess/2.3/administration/logging/logging-redaction)

#### INRUPT\_LOGGING\_REDACTION\_NAME\_LEVEL

A new log level to use for the log message if the **`INRUPT\_LOGGING\_REDACTION\_{NAME}\_ACTION`** is **`PRIORITIZE`**.

#### INRUPT\_LOGGING\_REDACTION\_NAME\_PATTERN

A regex (see Java regex pattern) to match in the log messages. Configure to target log message text that matches a specified pattern.

For more information on log redaction, see [Logging Redaction](https://docs.inrupt.com/ess/2.3/administration/logging/logging-redaction)

#### INRUPT\_LOGGING\_REDACTION\_NAME\_REPLACEMENT

Replacement text to use if the **`INRUPT\_LOGGING\_REDACTION\_{NAME}\_ACTION`** is **`REPLACE`**.

If unspecified, defaults to **`[REDACTED]`**.

For more information on log redaction, see [Logging Redaction](https://docs.inrupt.com/ess/2.3/administration/logging/logging-redaction)

### Application-Defined Metadata Propagation

#### INRUPT\_AUDIT\_PRODUCER\_REQUEST\_METADATA\_ALLOW

A comma-separated list of application-defined properties that can be included in the associated audit events (unless specified in the corresponding **`INRUPT\_AUDIT\_PRODUCER\_REQUEST\_METADATA\_DENY`**).

This configuration is **case-sensitive** to the propagated properties in the baggage.

{% hint style="info" %}
**Tip**\
To include a propagated property that was added via the [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow) configuration, ensure that the cases of these properties match.
{% endhint %}

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_AUDIT\_PRODUCER\_REQUEST\_METADATA\_DENY

A comma-separated list of application-defined properties to exclude from the associated audit messages. This setting takes precedence over [**`INRUPT_AUDIT_PRODUCER_REQUEST_METADATA_ALLOW`**](#inrupt_audit_producer_request_metadata_allow).

This configuration is **case-sensitive** to the propagated properties in the baggage.

{% hint style="info" %}
**Tip**\
To exclude a propagated property that was added via the [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow) configuration, ensure that the cases of these properties match.
{% endhint %}

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_LOGGING\_REQUEST\_METADATA\_ALLOW

A comma-separated list of application-defined properties that can be included in the associated log messages (unless specified in the corresponding [**`INRUPT_LOGGING_REQUEST_METADATA_DENY`**](#inrupt_logging_request_metadata_deny)).

This configuration is **case-sensitive** to the propagated properties in the baggage.

{% hint style="info" %}
**Tip**\
To include a propagated property that was added via the [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow) configuration, ensure that the cases of these properties match.
{% endhint %}

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_LOGGING\_REQUEST\_METADATA\_DENY

A comma-separated list of application-defined properties to exclude from the associated log messages. This setting takes precedence over [**`INRUPT_LOGGING_REQUEST_METADATA_ALLOW.`**](#inrupt_logging_request_metadata_allow)

This configuration is **case-sensitive** to the propagated properties in the baggage.

{% hint style="info" %}
Tip\
To exclude a propagated property that was added via the [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow) configuration, ensure that the cases of these properties match.
{% endhint %}

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_REQUEST\_METADATA\_PROPAGATOR\_HEADER\_ALLOW

A comma-separated list of non-baggage request headers to add to the baggage (unless specified in the corresponding [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_DENY`**](#inrupt_request_metadata_propagator_header_deny)); i.e., include these non-baggage request headers as application-defined properties.

The configuration is case-insensitive; i.e., the listed headers do **not** need to match the case of the client request headers. For example, a list that includes **`x-correlation-id`** can match **`x-correlation-id`** header, **`X-CoRrElAtIoN-Id`** header, etc.

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_REQUEST\_METADATA\_PROPAGATOR\_HEADER\_DENY

A comma-separated list of non-baggage request headers to exclude from being added to the baggage; i.e., excludes these headers as application-defined properties. This setting takes precedence over [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow).

The configuration is case-insensitive; i.e., the listed headers do **not** need to match the case of the client request headers. For example, a list that includes **`x-correlation-id`** can match (and exclude) **`x-correlation-id`** header, **`X-CoRrElAtIoN-Id`** header, etc.

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_REQUEST\_METADATA\_PROPAGATOR\_HEADER\_OVERRIDES

A flag that determines ESS behavior when metadata property is defined both as a header and as a baggage entry:

* If **`true`** , ESS updates/overrides the baggage entry with the header value.
* If **`false`** (the default), ESS keeps the baggage entry.

For details, [Duplicate Property Definition](https://docs.inrupt.com/ess/administration/application-defined-metadata#duplicate-property-definition).

#### INRUPT\_REQUEST\_METADATA\_REFLECTOR\_HEADER\_ALLOW

A comma-separated list of application-defined properties that can return as response headers (unless specified in the corresponding [**`INRUPT_REQUEST_METADATA_REFLECTOR_HEADER_DENY`**](#inrupt_request_metadata_reflector_header_deny)).

This configuration is **case-sensitive** to the propagated properties in the baggage.

{% hint style="info" %}
Tip

* To return a propagated property that was added via the [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow) configuration, ensure that the cases of these properties match.
* You may need to update **`QUARKUS_HTTP_CORS_EXPOSED_HEADERS`** to extend the list of [CORS-safelisted response headers](https://developer.mozilla.org/en-US/docs/Glossary/CORS-safelisted_response_header) .
  {% endhint %}

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

#### INRUPT\_REQUEST\_METADATA\_REFLECTOR\_HEADER\_DENY

A comma-separated list of application-defined properties to exclude from returning as response headers. This setting takes precedence over [**`INRUPT_REQUEST_METADATA_REFLECTOR_HEADER_ALLOW`**](#inrupt_request_metadata_reflector_header_allow)

This configuration is **case-sensitive** to the propagated properties in the baggage.

{% hint style="info" %}
**Tip**\
To exclude a propagated property that was added via the [**`INRUPT_REQUEST_METADATA_PROPAGATOR_HEADER_ALLOW`**](#inrupt_request_metadata_propagator_header_allow) configuration, ensure that the cases of these properties match.
{% endhint %}

See:

* [Manage Application-Defined Metadata Propagation](https://docs.inrupt.com/ess/2.3/installation/customize-configurations/customization-logging/manage-app-defined-metadata) to configure.
* [Application-Defined Metadata](https://docs.inrupt.com/ess/2.3/administration/application-defined-metadata) for more information.

### Additional Information

See also [Quarkus Configuration Options](https://quarkus.io/guides/all-config)
