Class: Bootprint::Rules::Finding
- Inherits:
-
Struct
- Object
- Struct
- Bootprint::Rules::Finding
- Defined in:
- lib/bootprint/rules/finding.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#cause ⇒ Object
Returns the value of attribute cause.
-
#evidence ⇒ Object
Returns the value of attribute evidence.
-
#impact ⇒ Object
Returns the value of attribute impact.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#references ⇒ Object
Returns the value of attribute references.
-
#remediation ⇒ Object
Returns the value of attribute remediation.
-
#rule_id ⇒ Object
Returns the value of attribute rule_id.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#source_location ⇒ Object
Returns the value of attribute source_location.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#suppressed ⇒ Object
Returns the value of attribute suppressed.
-
#suppression_reason ⇒ Object
Returns the value of attribute suppression_reason.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #blocking?(policy) ⇒ Boolean
- #local ⇒ Object
- #message ⇒ Object
-
#path ⇒ Object
Compatibility readers for 0.1 integrations.
- #target ⇒ Object
- #to_h ⇒ Object
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def category @category end |
#cause ⇒ Object
Returns the value of attribute cause
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def cause @cause end |
#evidence ⇒ Object
Returns the value of attribute evidence
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def evidence @evidence end |
#impact ⇒ Object
Returns the value of attribute impact
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def impact @impact end |
#metadata ⇒ Object
Returns the value of attribute metadata
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def @metadata end |
#references ⇒ Object
Returns the value of attribute references
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def references @references end |
#remediation ⇒ Object
Returns the value of attribute remediation
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def remediation @remediation end |
#rule_id ⇒ Object
Returns the value of attribute rule_id
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def rule_id @rule_id end |
#severity ⇒ Object
Returns the value of attribute severity
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def severity @severity end |
#source_location ⇒ Object
Returns the value of attribute source_location
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def source_location @source_location end |
#summary ⇒ Object
Returns the value of attribute summary
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def summary @summary end |
#suppressed ⇒ Object
Returns the value of attribute suppressed
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def suppressed @suppressed end |
#suppression_reason ⇒ Object
Returns the value of attribute suppression_reason
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def suppression_reason @suppression_reason end |
#title ⇒ Object
Returns the value of attribute title
5 6 7 |
# File 'lib/bootprint/rules/finding.rb', line 5 def title @title end |
Instance Method Details
#blocking?(policy) ⇒ Boolean
29 30 31 |
# File 'lib/bootprint/rules/finding.rb', line 29 def blocking?(policy) !suppressed && policy.fail_on.include?(severity.to_s) end |
#local ⇒ Object
35 |
# File 'lib/bootprint/rules/finding.rb', line 35 def local = evidence&.fetch("source", nil) |
#message ⇒ Object
37 |
# File 'lib/bootprint/rules/finding.rb', line 37 def = summary |
#path ⇒ Object
Compatibility readers for 0.1 integrations.
34 |
# File 'lib/bootprint/rules/finding.rb', line 34 def path = &.fetch("path", nil) || source_location&.fetch("path", nil) |
#target ⇒ Object
36 |
# File 'lib/bootprint/rules/finding.rb', line 36 def target = evidence&.fetch("target", nil) |
#to_h ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bootprint/rules/finding.rb', line 10 def to_h { "rule_id" => rule_id, "title" => title, "category" => category.to_s, "severity" => severity.to_s, "summary" => summary, "cause" => cause, "impact" => impact, "evidence" => evidence || {}, "remediation" => remediation || {}, "references" => references || [], "metadata" => || {}, "source_location" => source_location, "suppressed" => !suppressed.nil?, "suppression_reason" => suppression_reason }.compact end |