Class: SeccompTools::Audit::Finding
- Inherits:
-
Struct
- Object
- Struct
- SeccompTools::Audit::Finding
- Defined in:
- lib/seccomp-tools/audit/finding.rb
Overview
One weakness reported by a Check: a stable id, a severity, a human +title+/+detail+, the
architecture it applies to, the syscalls involved, an optional argument condition under which
it holds, and a one-line remediation.
Instance Attribute Summary collapse
-
#arch ⇒ Object
Returns the value of attribute arch.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#id ⇒ Object
Returns the value of attribute id.
-
#remediation ⇒ Object
Returns the value of attribute remediation.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#syscalls ⇒ Object
Returns the value of attribute syscalls.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#rank ⇒ Array
Sort key: by severity, then id, then the affected syscalls.
-
#to_h ⇒ Hash
JSON-ready shape.
Instance Attribute Details
#arch ⇒ Object
Returns the value of attribute arch
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def arch @arch end |
#condition ⇒ Object
Returns the value of attribute condition
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def condition @condition end |
#detail ⇒ Object
Returns the value of attribute detail
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def detail @detail end |
#id ⇒ Object
Returns the value of attribute id
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def id @id end |
#remediation ⇒ Object
Returns the value of attribute remediation
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def remediation @remediation end |
#severity ⇒ Object
Returns the value of attribute severity
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def severity @severity end |
#syscalls ⇒ Object
Returns the value of attribute syscalls
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def syscalls @syscalls end |
#title ⇒ Object
Returns the value of attribute title
11 12 13 |
# File 'lib/seccomp-tools/audit/finding.rb', line 11 def title @title end |
Instance Method Details
#rank ⇒ Array
Sort key: by severity, then id, then the affected syscalls.
15 16 17 |
# File 'lib/seccomp-tools/audit/finding.rb', line 15 def rank [SEVERITIES.index(severity) || SEVERITIES.size, id, Array(syscalls).join(',')] end |
#to_h ⇒ Hash
Returns JSON-ready shape.
20 21 22 |
# File 'lib/seccomp-tools/audit/finding.rb', line 20 def to_h { id:, severity:, title:, detail:, arch:, syscalls: Array(syscalls), condition:, remediation: } end |