module Controls::Client::Assets

A module to encapsulate API methods related to assets @since API v1.0 @version v1.0.0

Public Instance Methods

applicable_assets(guidance, params = {}) click to toggle source

@param [String] guidance the guidance name to search by @return [Array<Hash>] an array of hashes that represent assets

# File lib/controls/client/assets.rb, line 40
def applicable_assets(guidance, params = {})
  get "/guidance/#{guidance}/applicable_assets", params
end
Also aliased as: assets_by_guidance
assets(params = {}) click to toggle source
todo
  • use @overload here for assets(params) vs assets(uuid) vs assets({ uuid: 'uuid-string', other: 'param' })

@note since the uuid is an optional param it has been added to the

params options hash

@raise [Controls::NotFound] if the uuid didn't match any assets @return [Hash] a hash representing the matching asset

# File lib/controls/client/assets.rb, line 14
def assets(params = {})
  if params.is_a? Hash
    uuid = params.delete(:uuid)
  else
    uuid = params
    params = {}
  end

  if uuid && !uuid.empty?
    get "/assets/#{uuid}", params
  else
    get '/assets', params
  end
end
assets_by_configuration(configuration, params = {})
assets_by_guidance(guidance, params = {})
Alias for: applicable_assets
assets_by_security_control(security_control, params = {})
Alias for: uncovered_assets
assets_by_threat(threat, params = {})
Alias for: threat_assets
assets_by_threat_vector(threat_vector, params = {})
Alias for: undefended_assets
misconfigured_assets(configuration, params = {}) click to toggle source

@param [String] configuration the name of the configuration to search by @return [Array<Hash>] an array of hashes that represent assets

# File lib/controls/client/assets.rb, line 47
def misconfigured_assets(configuration, params = {})
  get "/configurations/#{configuration}/misconfigured_assets", params
end
Also aliased as: assets_by_configuration
threat_assets(threat, params = {}) click to toggle source

@param [String] threat the threat name to search by @return [Array<Hash>] an array of hashes that represent assets

# File lib/controls/client/assets.rb, line 54
def threat_assets(threat, params = {})
  fail NotImplementedError, "Assets by threat is not a valid request. Use Controls::Client#assets or Controls::Client#assets_by_threat_vector instead."
  # get "/threats/#{threat}/assets", params
end
Also aliased as: assets_by_threat
uncovered_assets(security_control, params = {}) click to toggle source

@param [String] security_control the name of the security control to

search by

@return [Array<Hash>] an array of hashes that represent assets

# File lib/controls/client/assets.rb, line 63
def uncovered_assets(security_control, params = {})
  get "/security_controls/#{security_control}/uncovered_assets", params
end
Also aliased as: assets_by_security_control
undefended_assets(threat_vector, params = {}) click to toggle source

@param [String] threat_vector the threat vectory to search by @return [Array<Hash>] an array of hashes that represent assets

# File lib/controls/client/assets.rb, line 70
def undefended_assets(threat_vector, params = {})
  get "/threat_vectors/#{threat_vector}/undefended_assets", params
end
Also aliased as: assets_by_threat_vector