Skip to content

Universal Fields (via interfaces) for plugins.Service #292

Description

@rtfmkiesel

Hi team

Already a nice Go module to use, exactly what I need:) Thanks for your work. Right now, there is, however, quite the pain point when it comes to extracting results from plugins.Service.

There are no "universal" fields for values like vendor, product, and version. The way I have to solve this is via a custom struct that has all the JSON properties you use:

type nervaExtract struct {
	// Version variants
	Version         string `json:"version"`
	AppVersion      string `json:"app_version"`
	FirmwareVersion string `json:"firmware_version"`
	ApiVersion      string `json:"api_version"`
	GitVersion      string `json:"git_version"`
	CQLVersion      string `json:"cql_version"`
	OSVersion       string `json:"os_version"`
	ProtocolVersion string `json:"protocol_version"`

	// Vendor variants
	Vendor     string `json:"vendor"`
	VendorName string `json:"vendor_name"`

	// Product variants
	FullName     string `json:"full_name"`
	Product      string `json:"product"`
	ProductName  string `json:"product_name"`
	ProductType  string `json:"product_type"`
	ProductCode  string `json:"product_code"`
	AppName      string `json:"app_name"`
	ServerHeader string `json:"server_header"`
	Server       string `json:"server"`

        // On HTTP responses
	Technologies []string `json:"technologies"`

	CPEs []string `json:"cpes"`
}

Not really super optimal, as I also have to check with new probes for new field names.

Would you consider adding interfaces to the probes (which all have to adhere to), like Product() string or Version() string? A probe designer can then specify exactly what is returned there.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions