Class: Ardecy::Harden::Sysctl::Kernel::Printk

Inherits:
SysKern
  • Object
show all
Defined in:
lib/ardecy/harden/sysctl/kernel.rb

Instance Method Summary collapse

Methods inherited from SysKern

#fix, #repair, #x

Methods included from Display

#display_fix_list, #kernel_show, #perm_show, #result, #show_bad_mod, #title

Constructor Details

#initialize(args) ⇒ Printk

Returns a new instance of Printk.



49
50
51
52
53
54
55
# File 'lib/ardecy/harden/sysctl/kernel.rb', line 49

def initialize(args)
  @file = '/proc/sys/kernel/printk'
  @line = 'kernel.printk'
  @tab = 6
  super
  @exp = '3 3 3 3'
end

Instance Method Details

#scanObject



57
58
59
60
61
62
# File 'lib/ardecy/harden/sysctl/kernel.rb', line 57

def scan
  kernel_show(@line, @exp) if @args[:audit]
  value = File.read(@file).chomp
  @res = 'OK' if value =~ /3\s+3\s+3\s+3/
  result(@res) if @args[:audit]
end