class Mdm::WebVuln

A Web Vulnerability found during a web scan or web audit.

If you need to modify Mdm::WebVuln you can use ActiveSupport.on_load(:mdm_web_vuln) inside an initializer so that your patches are reloaded on each request in development mode for your Rails application.

@example extending Mdm::WebVuln

# config/initializers/mdm_web_vuln.rb
ActiveSupport.on_load(:mdm_web_vuln) do
  def confidence_percentage
    "#{confidence}%"
  end
end

Constants

CONFIDENCE_RANGE

A percentage {#confidence} that the vulnerability is real and not a false positive.

DEFAULT_PARAMS

Default value for {#params}

METHODS

Allowed {#method methods}.

RISK_RANGE

{#risk Risk} is rated on a scale from 0 (least risky) to 5 (most risky).

Public Instance Methods

params() click to toggle source

Parameters sent as part of request.

@return [Array<Array<(String, String)>>]

# File app/models/mdm/web_vuln.rb, line 153
def params
  normalize_params(
      read_attribute(:params)
  )
end
params=(params) click to toggle source

Set parameters sent as part of request.

@param params [Array<Array<(String, String)>>, nil] Array of parameter key value pairs @return [void]

# File app/models/mdm/web_vuln.rb, line 163
def params=(params)
  write_attribute(
      :params,
      normalize_params(params)
  )
end

Private Instance Methods

default_params() click to toggle source

Creates a duplicate of {DEFAULT_PARAMS} that is safe to modify.

@return [Array] an empty array

# File app/models/mdm/web_vuln.rb, line 175
def default_params
  DEFAULT_PARAMS.dup
end
normalize_params(params) click to toggle source

Returns either the given params or {DEFAULT_PARAMS} if params is `nil`

@param [Array<Array<(String, String)>>, nil] params @return [Array<<Array<(String, String)>>] params if not `nil` @return [nil] if params is `nil`

# File app/models/mdm/web_vuln.rb, line 184
def normalize_params(params)
  params || default_params
end