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 Wiz SAML User Capability #155

Open
jpautz opened this issue Jul 29, 2023 · 0 comments
Open

Add Wiz SAML User Capability #155

jpautz opened this issue Jul 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jpautz
Copy link

jpautz commented Jul 29, 2023

Description

The wiz_user resource only supports the "Wiz" login type, with no option for SAML integration. The payloads for Update, Read, and Delete are all the same as for the normal user. Where there is a difference is in the Create. A simple extension of the wiz_user to support SAML appears on the surface to have little side effects.

Potential Terraform Configuration

resource "wiz_user" "bobsmith" {
  assigned_project_ids = ["11111-22222-33333-44444-55555"]
  email                = "[email protected]"
  name                 = "Bob Smith"
  role                 = "DOCUMENT_READER"
  idpID                = "GoogleSSO" # this would match the `wiz_saml_idp.name` field
  send_email_invite    = false
}

References

From the Wiz API Console

graphqlClient := graphql.NewClient("https://<wiz-api>/graphql")
graphqlRequest := graphql.NewRequest(`
    mutation CreateSAMLUser($input: CreateSAMLUserInput!) {
        createSAMLUser(input: $input) {
          user {
            id
          }
        }
      }
`)
// Prepare the variables
variablesJSON := `{
  "input": {
    "name": "bobsmith",
    "role": "PROJECT_READER",
    "assignedProjectIds": [
      "11111-22222-33333-44444-55555"
    ],
    "email": "[email protected]",
    "idpID": "MySAMLSSO"
  }
}`

wiz_user's have an ID, which looks something like a UUID. When using a SAML provider named (for example) "GoogleSSO" the ID will be googlesso_<UUID>. It is this behavior that allows all subsequent Read, Update, and Delete operations to be performed on the same base "User" type.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant