Add Resource and Layered Services #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
resourcefield toMdm::VulnandMdm::Service. This field is stored as JSONB and is optional. It will be used to add specific resource information to a vulnerability or a service. This allows multiple instances of the same vulnerability or service type to be reported for different resources. A unique service is now defined by these fields:host,port,proto,name, andresource. Note that no validation is done on theresourcefield. It is a JSON object that can have arbitrary key/value pairs describing the vulnerability or service.This also adds links between services to make layered services possible. A service can now have parent and child services. This design makes it possible to report vulnerabilities on specific service layers. For example, assuming we have these layered services:
Wordpress > HTTPS > SSL > TCP/login?user=is reported on theWordpressservice.SSLservice.Each service has an optional
resourcefield that can be used to distinguish one service from another on the same port. For example, it is possible to have twoWordpressservices on the same port but with a different base URI:Wordpresson port 80/TCP, resource:{uri: '/webapp1'}Wordpresson port 80/TCP, resource:{uri: '/webapp2'}Note that each service has
portandprotofields to maintain compatibility with the older model. For example:Wordpress (443/TCP) > HTTPS (443/TCP) > SSL (443/TCP) > TCP (443/TCP).The drawback is that it duplicates the information. Also, no validation is done to check if a child service has the same port/proto as the parent service. I'm open to discussion on this.