Class: Ardecy::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/ardecy.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Main

Returns a new instance of Main.



11
12
13
14
15
# File 'lib/ardecy.rb', line 11

def initialize(args)
  @cli = Options.new(args).options
  show_intent
  permission
end

Instance Method Details

#byeObject



25
26
27
28
29
# File 'lib/ardecy.rb', line 25

def bye
  puts
  puts " -[ Bye - Ardecy v." + Ardecy::VERSION + " ]- "
  exit
end

#permissionObject



31
32
33
34
35
# File 'lib/ardecy.rb', line 31

def permission
  return unless @cli[:fix]

  Ardecy::Guard.perm
end

#scanObject



17
18
19
20
21
22
23
# File 'lib/ardecy.rb', line 17

def scan
  Harden.sysctl(@cli)
  Harden.modules(@cli)
  Harden.permissions(@cli)
  Harden.mountpoint(@cli)
  Harden.cmdline(@cli)
end

#show_intentObject



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ardecy.rb', line 37

def show_intent
  audit = @cli[:audit] ||= false
  fixing = @cli[:fix] ||= false
  puts
  if audit || fixing
    print ' ====> '
    print 'Audit ' if audit
    print 'Fixing ' if fixing
    print "System\n"
  end
  puts
end