-
Notifications
You must be signed in to change notification settings - Fork 125
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
GCE Authenticator #1711
Comments
@InbalZilberman just to verify: we can have one and only one, correct? you can't have any combination and you can't have no constraints at all. |
@InbalZilberman again verifying that i understand correctly - the solution design should introduce a static audience (e.g Writing down some UX options for this for the design:
|
@InbalZilberman Can you have the same
|
@InbalZilberman What is the reason of OR? Are those parameters mutually exclusive? |
Feature Overview
The GCE auth method allows Google Compute Engine (GCE) instances running in Google Cloud Platform to authenticate to DAP/Conjur enable them to fetch secrets. We need authenticate these entities against the Google Cloud APIs.
It is a custom that GCP resources are provided with Google Cloud IAM - Cloud Identity and Access Management (IAM) are mostly handled using service accounts. Hence, we will authenticate resources according to their service account properties.
One can create a GCE even without a service account.
Process Logic for GCE
Constraints
one of the following should be provided
project-id OR service-account-id OR service-account-email
Some info on project_id
Project ID: A customizable unique identifier for your project.
The project ID is a unique, user-assigned ID that can be used by Google APIs. If you do not specify a project ID
during project creation, a project ID will be generated automatically.
The project ID must be a unique string of 6 to 30 lowercase letters, digits, or hyphens. It must start with a
letter, and cannot have a trailing hyphen. You cannot change a project ID once it has been created.
GCE requests its unique identity token (JWT) with format full from the metadata server and specifies the audience of the token to conjur
curl \ --header "Metadata-Flavor: Google" \ --get \ --data-urlencode "audience=conjur" \ --data-urlencode "format=full" \ "http://metadata/computeMetadata/v1/instance/service-accounts/default/identity"
As a result JWT is received
GCE token:
eyJhbGciOiJSUzI1NiIsImtpZCI6IjRlNGViZTQ4N2Q1Y2RmMmIwMjZhM2IyMjlkODZmMGQ0MjU4NDQ5ZmUiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJo
wZXIuZ3NlcnZpY2V...8vSRM1UhkbWIgTK7EE7ewbGZ0BUjMBcLyHcNPZjLebpm2dRSV4aRwwdnTdY2XxFGCOge19O8FTaF0Awv-FupLKwfTqvG6RUv49zABQGQpm
uOp13XYZ6NnORNBuFG6YKs5udBSm2HVP4fyHGWMj4NMwxmKljG3xKAmrhU_xOQZt11TuTfe_vnqp7pt1gtXmdAH9Q5sHqfNODozPAkQyUqO5jmjFJ16
Decrypt JWT fro GCE
POST https:///authn-gce/mygce//myapp/authenticate
with JWT
Header
Content-Type: application/x-www-form-urlencoded
Body
The body must include the GCP access token for GCE instance.
jwt=eyJhbGciOiJSUzI1NiIs......uTonCA
The authenticator is expected to use the certificate of GCP to decode the JWT and then compare the host annotations to the fields in the JWT as follows:
email
authn-gce/service_account_email
google/compute_engine/project_id
authn-gce/project_id
sub
authn-gce/service_account_id
Open issues
global key pair vs service account key pair -
GCE identity - from the "metadata" API
https://cloud.google.com/compute/docs/storing-retrieving-metadata#default
a. Uses the global Google certificate - https://www.googleapis.com/oauth2/v1/certs.
b. IAM identity - from the service account keys API - "https://www.googleapis.com/service_accounts/v1/metadata/x509/%s?alt=json"
https://cloud.google.com/iam/docs/creating-managing-service-account-keys
Can we first check first (a) and if fails try (b) ?
Can the provider-uri be hard coded and not need user input? maybe a global config?
How do we validate the JWT?
Audit
All authentications calls should be audited.
Status API
Any new Authenticator that is added has it's status API
Logging
Are there new log files for this feature? If so, specify how they are called, where, if / how they are rotated and when they are enabled.
Support Matrix
The text was updated successfully, but these errors were encountered: