temporalio / temporalio/temporal

Allow configuration of expected audience value for Temporal authorization

Open
#5,156 4 comments 4 reactions 1 assignee View on GitHub

@dnr is already working on this.

Since Dec 1, 2023.

Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Author: Dima Ponomarenko

Summary of the feature being proposed

Extend global:authorization section of docker config to allow configuring of expected audience value.
Currently, it's possible to configure JWTClaimMapper via config file. If defaultJWTClaimMapper is used, one of the existing checks there is to validate aud claim against the expected values received from audienceGetter.Audience. But the audienceGetter is not defined by default and the only way to set it is to use custom temporal build. If audienceGetter is not set, 'aud' is not validated at all. There is no way to configure it using docker config file unlike claimMapper and authorizer. Ideally, we should allow specifying the expected audience value in the docker config itself, but I'd like to hear if you can suggest a better way.

What value does this feature bring to Temporal?

This feature will simplify Temporal setup when JWT-based authentication is used.
As an example, Azure Active Directory oAuth2. In's commonly used in enterprise environment, where you must check the aud because application within your organisation share the same JWT signing key. As a result, another application from your org can successfully authenticate and mimic your JWT claims to get access into your system, unless you check aud. https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference#payload-claims

It's possible to build custom Temporal with your own audienceGetter backed in. But it requires more knowledge (including golang) and make is harder to maintain. As well as keeping your custom build up to date.
But I believe the following security feature should be achievable using configuration file and without custom Temporal builds.

Are you willing to implement this feature yourself?

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.