Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions _includes/doc/admin-guide/options/cloud-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## cloud-auth()

*Description:* Configures cloud-based authentication for the syslog-ng-otlp() destination. This option enables OAuth2 authentication for gRPC connections using the syslog-ng cloud authentication framework.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not just for the yslog-ng-otlp(), it is an option fr all the http+grpc based destinations

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud authentication module
instead


The following authentication methods are available:

### oauth2()

Configures OAuth2 authentication for gRPC-based destinations. Tokens are automatically injected into gRPC metadata for each request.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works in http destinations as well
in that case its content added to the HTTP header


The `oauth2()` option supports the following parameters:
- client_id()
- client_secret()
- token_url()
- scope()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and

auth-method(
    basic
    post-body
)
authorization-details(<string>)
refresh-offset(<number>)
resource(<string>)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also,
cloud-auth()
supports

  • azure()
  • gcp()

authentication methods

full keyword list is

  { "cloud_auth",               KW_CLOUD_AUTH },

  { "gcp",                          KW_GCP },
  { "service_account",              KW_SERVICE_ACCOUNT },
  {   "audience",                   KW_AUDIENCE },
  {   "key",                        KW_KEY },
  {   "scope",                      KW_SCOPE },
  {   "token_validity_duration",    KW_TOKEN_VALIDITY_DURATION },
  { "user_managed_service_account", KW_USER_MANAGED_SERVICE_ACCOUNT },
  {   "metadata_url",               KW_METADATA_URL },
  {   "name",                       KW_NAME },

  { "azure",                         KW_AZURE },
  { "app_id",                        KW_APP_ID },
  { "app_secret",                    KW_APP_SECRET },
  { "monitor",                       KW_MONITOR },
  { "tenant_id",                     KW_TENANT_ID },

  { "oauth2",                        KW_OAUTH2 },
  { "auth_method",                   KW_AUTH_METHOD },
  {   "basic",                       KW_BASIC },
  {   "post_body",                   KW_POST_BODY },
  { "authorization_details",         KW_AUTHORIZATION_DETAILS },
  { "client_id",                     KW_CLIENT_ID },
  { "client_secret",                 KW_CLIENT_SECRET },
  { "refresh_offset",                KW_REFRESH_OFFSET },
  { "resource",                      KW_RESOURCE },
  // scope is reused from GCP
  { "token_url",                     KW_TOKEN_URL },

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Available in {{ site.product.short_name }} 4.5 and later versions.

*Description:* This option enables compression in gRPC requests. Currently only deflate-type (similar to gzip) compression is supported.

{% include doc/admin-guide/options/cloud-auth.md %}

## dataset()

| Type:| string|
Expand Down
34 changes: 33 additions & 1 deletion doc/_admin-guide/070_Destinations/045_Google_bigQuery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ description: >-

To configure {{ site.product.short_name }}, the name of the project, the dataset, the name and schema of the used table are necessary.

The authentication is done through Application Default Credentials.
Authentication can be configured using either Google Application Default Credentials (ADC) or OAuth2 via the `cloud-auth()` framework.

By default, the destination uses Google Application Default Credentials (GoogleDefaultCredentials). In production environments, a service account with Workload Identity is recommended.

Alternatively, OAuth2 authentication can be configured explicitly using `cloud-auth(oauth2())`, which injects OAuth2 tokens into gRPC requests.

The destination uses `GoogleDefaultCredentials` for authentication, which covers everything listed in as ADC. Within a production environment, use a service account and Workload Identity.

Expand Down Expand Up @@ -45,4 +49,32 @@ destination d_bigquery {

```

### Example: BigQuery destination configuration with OAuth2 authentication

```config
destination d_bigquery_oauth2 {
bigquery(
project("test-project")
dataset("test-dataset")
table("test-table")

cloud-auth(
oauth2(
client_id("client-id")
client_secret("client-secret")
token_url("https://auth.example.com/token")
scope("https://www.googleapis.com/auth/bigquery")
)
)

schema(
"message" => "${MESSAGE}"
"app" STRING => "${PROGRAM}"
"host" STRING => "${HOST}"
"time" DATETIME => "${ISODATE}"
)
);
}
```

If not specified, the messages are sent with one worker, one message per batch, and without compression.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ version 3.18 and later.

{% include doc/admin-guide/options/cert-file.md %}

{% include doc/admin-guide/options/cloud-auth.md %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

azure-auth-header() is still missing here, even though it can be considered as an obsolete option, it is still the only pure "C" solution, see we should keep it currently


## content-compression()

| Type:| string|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ destination {

{% include doc/admin-guide/options/channel-args.md %}

{% include doc/admin-guide/options/cloud-auth.md %}

{% include doc/admin-guide/options/headers-gRPC.md %}

{% include doc/admin-guide/options/gRPC-keep-alive.md %}
Expand Down
33 changes: 32 additions & 1 deletion doc/_admin-guide/070_Destinations/125_Loki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ description: >-
For more information on the message format, see Grafna Loki HTTP endpoint.
---

### Example: loki() destination configuration
## Authentication

The `loki()` destination supports OAuth2 authentication using the `cloud-auth()` framework for gRPC-based communication.

When configured, OAuth2 access tokens are automatically injected into gRPC requests. This follows the same authentication model used by other cloud-enabled destinations.

## Example: loki() destination configuration

```config
loki(
Expand All @@ -23,3 +29,28 @@ loki(
batch-lines(1000)
);
```

## Example: loki() destination configuration with OAuth2 authentication

```config
loki(
url("loki.example.com:443")

cloud-auth(
oauth2(
client_id("client-id")
client_secret("client-secret")
token_url("https://auth.example.com/token")
scope("loki.write")
)
)

labels(
"app" => "$PROGRAM",
"host" => "$HOST",
)

workers(16)
batch-lines(1000)
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ destination {

{% include doc/admin-guide/options/channel-args.md %}

{% include doc/admin-guide/options/cloud-auth.md %}

## compression()

| Type:| boolean|
Expand Down
19 changes: 19 additions & 0 deletions doc/_admin-guide/070_Destinations/315_syslog-otlp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Advantages of using `syslog-ng-otlp()`:
* The `workers()` option makes the scaling of the driver flexible.
* An integrated application layer acknowledgement is available.
* Google service authentication (ADC or ALTS), and improved load balancing are supported.
* The syslog-ng-otlp() destination supports OAuth2 authentication via cloud-auth(oauth2()).

### Example: Configure syslog-ng-otlp() destination on the sender node

Expand All @@ -18,3 +19,21 @@ destination d_syslog_ng_otlp {
syslog-ng-otlp(url("your-receiver-syslog-ng-instance:4317"));
};
```

### Example: Configure syslog-ng-otlp() destination using OAuth2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though syslog-ng-otlp() is based on opentelemetry() but the server side (source) does not implement oauth2 (yet?!)
so, this will not work between 2 syslog-ng-otlp() peers

just do not not modify this doc file plz


```config
destination d_syslog_ng_otlp {
syslog-ng-otlp(
url("example.com:443")
cloud-auth(
oauth2(
client_id("client-id")
client_secret("client-secret")
token_url("https://auth.example.com/token")
scope("api-scope")
)
)
);
};
```