Class: Infrawrench::CredentialHygieneNamespace

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

Overview

client.credential_hygiene

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ CredentialHygieneNamespace

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 CredentialHygieneNamespace.

Parameters:



5206
5207
5208
# File 'lib/infrawrench/client.rb', line 5206

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Credential hygiene report

API keys nobody uses, SSH keys nothing references, and members holding write permissions they have never exercised — derived entirely from data the server already holds. No provider call and nothing to enable.

The audit log only witnesses writes. Reading a resource list or a cost graph leaves no audit row by design, so this report draws no conclusion about read permissions: an absence of evidence about them proves nothing. permissionFindingsWithheld is set when the organization does not yet have enough audit history for the unused-permission finding to be meaningful. Both are load-bearing — a governance report that overclaims is worse than none.

Gated on audit:read rather than a permission of its own: every fact here is already reachable by anyone who can read the audit log, so this is a lens rather than a new disclosure.

Requires permission: audit:read.

GET /api/org/orgId/credential-hygiene

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.

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

    Activity window. Defaults to 90.

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

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

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

Returns:

  • (Hash)

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

Raises:



5240
5241
5242
5243
5244
5245
5246
5247
5248
# File 'lib/infrawrench/client.rb', line 5240

def get(org_id: nil, window_days: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/credential-hygiene",
    path_params: { "orgId" => org_id },
    query: { "windowDays" => window_days },
    request_options: request_options
  )
end