Class: GrimReaper::SecurityModule
- Inherits:
-
Object
- Object
- GrimReaper::SecurityModule
- Defined in:
- lib/grim_reaper/security_module.rb
Overview
Security module wrapper for scythe operations
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#grim_root ⇒ Object
readonly
Returns the value of attribute grim_root.
Instance Method Summary collapse
- #execute(command, *args) ⇒ Object
-
#initialize(config, grim_root) ⇒ SecurityModule
constructor
A new instance of SecurityModule.
- #status ⇒ Object
Constructor Details
#initialize(config, grim_root) ⇒ SecurityModule
Returns a new instance of SecurityModule.
10 11 12 13 |
# File 'lib/grim_reaper/security_module.rb', line 10 def initialize(config, grim_root) @config = config @grim_root = grim_root end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/grim_reaper/security_module.rb', line 8 def config @config end |
#grim_root ⇒ Object (readonly)
Returns the value of attribute grim_root.
8 9 10 |
# File 'lib/grim_reaper/security_module.rb', line 8 def grim_root @grim_root end |
Instance Method Details
#execute(command, *args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/grim_reaper/security_module.rb', line 15 def execute(command, *args) case command when "audit" execute_audit when "scan" execute_scan(*args) when "encrypt" execute_encrypt(*args) when "decrypt" execute_decrypt(*args) when "quarantine" execute_quarantine(*args) when "threat" execute_threat(*args) else execute_generic(command, *args) end end |
#status ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/grim_reaper/security_module.rb', line 34 def status { status: "ready", module: "security", available_commands: %w[audit scan encrypt decrypt quarantine threat], grim_root: @grim_root } end |