Class: Falcon::ConfigurationAssessment

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/api/configuration_assessment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ConfigurationAssessment

Returns a new instance of ConfigurationAssessment.



36
37
38
# File 'lib/crimson-falcon/api/configuration_assessment.rb', line 36

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



34
35
36
# File 'lib/crimson-falcon/api/configuration_assessment.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#get_combined_assessments_query(filter, opts = {}) ⇒ DomainAPICombinedFindingsResponseV1

Search for assessments in your environment by providing an FQL filter and paging details. Returns a set of HostFinding entities which match the filter criteria

Parameters:

  • filter (String)

    Filter items using a query in Falcon Query Language (FQL). Wildcards * are unsupported. Common filter options include: <ul><li>created_timestamp:>'2019-11-25T22:36:12Z'</li><li>updated_timestamp:>'2019-11-25T22:36:12Z'</li><li>aid:'8e7656b27d8c49a34a1af416424d6231'</li></ul>

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    A pagination token used with the `limit` parameter to manage pagination of results. On your first request, don't provide an `after` token. On subsequent requests, provide the `after` token from the previous response to continue from that place in the results.

  • :limit (Integer)

    The number of items to return in this response (default: 100, max: 5000). Use with the after parameter to manage pagination of results.

  • :sort (String)

    Sort assessment by their properties. Common sort options include: <ul><li>created_timestamp|desc</li><li>updated_timestamp|asc</li></ul>

  • :facet (Array<String>)

    Select various details blocks to be returned for each assessment entity. Supported values: &lt;ul&gt;&lt;li&gt;host&lt;/li&gt;&lt;li&gt;finding.rule&lt;/li&gt;&lt;li&gt;finding.evaluation_logic&lt;/li&gt;&lt;/ul&gt;

Returns:



47
48
49
50
# File 'lib/crimson-falcon/api/configuration_assessment.rb', line 47

def get_combined_assessments_query(filter, opts = {})
  data, _status_code, _headers = get_combined_assessments_query_with_http_info(filter, opts)
  data
end

#get_combined_assessments_query_with_http_info(filter, opts = {}) ⇒ Array<(DomainAPICombinedFindingsResponseV1, Integer, Hash)>

Search for assessments in your environment by providing an FQL filter and paging details. Returns a set of HostFinding entities which match the filter criteria

Parameters:

  • filter (String)

    Filter items using a query in Falcon Query Language (FQL). Wildcards * are unsupported. Common filter options include: &lt;ul&gt;&lt;li&gt;created_timestamp:&gt;&#39;2019-11-25T22:36:12Z&#39;&lt;/li&gt;&lt;li&gt;updated_timestamp:&gt;&#39;2019-11-25T22:36:12Z&#39;&lt;/li&gt;&lt;li&gt;aid:&#39;8e7656b27d8c49a34a1af416424d6231&#39;&lt;/li&gt;&lt;/ul&gt;

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    A pagination token used with the &#x60;limit&#x60; parameter to manage pagination of results. On your first request, don&#39;t provide an &#x60;after&#x60; token. On subsequent requests, provide the &#x60;after&#x60; token from the previous response to continue from that place in the results.

  • :limit (Integer)

    The number of items to return in this response (default: 100, max: 5000). Use with the after parameter to manage pagination of results.

  • :sort (String)

    Sort assessment by their properties. Common sort options include: &lt;ul&gt;&lt;li&gt;created_timestamp|desc&lt;/li&gt;&lt;li&gt;updated_timestamp|asc&lt;/li&gt;&lt;/ul&gt;

  • :facet (Array<String>)

    Select various details blocks to be returned for each assessment entity. Supported values: &lt;ul&gt;&lt;li&gt;host&lt;/li&gt;&lt;li&gt;finding.rule&lt;/li&gt;&lt;li&gt;finding.evaluation_logic&lt;/li&gt;&lt;/ul&gt;

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/crimson-falcon/api/configuration_assessment.rb', line 60

def get_combined_assessments_query_with_http_info(filter, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigurationAssessment.get_combined_assessments_query ...'
  end
  # verify the required parameter 'filter' is set
  if @api_client.config.client_side_validation && filter.nil?
    fail ArgumentError, "Missing the required parameter 'filter' when calling ConfigurationAssessment.get_combined_assessments_query"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConfigurationAssessment.get_combined_assessments_query, must be smaller than or equal to 5000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConfigurationAssessment.get_combined_assessments_query, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/configuration-assessment/combined/assessments/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter'] = filter
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'facet'] = @api_client.build_collection_param(opts[:'facet'], :multi) if !opts[:'facet'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DomainAPICombinedFindingsResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ConfigurationAssessment.get_combined_assessments_query",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigurationAssessment#get_combined_assessments_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_rule_details(ids, opts = {}) ⇒ DomainAPIRuleDetailsResponseV1

Get rules details for provided one or more rule IDs

Parameters:

  • ids (Array<String>)

    One or more rules IDs (max: 400)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



125
126
127
128
# File 'lib/crimson-falcon/api/configuration_assessment.rb', line 125

def get_rule_details(ids, opts = {})
  data, _status_code, _headers = get_rule_details_with_http_info(ids, opts)
  data
end

#get_rule_details_with_http_info(ids, opts = {}) ⇒ Array<(DomainAPIRuleDetailsResponseV1, Integer, Hash)>

Get rules details for provided one or more rule IDs

Parameters:

  • ids (Array<String>)

    One or more rules IDs (max: 400)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/crimson-falcon/api/configuration_assessment.rb', line 134

def get_rule_details_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigurationAssessment.get_rule_details ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling ConfigurationAssessment.get_rule_details"
  end
  # resource path
  local_var_path = '/configuration-assessment/entities/rule-details/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DomainAPIRuleDetailsResponseV1'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['oauth2']

  new_options = opts.merge(
    :operation => :"ConfigurationAssessment.get_rule_details",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigurationAssessment#get_rule_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end