Class: SecurityPentestPlanner::Planner
- Inherits:
-
Object
- Object
- SecurityPentestPlanner::Planner
- Defined in:
- lib/security_pentest_planner/planner.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ team: nil, scope: nil, include_datalake: false, api_layer: "API", data_layer: "Data Lake" }.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(input_path: nil, spec: nil, **options) ⇒ Planner
constructor
A new instance of Planner.
Constructor Details
#initialize(input_path: nil, spec: nil, **options) ⇒ Planner
Returns a new instance of Planner.
13 14 15 16 17 |
# File 'lib/security_pentest_planner/planner.rb', line 13 def initialize(input_path: nil, spec: nil, **) @input_path = input_path @spec = spec @options = DEFAULT_OPTIONS.merge() end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/security_pentest_planner/planner.rb', line 19 def call parser = build_parser analyzer = ContractAnalyzer.new( parser, scope_paths: [:scope], include_datalake: [:include_datalake] ) raise InputError, "Nenhum endpoint encontrado no escopo informado." if analyzer.scoped_endpoints.empty? vectors = VectorCatalog.vectors_for(analyzer) raise InputError, "Nenhum vetor aplicável encontrado para os sinais detectados." if vectors.empty? PlanRenderer.new( analyzer: analyzer, vectors: vectors, team: [:team], api_layer: [:api_layer], data_layer: [:data_layer] ).render end |