# Auth Sig V4

Auth Sig V4 (AWS Signature Version 4) is a protocol used to authenticate requests to Amazon Web Services (AWS) APIs. It is a more secure and flexible way to authenticate requests compared to previous versions. The protocol involves a series of steps to create a digital signature based on the request data, which is then included in the Authorization header of the request. This signature is used to verify that the request is authentic and has not been tampered with in transit.

### Configuring OpenSearch Output with Auth Sig V4

Auth Sig V4 can be used to connect to Amazon OpenSearch serverless. To connect and configure the flow collectors output OpenSearch, you can use the following environment variables:

* `EF_OUTPUT_OPENSEARCH_AWS_ACCESS_KEY`: This is the AWS access key ID for the OpenSearch cluster you want to connect to.
* `EF_OUTPUT_OPENSEARCH_AWS_REGION`: This is the AWS region for the OpenSearch cluster you want to connect to.
* `EF_OUTPUT_OPENSEARCH_AWS_SECRET_KEY`: This is the AWS secret access key for the OpenSearch cluster you want to connect to.

### Connecting to AWS OpenSearch Serverless

1. Sign in to your aws account
2. Navigate to the OpenSearch service and click on the "Create a domain" button

   ![create-domain](https://github.com/elastiflow/flowcoll/assets/2789474/73de1a07-6b39-45a7-876e-31bc57e1a384)
3. Fill out the desired configuration for your domain and click "Next"

   ![fill-details](https://github.com/elastiflow/flowcoll/assets/2789474/2599db80-50d7-4cba-b58d-4bdf234b2269)
4. Once you have finished the creation wizard, your domain will be created. You will be able to see the endpoint URL in the "Overview" tab

   ![overview](https://github.com/elastiflow/flowcoll/assets/2789474/05bd7a4d-cc4b-4b86-bdf7-a2a872c0f8c3)
5. Configure the ElastiFlow flow collector's OpenSearch output to include aws related configurations

   ```yaml
   ...
   EF_OUTPUT_OPENSEARCH_AWS_ACCESS_KEY: <your aws access key>
   EF_OUTPUT_OPENSEARCH_AWS_REGION: <your aws region>
   EF_OUTPUT_OPENSEARCH_AWS_SECRET_KEY: <your aws secret key>
   ...
   ```
6. Restart the flow collector, and you should be able to see the flow data in your OpenSearch domain


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://elastiflow.gitbook.io/docs/data-platforms/opensearch/auth-sig-v4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
