{"id":18359007,"url":"https://github.com/ev2900/opensearch_sigv4_iam_auth","last_synced_at":"2026-05-01T19:34:13.450Z","repository":{"id":64988922,"uuid":"580128760","full_name":"ev2900/OpenSearch_Sigv4_IAM_Auth","owner":"ev2900","description":"Authenticate with OpenSearch via. IAM Sigv4","archived":false,"fork":false,"pushed_at":"2026-03-02T18:19:36.000Z","size":215,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-02T21:59:56.367Z","etag":null,"topics":["authentication","aws","iam","opensearch","opensearch-examples","sigv4"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ev2900.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-19T19:43:48.000Z","updated_at":"2026-03-02T18:19:38.000Z","dependencies_parsed_at":"2023-12-15T16:50:47.206Z","dependency_job_id":"9b5f655e-c8cf-404c-affc-f0fb474fc47c","html_url":"https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ev2900/OpenSearch_Sigv4_IAM_Auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Sigv4_IAM_Auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Sigv4_IAM_Auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Sigv4_IAM_Auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Sigv4_IAM_Auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ev2900","download_url":"https://codeload.github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Sigv4_IAM_Auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32510808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","aws","iam","opensearch","opensearch-examples","sigv4"],"created_at":"2024-11-05T22:20:22.544Z","updated_at":"2026-05-01T19:34:13.443Z","avatar_url":"https://github.com/ev2900.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSearch SIGv4 IAM Auth\n\n\u003cimg width=\"275\" alt=\"map-user\" src=\"https://img.shields.io/badge/cloudformation template deployments-14-blue\"\u003e \u003cimg width=\"85\" alt=\"map-user\" src=\"https://img.shields.io/badge/views-1248-green\"\u003e \u003cimg width=\"125\" alt=\"map-user\" src=\"https://img.shields.io/badge/unique visits-521-green\"\u003e\n\nOpenSearch supports multiple authentication types. The simplest is basic authentication, IAM authentication can also be used. To use IAM authentication requests need to be signed with a Sigv4 authentication header.\n\nThe following repository demonstrates how map and IAM user to an OpenSearch role, then how to use the IAM user to make requests to the OpenSearch domain.\n\nFollow the instructions below to walk through an example\n\n1. Run the CloudFormation stack below\n\n[![Launch CloudFormation Stack](https://sharkech-public.s3.amazonaws.com/misc-public/cloudformation-launch-stack.png)](https://console.aws.amazon.com/cloudformation/home#/stacks/new?stackName=open-sigv4\u0026templateURL=https://sharkech-public.s3.amazonaws.com/misc-public/opensearch_Sigv4.yaml)\n\nThe resources created by the CloudFormation stack are documented in the architecture below\n\n\u003cimg width=\"250\" alt=\"map-user\" src=\"https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/blob/main/README/architecture.png\"\u003e\n\n2. Navigate to the to the [opensearch-user on the IAM console](https://us-east-1.console.aws.amazon.com/iam/home#/users/opensearch-user?section=security_credentials) and create an access key\n\n3. Create a AWS CLI profile to store the access key Id and secret access key ```aws configure --profile os-profile```\n\n4. Log into OpenSearch dashboard, map the ARN of the IAM user to an OpenSearch role\n\n\u003cimg width=\"500\" alt=\"map-user\" src=\"https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/blob/main/README/Map_User.png\"\u003e\n\n5. Update and run python script. There are two python scripts you can run. Both do the same thing but use different python libraries. The [opensearchpy_Sigv4.py](https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/blob/main/opensearchpy_Sigv4.py) script uses the [opensearch-py](https://opensearch-project.github.io/opensearch-py/) python library to make requests. The [requests_Sigv4.py](https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/blob/main/requests_Sigv4.py) uses the more generic [requests](https://pypi.org/project/requests/) library to make requests to OpenSearch.\n\nUpdate the *host* and *region* variables in the [opensearchpy_Sigv4.py](https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/blob/main/opensearchpy_Sigv4.py) python script.\n\nUpdate the *host*, *path* and *region* variables in the [requests_Sigv4.py](https://github.com/ev2900/OpenSearch_Sigv4_IAM_Auth/blob/main/requests_Sigv4.py) python script.\n\nThen save and run the script(s)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fev2900%2Fopensearch_sigv4_iam_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fev2900%2Fopensearch_sigv4_iam_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fev2900%2Fopensearch_sigv4_iam_auth/lists"}