Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signature validation for the AthenzDomain Custom Resource #57

Open
mdhume opened this issue Mar 20, 2021 · 0 comments
Open

Add signature validation for the AthenzDomain Custom Resource #57

mdhume opened this issue Mar 20, 2021 · 0 comments
Labels
feature Feature Request HackTogether For Yahoo Hack Together event

Comments

@mdhume
Copy link
Contributor

mdhume commented Mar 20, 2021

Please describe the problem that you are trying to solve
When the Athenz-Istio-Auth controller receives an add or update event for the AthenzDomain custom resource (created by the Athenz Syncer), it should verify the signature of the domain to verify integrity of the data.

Describe the solution you'd like
When the Athenz-Istio-Auth controller receives an add or update event for the AthenzDomain, it should extract the JWS Domain object from the status field of the AthenzDomain CR and verify the signature of the JWS Domain object before processing the domain in the sync function. 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.
@mdhume mdhume added HackTogether For Yahoo Hack Together event feature Feature Request labels Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature Request HackTogether For Yahoo Hack Together event
Projects
None yet
Development

No branches or pull requests

1 participant