-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e840936
commit 4055343
Showing
8 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Aspisec | ||
class Config | ||
module Configs | ||
DBGATE = { | ||
'enabled' => true, | ||
'location' => { | ||
'base' => '$HOME/.dbgate', # ~/.dbgate | ||
'connections' => { | ||
'enabled' => false, | ||
'path' => '<base>/connections.jsonl', | ||
'description' => "File containing connection shortchuts.\n" \ | ||
'Connection objects contain target domain or IP address.' | ||
}, | ||
'logs' => { | ||
'path' => '<base>/logs', | ||
'description' => "Logs folder.\n" \ | ||
"Those log events shouldn't contain customer information but who knows." | ||
} | ||
} | ||
}.freeze | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'aspisec/module' | ||
|
||
module Aspisec | ||
module Modules | ||
# dbgate module. | ||
# Inherits {Aspisec::Module}. | ||
# For more examples of methods, see {Aspisec::Modules::Sqlmap}. | ||
# @see https://github.com/dbgate/dbgate | ||
# @example | ||
# # Get the global config | ||
# conf = Aspisec::Config.new.conf | ||
# # Create a Dbgate module instance | ||
# dbg = Aspisec::Modules::Dbgate.new(conf) | ||
# # Locations available | ||
# dbg.locations_list # => ["connections", "logs"] | ||
class Dbgate < Aspisec::Module | ||
# see {Aspisec::Config::DEFAULT_CONFIG} or call {Aspisec::Module::Location#description}. | ||
# @return [Location] | ||
attr_reader :connections | ||
|
||
# see {Aspisec::Config::DEFAULT_CONFIG} or call {Aspisec::Module::Location#description}. | ||
# @return [Location] | ||
attr_reader :logs | ||
|
||
# Inherits from {Aspisec::Module} but has only the `conf` argument, | ||
# `tool_name` is hardcoded for each module. | ||
# @param conf [Aspisec::Config] an instance of the global configuration | ||
def initialize(conf, logger: nil) | ||
super(conf, 'dbgate', logger:) | ||
@connections = Location.new(@conf, 'connections') | ||
@logs = Location.new(@conf, 'logs') | ||
@locations_list = %w[connections logs] | ||
end | ||
end | ||
end | ||
end |