Class: Infrawrench::AccessReviewNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.access_review

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ AccessReviewNamespace

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AccessReviewNamespace.

Parameters:



333
334
335
336
# File 'lib/infrawrench/client.rb', line 333

def initialize(transport)
  @transport = transport
  @dismissals = AccessReviewDismissalsNamespace.new(@transport)
end

Instance Attribute Details

#dismissalsAccessReviewDismissalsNamespace (readonly)

Returns client.access_review.dismissals.

Returns:



329
330
331
# File 'lib/infrawrench/client.rb', line 329

def dismissals
  @dismissals
end

Instance Method Details

#export(org_id: nil, format: nil, stale_days: nil, request_options: nil) ⇒ Hash

Export the access review as compliance evidence

The same review as a downloadable file, one row per finding. format=csv (the default) returns RFC 4180 CSV with every cell quoted and spreadsheet formulas neutralised; format=json returns the full response body pretty-printed.

Dismissed findings are included and labelled in both formats, with the note and the person who accepted them: an evidence pack answers what you found and what you decided. Exports are recorded in the audit log.

Requires permission: resources:read.

GET /api/org/orgId/access-review/export

Raises on 400: Bad request

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • format (String, nil) (defaults to: nil)

    Defaults to "csv".

  • stale_days (Integer, nil) (defaults to: nil)

    Staleness window in days. Defaults to 90.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • format: ("csv", "json", nil) (defaults to: nil)
  • stale_days: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as AccessReviewResponse — see sig/infrawrench/sdk.rbs.

Raises:



363
364
365
366
367
368
369
370
371
# File 'lib/infrawrench/client.rb', line 363

def export(org_id: nil, format: nil, stale_days: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/access-review/export",
    path_params: { "orgId" => org_id },
    query: { "format" => format, "staleDays" => stale_days },
    request_options: request_options
  )
end

#get(org_id: nil, stale_days: nil, request_options: nil) ⇒ Hash

Review the principals inside your connected clouds

Every IAM user and role, service account, app registration, group, role binding and long-lived API key your connected accounts have synced, with the findings that have evidence against them: unused beyond the staleness window, holding administrative or wildcard permissions, past the rotation budget their plugin declares, carrying no recorded owner, or signing in without a second factor.

This is about principals in your clouds — it is neither your Infrawrench team's roles (/team) nor the credentials Infrawrench stores for you (/credential-hygiene).

No provider API calls are made: everything is computed from already-synced fields, so a principal whose provider does not report last use is reported with activity: "unknown" and is never called stale. Findings the organization has dismissed are reported separately under dismissed and are excluded from findings, counts, byRule and the security alerts.

Requires permission: resources:read.

GET /api/org/orgId/access-review

Raises on 400: Bad request

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • stale_days (Integer, nil) (defaults to: nil)

    Staleness window in days. Defaults to 90.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • stale_days: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as AccessReviewResponse — see sig/infrawrench/sdk.rbs.

Raises:



405
406
407
408
409
410
411
412
413
# File 'lib/infrawrench/client.rb', line 405

def get(org_id: nil, stale_days: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/access-review",
    path_params: { "orgId" => org_id },
    query: { "staleDays" => stale_days },
    request_options: request_options
  )
end