Module: Zanshin::SDK::Summaries

Included in:
Client
Defined in:
lib/zanshin/summaries.rb

Overview

Zanshin SDK Summary

Instance Method Summary collapse

Instance Method Details

#get_alert_summaries(organization_id, scan_target_ids = []) ⇒ Object

Gets a summary of the current state of alerts for an organization, both in total and broken down by scan target [#reference](api.zanshin.tenchisecurity.com/#operation/alertSummary)

Parameters:

  • organization_id (UUID)

    of the organization whose alert summaries are desired

  • scan_target_ids (Array<UUID>) (defaults to: [])

    optional list of scan target IDs to summarize alerts from, defaults to all

Returns:

  • a Object representing the alert summaries



18
19
20
21
22
23
24
25
# File 'lib/zanshin/summaries.rb', line 18

def get_alert_summaries(organization_id, scan_target_ids = [])
  body = {
    'organizationId' => validate_uuid(organization_id),
    'scanTargetIds' => scan_target_ids.each { |scan_target_id| validate_uuid(scan_target_id) }
  }

  @http.request('POST', '/alerts/summaries', body)
end

#get_following_alert_summaries(organization_id, following_ids = []) ⇒ Object

Gets a summary of the current state of alerts for followed organizations [#reference](api.zanshin.tenchisecurity.com/#operation/alertFollowingSummary)

Parameters:

  • organization_id (UUID)

    of the organization

  • following_ids (Array<UUID>) (defaults to: [])

    list of IDs of organizations being followed to summarize alerts from

Returns:

  • a Object representing the alert following summaries



34
35
36
37
38
39
40
41
# File 'lib/zanshin/summaries.rb', line 34

def get_following_alert_summaries(organization_id, following_ids = [])
  body = {
    'organizationId' => validate_uuid(organization_id),
    'followingIds' => following_ids.each { |following_id| validate_uuid(following_id) }
  }

  @http.request('POST', '/alerts/summaries/following', body)
end

#get_following_scan_summaries(organization_id, following_ids = [], days = 7) ⇒ Object

Gets a summary of the current state of alerts for followed organizations [#reference](api.zanshin.tenchisecurity.com/#operation/scanSummaryFollowing)

Parameters:

  • organization_id (UUID)

    of the organization whose alert summaries are desired

  • following_ids (Array<UUID>) (defaults to: [])

    optional list of IDs of organizations being followed to summarize alerts from

  • days (Integer) (defaults to: 7)

    number of days to go back in time in historical search

Returns:

  • a Object representing the scan summaries



69
70
71
72
73
74
75
76
77
# File 'lib/zanshin/summaries.rb', line 69

def get_following_scan_summaries(organization_id, following_ids = [], days = 7)
  body = {
    'organizationId' => validate_uuid(organization_id),
    'followingIds' => following_ids.each { |following_id| validate_uuid(following_id) },
    'daysBefore' => days
  }

  @http.request('POST', '/alerts/summaries/scans/following', body)
end

#get_scan_summaries(organization_id, scan_target_ids = [], days = 7) ⇒ Object

Returns summaries of scan results over a period of time, summarizing number of alerts that changed states [#reference](api.zanshin.tenchisecurity.com/#operation/scanSummary)

Parameters:

  • organization_id (UUID)

    of the organization whose alert summaries are desired

  • scan_target_ids (Array<UUID>) (defaults to: [])

    optional list of scan target IDs to summarize alerts from, defaults to all

  • days (Integer) (defaults to: 7)

    number of days to go back in time in historical search

Returns:

  • a Object representing the scan summaries



51
52
53
54
55
56
57
58
59
# File 'lib/zanshin/summaries.rb', line 51

def get_scan_summaries(organization_id, scan_target_ids = [], days = 7)
  body = {
    'organizationId' => validate_uuid(organization_id),
    'scanTargetIds' => scan_target_ids.each { |scan_target_id| validate_uuid(scan_target_id) },
    'daysBefore' => days
  }

  @http.request('POST', '/alerts/summaries/scans', body)
end