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

Give internal API user admin permission on all silos #1710

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Conversation

leftwo
Copy link
Contributor

@leftwo leftwo commented Sep 13, 2022

This updates the built in user USER_INTERNAL_API to have admin permissions on all silos.

A new constant, USER_INTERNAL_API was added to the PolarClass and a new entry in the
polar config file was added for this user.

Also, the saga_id was added to the logs to assist in tracking a sagas actions through the
authz logs:

{
  "msg": "authorize result",
  "v": 0,
  "name": "9ee34684-9643-4cce-b3af-f7b8825042ea",
  "level": 20,
  "time": "2022-09-13T23:44:08.460180604Z",
  "hostname": "atrium",
  "pid": 10225,
  "saga_node": "FinalizeDiskRecord",
  "actor_id": "001de000-05e4-4000-8000-000000004007",
  "authenticated": true,
  "saga_id": "976b0315-cf99-4d17-bbeb-d5c4e9c2fa55",
  "saga_name": "disk-create",
  "component": "ServerContext",
  "result": "Ok(())",
  "resource": "Database",
  "action": "Query",
  "actor": "Some(Actor::SiloUser { silo_user_id: 001de000-05e4-4000-8000-000000004007, silo_id: 001de000-5110-4000-8000-000000000000, .. })"
}

This updates the built in user USER_INTERNAL_API to have admin
permissions on all silos.

A new constant, USER_INTERNAL_API was added to the PolarClass and
a new entry in the polar config file was added for this user.
@leftwo leftwo requested a review from davepacheco September 13, 2022 23:56
@davepacheco
Copy link
Collaborator

Context for the record: recall that we don't have a plan for internal authz. So when I initially added the "internal API" user, I granted them all privileges by creating a built-in role assignment that grants this user the "fleet admin" role on the sole fleet. After #1580, this no longer granted superuser privileges. This change restores that previous behavior.

Longer term, of course we ought to have a plan for more restricted authz on the internal API.

@leftwo
Copy link
Contributor Author

leftwo commented Sep 14, 2022

Thanks @davepacheco for the extensive help for these changes.

@leftwo leftwo merged commit 111e9d1 into main Sep 14, 2022
@leftwo leftwo deleted the internalauthz branch September 14, 2022 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants