> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connecting Wiz to Nebius AI Cloud

Nebius AI Cloud supports integration with [Wiz](https://www.wiz.io), a cloud security platform that inventories cloud resources and assesses how they are configured. Wiz collects information about your resources in Compute, Managed Service for Kubernetes®, Virtual Networks and Object Storage to detect misconfigurations and notify you about them.

To scan a Nebius AI Cloud tenant, Wiz uses a *connector* that authenticates as a Nebius AI Cloud [service account](https://docs.nebius.com/iam/service-accounts/authentication.md) and makes read-only API requests. One connector covers a single tenant and discovers the projects that its service account can access, including the projects that you create later.

This guide explains how to prepare the Nebius AI Cloud side of the connection: create a service account for Wiz, give it read access to your resources and issue an [authorized key](https://docs.nebius.com/iam/service-accounts/authorized-keys.md) for it. After that, you pass the credentials of the service account to Wiz.

> [!NOTE]
>
> For Nebius AI Cloud, Wiz agentless disk scanning is unavailable. Only scanning through the API is supported.

## Prerequisites

> [tab] Web console
>
> 1. Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the `admin` role within your tenant or project; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> 2. Get access to [Wiz](https://app.wiz.io) by using a role that has write permissions for deployments.
>
>    For more details, see the [Wiz documentation](https://docs.wiz.io/docs/user-roles-settings) (requires logging in).

> [tab] CLI
>
> 1. [Install and configure](https://docs.nebius.com/cli/install.md) the Nebius AI Cloud CLI.
>
> 2. Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
>    ```bash theme={null}
>    cat ~/.nebius/config.yaml
>    ```
>
> 3. Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the `admin` role within your tenant or project; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> 4. Get access to [Wiz](https://app.wiz.io) by using a role that has write permissions for deployments.
>
>    For more details, see the [Wiz documentation](https://docs.wiz.io/docs/user-roles-settings) (requires logging in).

> [tab] Terraform
>
> 1. [Install and configure](https://docs.nebius.com/terraform-provider/install.md) the Nebius AI Cloud provider for Terraform.
>
> 2. Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the `admin` role within your tenant or project; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> 3. Get access to [Wiz](https://app.wiz.io) by using a role that has write permissions for deployments.
>
>    For more details, see the [Wiz documentation](https://docs.wiz.io/docs/user-roles-settings) (requires logging in).

> [tab] Go SDK
>
> 1. [Install and initialize the Nebius SDK for Go](https://docs.nebius.com/sdk/go/install-auth.md).
>
> 2. Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the `admin` role within your tenant or project; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> 3. Get access to [Wiz](https://app.wiz.io) by using a role that has write permissions for deployments.
>
>    For more details, see the [Wiz documentation](https://docs.wiz.io/docs/user-roles-settings) (requires logging in).

> [tab] Python SDK
>
> 1. [Install and initialize the Nebius SDK for Python](https://docs.nebius.com/sdk/python/install-auth.md).
>
> 2. Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the `admin` role within your tenant or project; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> 3. Get access to [Wiz](https://app.wiz.io) by using a role that has write permissions for deployments.
>
>    For more details, see the [Wiz documentation](https://docs.wiz.io/docs/user-roles-settings) (requires logging in).

> [tab] JavaScript SDK
>
> 1. [Install and initialize the Nebius SDK for JavaScript](https://docs.nebius.com/sdk/javascript/install-auth.md).
>
> 2. Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the `admin` role within your tenant or project; for example, the default `admins` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> 3. Get access to [Wiz](https://app.wiz.io) by using a role that has write permissions for deployments.
>
>    For more details, see the [Wiz documentation](https://docs.wiz.io/docs/user-roles-settings) (requires logging in).

## Steps

### Create a service account

Create a dedicated service account for Wiz. This way, the access of the connector does not depend on the accounts that you use for other purposes.

> [tab] Web console
>
> 1. In the sidebar, go to  **Administration** → **IAM**.
> 2. Click **Create resource** → **Service account**.
> 3. In the window that opens, specify the service account name (for example, `wiz-scanner`) and select the project.
> 4. Click **Create and continue**.

> [tab] CLI
>
> Create a service account and save its ID to an environment variable:
>
> ```bash theme={null}
> export SA_ID=$(nebius iam service-account create \
>   --name wiz-scanner \
>   --format jsonpath='{.metadata.id}')
> ```

> [tab] Terraform
>
> 1. Create the following configuration:
>
>    ```hcl theme={null}
>    resource "nebius_iam_v1_service_account" "wiz_scanner" {
>      name      = "wiz-scanner"
>      parent_id = "<project_ID>"
>    }
>    ```
>
>    In the configuration, specify the [project ID](https://docs.nebius.com/iam/manage-projects.md#how-to-get-a-project-id-terraform) in `parent_id`.
>
> 2. Add an output that returns the ID of the service account:
>
>    ```hcl theme={null}
>    output "service_account_id" {
>      value = nebius_iam_v1_service_account.wiz_scanner.id
>    }
>    ```
>
> 3. Check that the configuration is correct:
>    ```bash theme={null}
>    terraform validate
>    ```
>
> 4. Apply the changes:
>    ```bash theme={null}
>    terraform apply
>    ```

> [tab] Go SDK
>
> Create a service account. The code prints its ID, which you use in the next steps:
>
> ```go theme={null}
> serviceAccountOperation, err := sdk.Services().IAM().V1().
>     ServiceAccount().Create(
>         ctx,
>         &iam.CreateServiceAccountRequest{
>             Metadata: &common.ResourceMetadata{
>                 Name: "wiz-scanner",
>             },
>             Spec: &iam.ServiceAccountSpec{},
>         },
>     )
> if err != nil {
>     return err
> }
> if _, err = serviceAccountOperation.Wait(ctx); err != nil {
>     return err
> }
> serviceAccountID := serviceAccountOperation.ResourceID()
> fmt.Println(serviceAccountID)
> ```

> [tab] Python SDK
>
> Create a service account. The code prints its ID, which you use in the next steps:
>
> ```python theme={null}
> service_account_service = ServiceAccountServiceClient(sdk)
> service_account_operation = await service_account_service.create(
>     CreateServiceAccountRequest(
>         metadata=ResourceMetadata(name="wiz-scanner"),
>         spec=ServiceAccountSpec(),
>     ),
> )
> await service_account_operation.wait()
> service_account_id = service_account_operation.resource_id
> print(service_account_id)
> ```

> [tab] JavaScript SDK
>
> Create a service account. The code prints its ID, which you use in the next steps:
>
> ```ts theme={null}
> const serviceAccountService =
>   new ServiceAccountService(sdk);
> const serviceAccountOperation =
>   await serviceAccountService.create(
>     CreateServiceAccountRequest.create({
>       metadata: ResourceMetadata.create({
>         name: "wiz-scanner",
>       }),
>       spec: ServiceAccountSpec.create({}),
>     }),
>   ).result;
> await serviceAccountOperation.wait();
> const serviceAccountId = serviceAccountOperation.resourceId();
> console.log(serviceAccountId);
> ```

### Add the service account to the group

The group to which you add the connector's service account manages its access to your resources:

* To let the connector read the configuration of your resources, add the service account to the default `viewers` group. This group has the tenant-wide `viewer` role, so the connector can view the resources of all projects in the tenant. The `viewer` role also provides access to the data in your resources.

* If you want the connector to read the configuration of your resources without access to the data in them, grant the `security-auditor` role to a custom group and add the service account to this group instead. For instructions, see [Managing custom groups](https://docs.nebius.com/iam/authorization/groups/manage.md).

For more details, see [Security roles](https://docs.nebius.com/iam/authorization/roles.md#security).

> [tab] Web console
>
> 1. In the sidebar, go to  **Administration** → **IAM**.
> 2. On the **Groups** tab, click the **viewers** group.
> 3. On the group page, click **Manage** → **Members**.
> 4. In the window that opens, switch to the **Service accounts** tab.
> 5. Select the project in which you created the service account.
> 6. Find the service account and click  **Add** next to its name.

> [tab] CLI
>
> 1. Get and copy the ID of the `viewers` group:
>
>    ```bash theme={null}
>    nebius iam group get-by-name \
>      --name viewers --parent-id <tenant_ID> \
>      --format jsonpath='{.metadata.id}'
>    ```
>
>    In the command, specify the [tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-cli).
>
> 2. Add the service account to the group:
>
>    ```bash theme={null}
>    nebius iam group-membership create \
>      --parent-id <viewers_group_ID> \
>      --member-id $SA_ID
>    ```

> [tab] Terraform
>
> 1. Add a data source that gets the `viewers` group by its name:
>
>    ```hcl theme={null}
>    data "nebius_iam_v1_group" "viewers" {
>      name      = "viewers"
>      parent_id = "<tenant_ID>"
>    }
>    ```
>
>    In the configuration, specify the [tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id) in `parent_id`.
>
> 2. Add the service account to the group:
>
>    ```hcl theme={null}
>    resource "nebius_iam_v1_group_membership" "wiz_scanner_viewers" {
>      parent_id = data.nebius_iam_v1_group.viewers.id
>      member_id = nebius_iam_v1_service_account.wiz_scanner.id
>    }
>    ```
>
> 3. Check that the configuration is correct:
>    ```bash theme={null}
>    terraform validate
>    ```
>
> 4. Apply the changes:
>    ```bash theme={null}
>    terraform apply
>    ```

> [tab] Go SDK
>
> 1. Get the ID of the `viewers` group:
>
>    ```go theme={null}
>    viewersGroup, err := sdk.Services().IAM().V1().Group().
>        GetByName(
>            ctx,
>            &iam.GetGroupByNameRequest{
>                ParentId: "<tenant_ID>",
>                Name:     "viewers",
>            },
>        )
>    if err != nil {
>        return err
>    }
>    viewersGroupID := viewersGroup.GetMetadata().GetId()
>    fmt.Println(viewersGroupID)
>    ```
>
>    In the code, set the [tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-go-sdk) in `ParentId`.
>
> 2. Add the service account to the group:
>
>    ```go theme={null}
>    membershipOperation, err := sdk.Services().IAM().V1().
>        GroupMembership().Create(
>            ctx,
>            &iam.CreateGroupMembershipRequest{
>                Metadata: &common.ResourceMetadata{
>                    ParentId: "<viewers_group_ID>",
>                },
>                Spec: &iam.GroupMembershipSpec{
>                    MemberId: "<service_account_ID>",
>                },
>            },
>        )
>    if err != nil {
>        return err
>    }
>    if _, err = membershipOperation.Wait(ctx); err != nil {
>        return err
>    }
>    ```
>
>    In the code, set the ID of the `viewers` group in `Metadata.ParentId` and the ID of the service account in `Spec.MemberId`.

> [tab] Python SDK
>
> 1. Get the ID of the `viewers` group:
>
>    ```python theme={null}
>    group_service = GroupServiceClient(sdk)
>    viewers_group = await group_service.get_by_name(
>        GetGroupByNameRequest(
>            parent_id="<tenant_ID>",
>            name="viewers",
>        ),
>    )
>    viewers_group_id = viewers_group.metadata.id
>    print(viewers_group_id)
>    ```
>
>    In the code, set the [tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-python-sdk) in `parent_id`.
>
> 2. Add the service account to the group:
>
>    ```python theme={null}
>    membership_service = GroupMembershipServiceClient(sdk)
>    membership_operation = await membership_service.create(
>        CreateGroupMembershipRequest(
>            metadata=ResourceMetadata(
>                parent_id="<viewers_group_ID>",
>            ),
>            spec=GroupMembershipSpec(
>                member_id="<service_account_ID>",
>            ),
>        ),
>    )
>    await membership_operation.wait()
>    ```
>
>    In the code, set the ID of the `viewers` group in `metadata.parent_id` and the ID of the service account in `spec.member_id`.

> [tab] JavaScript SDK
>
> 1. Get the ID of the `viewers` group:
>
>    ```ts theme={null}
>    const groupService = new GroupService(sdk);
>    const viewersGroup = await groupService.getByName(
>      GetGroupByNameRequest.create({
>        parentId: "<tenant_ID>",
>        name: "viewers",
>      }),
>    );
>    const viewersGroupId = viewersGroup.metadata?.id;
>    console.log(viewersGroupId);
>    ```
>
>    In the code, set the [tenant ID](https://docs.nebius.com/iam/get-tenants.md#how-to-get-a-tenant-id-javascript-sdk) in `parentId`.
>
> 2. Add the service account to the group:
>
>    ```ts theme={null}
>    const membershipService = new GroupMembershipService(sdk);
>    const membershipOperation = await membershipService.create(
>      CreateGroupMembershipRequest.create({
>        metadata: ResourceMetadata.create({
>          parentId: "<viewers_group_ID>",
>        }),
>        spec: GroupMembershipSpec.create({
>          memberId: "<service_account_ID>",
>        }),
>      }),
>    ).result;
>    await membershipOperation.wait();
>    ```
>
>    In the code, set the ID of the `viewers` group in `metadata.parentId` and the ID of the service account in `spec.memberId`.

### Create an authorized key

Wiz authenticates as the service account by using an authorized key pair: you upload the public key to Nebius AI Cloud and pass the private key to Wiz.

1. Create a key pair on your local machine:

   ```bash theme={null}
   openssl genrsa -out private.pem 4096 && \
   openssl rsa -in private.pem -outform PEM -pubout -out public.pem
   ```

   This command creates the `public.pem` and `private.pem` key files in the directory where you run it. If you use Terraform or an SDK, run the command in the directory with your configuration or code.

2. Upload the public key and get the ID of the created authorized key:

   > [tab] Web console
   >
   > 1. In the [web console](https://console.nebius.com), go to  **Administration** → **IAM**.
   > 2. Open the **Service accounts** tab.
   > 3. Open the page of the required service account.
   > 4. Click  **Upload authorized key**.
   > 5. Click  **Attach file** and then select `public.pem`.
   > 6. (Optional) Set an expiration date.
   > 7. Click **Upload key**.
   >
   > The key is displayed on the **Authorized keys** tab.
   >
   > On the **Authorized keys** tab, click  next to the ID of the public key that you uploaded. You will specify this ID in Wiz.

   > [tab] CLI
   >
   > ```bash theme={null}
   > nebius iam auth-public-key create \
   >   --account-service-account-id $SA_ID \
   >   --data "$(cat public.pem)" \
   >   --format jsonpath='{.metadata.id}'
   > ```
   >
   > The command returns the ID of the authorized key. You will specify this ID in Wiz.
   >
   > To set an expiration date for the key, add the `--expires-at` parameter with a timestamp in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `--expires-at <YYYY-MM-DDThh:mm:ssZ>`. The date must be in the future.

   > [tab] Terraform
   >
   > 1. Add the authorized key to the configuration:
   >
   >    ```hcl theme={null}
   >    resource "nebius_iam_v1_auth_public_key" "wiz_scanner_key" {
   >      parent_id = "<project_ID>"
   >
   >      account = {
   >        service_account = {
   >          id = nebius_iam_v1_service_account.wiz_scanner.id
   >        }
   >      }
   >
   >      data       = file("${path.module}/public.pem")
   >      expires_at = "<expiration_date>"
   >    }
   >
   >    output "authorized_key_id" {
   >      value = nebius_iam_v1_auth_public_key.wiz_scanner_key.id
   >    }
   >    ```
   >
   >    The configuration reads the public key from the `public.pem` file. In the configuration, specify the following values:
   >
   >    * `parent_id`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#how-to-get-a-project-id-terraform).
   >    * `expires_at`: Expiration date of the key, a timestamp in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDThh:mm:ssZ`. The date must be in the future. To create a key without an expiration date, remove the `expires_at` line.
   >
   > 2. Check that the configuration is correct:
   >    ```bash theme={null}
   >    terraform validate
   >    ```
   >
   > 3. Apply the changes:
   >    ```bash theme={null}
   >    terraform apply
   >    ```
   >
   > 4. Get the ID of the authorized key:
   >
   >    ```bash theme={null}
   >    terraform output -raw authorized_key_id
   >    ```
   >
   >    You will specify this ID in Wiz.

   > [tab] Go SDK
   >
   > ```go theme={null}
   > publicKeyData, err := os.ReadFile("public.pem")
   > if err != nil {
   >     return err
   > }
   > authPublicKeyService := sdk.Services().IAM().V1().
   >     AuthPublicKey()
   > authPublicKeyOperation, err := authPublicKeyService.Create(
   >     ctx,
   >     &iam.CreateAuthPublicKeyRequest{
   >         Spec: &iam.AuthPublicKeySpec{
   >             Account: &iam.Account{
   >                 Type: &iam.Account_ServiceAccount_{
   >                     ServiceAccount: &iam.Account_ServiceAccount{
   >                         Id: "<service_account_ID>",
   >                     },
   >                 },
   >             },
   >             Data: string(publicKeyData),
   >         },
   >     },
   > )
   > if err != nil {
   >     return err
   > }
   > authPublicKeyOperation, err = authPublicKeyOperation.Wait(ctx)
   > if err != nil {
   >     return err
   > }
   > fmt.Println(authPublicKeyOperation.ResourceID())
   > ```
   >
   > In the code, set the ID of the service account in `ServiceAccount.Id`. The code reads the public key from the `public.pem` file and prints the ID of the authorized key. You will specify this ID in Wiz.

   > [tab] Python SDK
   >
   > ```python theme={null}
   > public_key = Path("public.pem").read_text()
   > auth_public_key_service = AuthPublicKeyServiceClient(sdk)
   > auth_public_key_operation = await auth_public_key_service.create(
   >     CreateAuthPublicKeyRequest(
   >         spec=AuthPublicKeySpec(
   >             account=Account(
   >                 service_account=Account__ServiceAccount(
   >                     id="<service_account_ID>",
   >                 ),
   >             ),
   >             data=public_key,
   >         ),
   >     ),
   > )
   > await auth_public_key_operation.wait()
   > print(auth_public_key_operation.resource_id)
   > ```
   >
   > In the code, set the ID of the service account in `service_account.id`. The code reads the public key from the `public.pem` file and prints the ID of the authorized key. You will specify this ID in Wiz.

   > [tab] JavaScript SDK
   >
   > ```ts theme={null}
   > const publicKey = readFileSync("public.pem", "utf8");
   > const authPublicKeyService = new AuthPublicKeyService(sdk);
   > const authPublicKeyOperation =
   >   await authPublicKeyService.create(
   >     CreateAuthPublicKeyRequest.create({
   >       metadata: ResourceMetadata.create({
   >         parentId: "<project_ID>",
   >       }),
   >       spec: AuthPublicKeySpec.create({
   >         account: Account.create({
   >           type: {
   >             $case: "serviceAccount",
   >             serviceAccount: Account_ServiceAccount.create({
   >               id: "<service_account_ID>",
   >             }),
   >           },
   >         }),
   >         data: publicKey,
   >       }),
   >     }),
   >   ).result;
   > await authPublicKeyOperation.wait();
   > console.log(authPublicKeyOperation.resourceId());
   > ```
   >
   > In the code, set the following values:
   >
   > * `metadata.parentId`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#how-to-get-a-project-id-javascript-sdk).
   > * `serviceAccount.id`: ID of the service account.
   >
   > The code reads the public key from the `public.pem` file and prints the ID of the authorized key. You will specify this ID in Wiz.

> [!TIP]
>
> After you pass the private key to Wiz, store it in [SecretStash](https://docs.nebius.com/mysterybox/overview.md) and delete the local copy. This way, the key is kept encrypted and you can access it later without keeping a file on your local machine.

### Create a connector in Wiz

In Wiz, create a connector for Nebius AI Cloud and specify the following values:

* ID of the service account:

  > [tab] Web console
  >
  > In the sidebar, go to  **Administration** → **IAM**. On the **Service accounts** tab, find the service account that you created and copy its ID.

  > [tab] CLI
  >
  > Get the ID from the environment variable:
  >
  > ```bash theme={null}
  > echo $SA_ID
  > ```

  > [tab] Terraform
  >
  > Get the ID from the output of the configuration:
  >
  > ```bash theme={null}
  > terraform output -raw service_account_id
  > ```

  > [tab] Go SDK
  >
  > Use the ID that the code printed when you [created the service account](#create-a-service-account-go-sdk).

  > [tab] Python SDK
  >
  > Use the ID that the code printed when you [created the service account](#create-a-service-account-python-sdk).

  > [tab] JavaScript SDK
  >
  > Use the ID that the code printed when you [created the service account](#create-a-service-account-javascript-sdk).

* ID of the authorized key. In Wiz, it is referred to as the public key ID.

* Private key, the `private.pem` file.

In the settings of the connector, you can also select the projects that Wiz scans.

For instructions, follow the [Wiz documentation](https://docs.wiz.io/docs/connect-to-nebius) (requires logging in).

After you create the connector, Wiz starts collecting information about your resources. Every request that the connector makes is attributed to the service account, so you can find these requests in [audit events](https://docs.nebius.com/audit-logs/events/view.md).

## Troubleshooting

### Wiz can't access your resources

If you set an expiration date for the authorized key, the connector stops working after this date. To restore access:

1. In the web console, open the page of the service account and switch to the **Authorized keys** tab.

2. Check the expiration date of the key that the connector uses.

3. If the key has expired, [create a new authorized key](#create-an-authorized-key) for the same service account.

   If you manage the key with Terraform, create a new key pair in the directory with the configuration, set a new date in `expires_at`, and apply the configuration. Terraform replaces the key. To get the ID of the new key, run:

   ```bash theme={null}
   terraform output -raw authorized_key_id
   ```

4. In the settings of the connector in Wiz, replace the ID of the authorized key and the private key with the new ones.

## How to revoke access

To stop Wiz from accessing your resources, [delete the service account](https://docs.nebius.com/iam/service-accounts/manage.md#deleting-a-service-account) that you created for the connector. After that, the connector can no longer authenticate to your tenant.

If you created the service account with Terraform, remove the resources that you added for the connector from the configuration and apply it again. If you delete the service account in another way, Terraform creates it again the next time you apply the configuration.
