Class: SvgSentinel::Finding
- Inherits:
-
Struct
- Object
- Struct
- SvgSentinel::Finding
- Defined in:
- lib/svg_sentinel/finding.rb
Overview
One thing the scanner noticed.
Two orthogonal axes describe a finding:
- severity - :critical (unsafe to render or embed as-is) or :warning (worth a second look, but not on its own a reason to reject).
- category - :security (an actual attack surface: scripts, XXE, script URIs, external references) or :policy (a brand-mark / strict-profile house rule such as animation, raster images, or size).
safe? keys off severity; the category lets a caller separate genuine
security signals from profile-compliance noise.
path is the slash-joined element path where the finding occurred
(e.g. "svg/g/script"), or nil for document-level findings.
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#code ⇒ Object
Returns the value of attribute code.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#message ⇒ Object
Returns the value of attribute message.
-
#path ⇒ Object
Returns the value of attribute path.
-
#severity ⇒ Object
Returns the value of attribute severity.
Instance Method Summary collapse
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category
19 20 21 |
# File 'lib/svg_sentinel/finding.rb', line 19 def category @category end |
#code ⇒ Object
Returns the value of attribute code
19 20 21 |
# File 'lib/svg_sentinel/finding.rb', line 19 def code @code end |
#detail ⇒ Object
Returns the value of attribute detail
19 20 21 |
# File 'lib/svg_sentinel/finding.rb', line 19 def detail @detail end |
#message ⇒ Object
Returns the value of attribute message
19 20 21 |
# File 'lib/svg_sentinel/finding.rb', line 19 def @message end |
#path ⇒ Object
Returns the value of attribute path
19 20 21 |
# File 'lib/svg_sentinel/finding.rb', line 19 def path @path end |
#severity ⇒ Object
Returns the value of attribute severity
19 20 21 |
# File 'lib/svg_sentinel/finding.rb', line 19 def severity @severity end |
Instance Method Details
#critical? ⇒ Boolean
20 21 22 |
# File 'lib/svg_sentinel/finding.rb', line 20 def critical? severity == :critical end |
#policy? ⇒ Boolean
32 33 34 |
# File 'lib/svg_sentinel/finding.rb', line 32 def policy? category == :policy end |
#security? ⇒ Boolean
28 29 30 |
# File 'lib/svg_sentinel/finding.rb', line 28 def security? category == :security end |
#to_h ⇒ Object
36 37 38 |
# File 'lib/svg_sentinel/finding.rb', line 36 def to_h {code: code, severity: severity, category: category, message: , detail: detail, path: path} end |
#warning? ⇒ Boolean
24 25 26 |
# File 'lib/svg_sentinel/finding.rb', line 24 def warning? severity == :warning end |