{"id":13808646,"url":"https://github.com/BigThinkcode/ex_aws_msk_iam_auth","last_synced_at":"2025-05-14T02:32:13.928Z","repository":{"id":175480998,"uuid":"556670165","full_name":"BigThinkcode/ex_aws_msk_iam_auth","owner":"BigThinkcode","description":"AWS_MSK_IAM Authentication Plugin for Broadway Kafka","archived":false,"fork":false,"pushed_at":"2023-06-12T14:24:34.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-22T13:33:25.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BigThinkcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-10-24T09:35:16.000Z","updated_at":"2024-03-18T18:52:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b2caf91-0a01-47ad-acf6-3726edc4716f","html_url":"https://github.com/BigThinkcode/ex_aws_msk_iam_auth","commit_stats":null,"previous_names":["bigthinkcode/ex_aws_msk_iam_auth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigThinkcode%2Fex_aws_msk_iam_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigThinkcode%2Fex_aws_msk_iam_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigThinkcode%2Fex_aws_msk_iam_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigThinkcode%2Fex_aws_msk_iam_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BigThinkcode","download_url":"https://codeload.github.com/BigThinkcode/ex_aws_msk_iam_auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225273255,"owners_count":17448074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-04T01:01:48.006Z","updated_at":"2024-11-19T00:30:56.277Z","avatar_url":"https://github.com/BigThinkcode.png","language":"Elixir","funding_links":[],"categories":["Authentication"],"sub_categories":[],"readme":"# ex_aws_msk_iam_auth\n\n`ex_aws_msk_iam_auth` is an authentication plugin for broadway_kafka. It enables Broadway Kafka clients to authenticate with Amazon's Managed Streaming for Apache Kafka(Amazon MSK) via [AWS_MSK_IAM](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html) SASL mechanism.\n\n\n## Installation\n\nAdd the following dependency to your `mix.exs`\n```elixir\ndef deps do\n  [\n    {:ex_aws_msk_iam_auth, git: \"https://github.com/BigThinkcode/ex_aws_msk_iam_auth\"}\n  ]\nend\n```\n\n## Usage\n\nBroadway Kafka supports connecting to Kafka broker via SASL authentication. The following sample configuration shows how `ex_aws_msk_iam_auth` plugin can be used with it.\n \nRef: https://hexdocs.pm/broadway_kafka/BroadwayKafka.Producer.html#module-client-config-options\n\n```elixir\n  client_config: [\n            sasl:\n              {\n                :callback, \n                ExAwsMskIamAuth, \n                {:AWS_MSK_IAM, \"AWS_ACCESS_KEY_ID\", \"AWS_SECRET_ACCESS_KEY\"}\n              },\n            ssl: true\n          ]\n```\n\n## Background\n\n### Broadway Kafka and brod\n[Broadway Kafka](https://github.com/dashbitco/broadway_kafka) is a Kafka Connector for [Broadway](https://github.com/dashbitco/broadway) - an Elixir library to build concurrent, multi-stage data ingestion/processing pipelines with Elixir.\nBroadway Kafka is an amalgamation of awesome features from Broadway with Kafka as a producer. Internally, it uses [brod](https://github.com/kafka4beam/brod) as its Kafka client acting as a wrapper. Brod supports `SASL PLAIN`, `SCRAM-SHA-256` and `SCRAM-SHA-512` authentication mechanisms out of the box and also offers extension points to support custom [authentication plugins](https://github.com/kafka4beam/brod#authentication-support). \n\n### AWS MSK Authentication Mechanisms\nMSK supports two variants - MSK Fully Managed and MSK Serverless. In both the variants, Kafka service can be protected via SASL, in particular, AWS's custom SASL mechanism AWS_MSK_IAM(https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html). At the time of writing this library, MSK's Serverless variant's only supported authentication was AWS_MSK_IAM SASL mechanism.\n\n### Solution Diagram\n![Solution Diagram](solution.png)\n\n### Implementation\nThis library takes inspiration from its Java counterpart [aws-msk-iam-auth](https://github.com/aws/aws-msk-iam-auth)\n\n### Relevant Issues/PRs\n1. https://github.com/dashbitco/broadway_kafka/issues/82\n2. https://github.com/dashbitco/broadway_kafka/pull/85\n3. https://github.com/aws-beam/aws_signature/issues/14\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBigThinkcode%2Fex_aws_msk_iam_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBigThinkcode%2Fex_aws_msk_iam_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBigThinkcode%2Fex_aws_msk_iam_auth/lists"}