Module: Wazuh::Api::Endpoints::Manager

Included in:
Wazuh::Api::Endpoints, V4::Manager
Defined in:
lib/wazuh/api/endpoints/manager.rb

Instance Method Summary collapse

Instance Method Details

#check_manager_configurationObject

Check Wazuh configuration Returns if Wazuh configuration is OK.



32
33
34
# File 'lib/wazuh/api/endpoints/manager.rb', line 32

def check_manager_configuration
  get '/manager/configuration/validation'
end

#delete_manager_local_file(options = {}) ⇒ Object

Delete a local file Confirmation message.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :path (path)

    Relative path of file. This parameter is mandatory.

See Also:



42
43
44
# File 'lib/wazuh/api/endpoints/manager.rb', line 42

def delete_manager_local_file(options = {})
  delete '/manager/files', options
end

#get_manager_local_file(options = {}) ⇒ Object

Get local file Returns the content of a local file (rules, decoders and lists).

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :path (path)

    Relative path of file. This parameter is mandatory.

  • :validation (validation)

    Validates the content of the file. An error will be returned if file content is not strictly correct. False by default.

See Also:



54
55
56
# File 'lib/wazuh/api/endpoints/manager.rb', line 54

def get_manager_local_file(options = {})
  get '/manager/files', options
end

#manager_active_configuration(component, configuration) ⇒ Object

Get manager active configuration Returns the requested configuration in JSON format.

Parameters:

  • component (String)

    Selected component.

  • configuration (String)

    Configuration to read.

See Also:



13
14
15
# File 'lib/wazuh/api/endpoints/manager.rb', line 13

def manager_active_configuration(component, configuration)
  get "/manager/config/#{component}/#{configuration}"
end

#manager_analysisd_statsObject

Get analysisd stats Returns a summary of the current analysisd stats.



116
117
118
# File 'lib/wazuh/api/endpoints/manager.rb', line 116

def manager_analysisd_stats
  get '/manager/stats/analysisd'
end

#manager_configuration(options = {}) ⇒ Object

Get manager configuration Returns ossec.conf in JSON format.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :section (section)

    Indicates the ossec.conf section: global, rules, syscheck, rootcheck, remote, alerts, command, active-response, localfile.

  • :field (field)

    Indicates a section child, e.g, fields for rule section are: include, decoder_dir, etc.



24
25
26
# File 'lib/wazuh/api/endpoints/manager.rb', line 24

def manager_configuration(options = {})
  get '/manager/configuration', options
end

#manager_informationObject

Get manager information Returns basic information about manager.



76
77
78
# File 'lib/wazuh/api/endpoints/manager.rb', line 76

def manager_information
  get '/manager/info'
end

#manager_logObject

Get ossec.log Returns the three last months of ossec.log.



92
93
94
# File 'lib/wazuh/api/endpoints/manager.rb', line 92

def manager_log
  offset_request('get', '/manager/logs')
end

#manager_remoted_statsObject

Get remoted stats Returns a summary of the current remoted stats.



150
151
152
# File 'lib/wazuh/api/endpoints/manager.rb', line 150

def manager_remoted_stats
  get '/manager/stats/remoted'
end

#manager_stats(options = {}) ⇒ Object

Get manager stats Returns Wazuh statistical information for the current or specified date.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :date (date)

    Selects the date for getting the statistical information. Format: YYYYMMDD

See Also:



126
127
128
# File 'lib/wazuh/api/endpoints/manager.rb', line 126

def manager_stats(options = {})
  get '/manager/stats', options
end

#manager_stats_by_hourObject

Get manager stats by hour Returns Wazuh statistical information per hour. Each number in the averages field represents the average of alerts per hour.



134
135
136
# File 'lib/wazuh/api/endpoints/manager.rb', line 134

def manager_stats_by_hour
  get '/manager/stats/hourly'
end

#manager_stats_by_weeklyObject

Get manager stats by weekly Returns Wazuh statistical information per week. Each number in the hours field represents the average alerts per hour for that specific day.



142
143
144
# File 'lib/wazuh/api/endpoints/manager.rb', line 142

def manager_stats_by_weekly
  get '/manager/stats/weekly'
end

#manager_statusObject

Get manager status Returns the status of the manager processes.



84
85
86
# File 'lib/wazuh/api/endpoints/manager.rb', line 84

def manager_status
  get '/manager/status'
end

#manager_summary_logObject

Get summary of ossec.log Returns a summary of the last three months of the ossec.log file.



100
101
102
# File 'lib/wazuh/api/endpoints/manager.rb', line 100

def manager_summary_log
  get '/manager/logs/summary'
end

#restart_managerObject

Restart Wazuh manager Restarts Wazuh manager.



108
109
110
# File 'lib/wazuh/api/endpoints/manager.rb', line 108

def restart_manager
  put '/manager/restart'
end

#update_manager_local_file(options = {}) ⇒ Object

Update local file Upload a local file (rules, decoders and lists).

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :path (path)

    Relative path of file. This parameter is mandatory.

  • :validation (validation)

    Validates the content of the file. An error will be returned if file content is not strictly correct. False by default.

  • :overwrite (overwrite)

    Replaces the existing file. False by default.

See Also:



68
69
70
# File 'lib/wazuh/api/endpoints/manager.rb', line 68

def update_manager_local_file(options = {})
  post '/manager/files', options
end