nuclei
nuclei copied to clipboard
IP is not optional when Host is informed. validate:"required_without=IP" doesn't work
I'm trying reporting Nuclei output to elasticsearch, but the following error occurred. The IP should be optional if the Host is informed
elasticsearch.go (lines: 24 and 26)
21 // Options contains necessary options required for elasticsearch communication
22 type Options struct {
23 // Host is the hostname of the elasticsearch instance
24 Host string yaml:"host" validate:"required_without=IP"
25 // IP for elasticsearch instance
26 IP string yaml:"ip" validate:"required,ip"
issue-tracker-config.yaml
# elasticsearch contains configuration options for elasticsearch exporter
elasticsearch:
# Host is the hostname of the elasticsearch instance
host: example.com
# IP for elasticsearch instance
#ip: 127.0.0.1
# Port is the port of elasticsearch instance
port: 9200
# IndexName is the name of the elasticsearch index
index-name: nuclei
# SSL enables ssl for elasticsearch connection
ssl: true
# SSLVerification disables SSL verification for elasticsearch
ssl-verification: false
# Username for the elasticsearch instance
username: elastic
# Password is the password for elasticsearch instance
password: changeme
Terminal
➜ ~ nuclei -u example-target.com -rc issue-tracker-config.yaml
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.2.2
projectdiscovery.io
[FTL] Could not create runner: could not parse reporting config file: validation failed for these fields: Options.ElasticsearchExporter.IP: required
But if I enter the IP, It works