Skip to content

Add support for signature validation for GetJWSDomain API Response #30

@mcieplak

Description

@mcieplak

Please describe the problem that you are trying to solve
After making the GetJWSDomain call to ZMS, the Athenz Syncer should verify the signature of the response before using the domain contents.

Describe the solution you'd like
When the Athenz Syncer is making requests to the GetJWSDomain API, it should verify the signature of the response before setting the Athenz Domain Status field. A sample JWS domain object is shown below.

{
  "payload": "Zm9vYmFyCg==.....",
  "header": {
    "keyid": "zms.key.3.0"
  },
  "signature": "YmFyZm9vCg==...",
  "protected": "YmFyCg==..."
}

As can be seen above, the object consists of the payload, signature, keyid, and the protected fields. Before we can cast the payload into a domain object, we must verify the payload using the keyid specified. The steps are shown below.

  1. Use the Athenz ZMS client GetPublicKeyEntry function to fetch the keyid specified.
  2. Use the zmssvctoken ybase64 DecodeString functionality to decode the key response.
  3. Use a jws library to verify the payload against the signature field using the public key fetched from ZMS.

Additional context
More context can be found in the previous issue which is also a prerequisite to complete this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    HackTogetherFor Yahoo Hack Together eventenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions