Class: FiberAudit::Finding
- Inherits:
-
Data
- Object
- Data
- FiberAudit::Finding
- Defined in:
- lib/fiber_audit/findings/finding.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#evidence ⇒ Object
readonly
Returns the value of attribute evidence.
-
#execution_context ⇒ Object
readonly
Returns the value of attribute execution_context.
-
#fingerprint ⇒ Object
readonly
Returns the value of attribute fingerprint.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#remediation ⇒ Object
readonly
Returns the value of attribute remediation.
-
#rule_id ⇒ Object
readonly
Returns the value of attribute rule_id.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(rule_id:, category:, severity:, confidence:, message:, title: nil, location: nil, symbol: nil, operation: nil, execution_context: nil, evidence: [], remediation: nil, fingerprint: nil) ⇒ Finding
constructor
A new instance of Finding.
- #to_h_for_json ⇒ Object
Constructor Details
#initialize(rule_id:, category:, severity:, confidence:, message:, title: nil, location: nil, symbol: nil, operation: nil, execution_context: nil, evidence: [], remediation: nil, fingerprint: nil) ⇒ Finding
Returns a new instance of Finding.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/fiber_audit/findings/finding.rb', line 19 def initialize( rule_id:, category:, severity:, confidence:, message:, title: nil, location: nil, symbol: nil, operation: nil, execution_context: nil, evidence: [], remediation: nil, fingerprint: nil ) severity = Severity.coerce(severity) confidence = Confidence.coerce(confidence) evidence = Array(evidence).freeze fingerprint ||= Correlation::Fingerprint.call( rule_id: rule_id, path: location&.path, enclosing_symbol: symbol, operation: operation ) super( rule_id: rule_id, title: title, category: category, severity: severity, confidence: confidence, location: location, symbol: symbol, operation: operation, execution_context: execution_context, message: , evidence: evidence, remediation: remediation, fingerprint: fingerprint ) end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def category @category end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def confidence @confidence end |
#evidence ⇒ Object (readonly)
Returns the value of attribute evidence
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def evidence @evidence end |
#execution_context ⇒ Object (readonly)
Returns the value of attribute execution_context
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def execution_context @execution_context end |
#fingerprint ⇒ Object (readonly)
Returns the value of attribute fingerprint
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def fingerprint @fingerprint end |
#location ⇒ Object (readonly)
Returns the value of attribute location
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def location @location end |
#message ⇒ Object (readonly)
Returns the value of attribute message
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def @message end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def operation @operation end |
#remediation ⇒ Object (readonly)
Returns the value of attribute remediation
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def remediation @remediation end |
#rule_id ⇒ Object (readonly)
Returns the value of attribute rule_id
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def rule_id @rule_id end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def severity @severity end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def symbol @symbol end |
#title ⇒ Object (readonly)
Returns the value of attribute title
4 5 6 |
# File 'lib/fiber_audit/findings/finding.rb', line 4 def title @title end |
Instance Method Details
#to_h_for_json ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fiber_audit/findings/finding.rb', line 58 def to_h_for_json { rule_id: rule_id, title: title, category: category, severity: severity, confidence: confidence, location: location&.to_h_for_json, symbol: symbol, operation: operation, execution_context: execution_context, message: , evidence: evidence.map(&:to_h_for_json), remediation: remediation, fingerprint: fingerprint } end |