Class Vulnerability
java.lang.Object
com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
com.michelin.cert.redscan.utils.models.reports.Vulnerability
- All Implemented Interfaces:
Sendable
- Direct Known Subclasses:
Alert
Vulnerability model.
- Author:
- Maxime ESCOURBIAC
-
Field Summary
Fields inherited from class com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
blocked, data, index, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends DatalakeStorageItem>
TfromDatalake(kong.unirest.json.JSONObject object) Create DatalakeStorageItem instance from Datalake data.voidConvert json string to object.static StringgenerateId(String... values) * Generate unique internal id from dedicated value.Detailed description of the vulnerability.Get Fanout exchange name.getId()Internal ID.Origin of the vulnerability (ex: redscan-urlcrazy).intVulnerability severity.Vulnerability title.String[]getTags()Tags used by Mantisbt.getUrl()Vulnerability URL.voidsetDescription(String description) Detailed description of the vulnerability.voidInternal ID.voidOrigin of the vulnerability (ex: redscan-urlcrazy).voidsetSeverity(int severity) Vulnerability severity.voidsetSummary(String summary) Vulnerability title.voidTags used by Mantisbt.voidVulnerability URL.toJson()Convert the service to json string.booleanupsert()Upsert the item in Elastic searchContent.Methods inherited from class com.michelin.cert.redscan.utils.datalake.DatalakeStorageItem
block, create, delete, find, find, findAll, findAll, findAll, findAll, findAllContent, findAllContent, findAllContent, findAllContent, findContent, fromDate, getBlocked, getBlockId, getData, getIndex, getLastScanDate, getParent, isBlocked, removeField, search, search, search, search, searchContent, searchContent, searchContent, searchContent, setBlocked, setData, setIndex, setLastScanDate, setParent, toDate, unblock, upsertField
-
Constructor Details
-
Vulnerability
public Vulnerability()Vulnerability Constructor. -
Vulnerability
public Vulnerability(String id, int severity, String summary, String description, String url, String origin, String[] tags) Vulnerability Constructor.- Parameters:
id- Internal ID.severity- Vulnerability severity.summary- Vulnerability title.description- Detailed description of the vulnerability.url- Vulnerability URL.origin- Origin of the vulnerability (ex: redscan-urlcrazy).tags- Tags used by Mantisbt.
-
-
Method Details
-
toJson
Convert the service to json string. -
fromJson
Description copied from interface:SendableConvert json string to object. -
getFanoutExchangeName
Description copied from interface:SendableGet Fanout exchange name.- Specified by:
getFanoutExchangeNamein interfaceSendable- Returns:
- Fanout exchange name.
-
upsert
Description copied from class:DatalakeStorageItemUpsert the item in Elastic searchContent. This operation cannot be mutualized and must be defined in each children classes.- Specified by:
upsertin classDatalakeStorageItem- Returns:
- True if the upsert is successful.
- Throws:
DatalakeStorageException- Exception with the storage.
-
fromDatalake
Description copied from class:DatalakeStorageItemCreate DatalakeStorageItem instance from Datalake data. Be careful to verify if the JSON object parameter is not null. If object is null => return null.- Specified by:
fromDatalakein classDatalakeStorageItem- Type Parameters:
T- DatalakeStorageItem children.- Parameters:
object- Datalake data.- Returns:
- DatalakeStorageItem instantiated.
-
generateId
* Generate unique internal id from dedicated value. It should include the origin to avoid collision.- Parameters:
values- Values to differentiate the vulnerability.- Returns:
- Unique vulnerability id.
-
getSeverity
public int getSeverity()Vulnerability severity.- Returns:
- Vulnerability severity.
-
setSeverity
public void setSeverity(int severity) Vulnerability severity.- Parameters:
severity- Vulnerability severity.
-
getId
Internal ID.- Specified by:
getIdin classDatalakeStorageItem- Returns:
- Internal ID.
-
setId
Internal ID.- Parameters:
id- Internal ID.
-
getSummary
Vulnerability title.- Returns:
- Vulnerability title.
-
setSummary
Vulnerability title.- Parameters:
summary- Vulnerability title.
-
getDescription
Detailed description of the vulnerability.- Returns:
- Detailed description of the vulnerability.
-
setDescription
Detailed description of the vulnerability.- Parameters:
description- Detailed description of the vulnerability.
-
getUrl
Vulnerability URL.- Returns:
- Vulnerability URL.
-
setUrl
Vulnerability URL.- Parameters:
url- Vulnerability URL.
-
getOrigin
Origin of the vulnerability (ex: redscan-urlcrazy).- Returns:
- Origin of the vulnerability (ex: redscan-urlcrazy).
-
setOrigin
Origin of the vulnerability (ex: redscan-urlcrazy).- Parameters:
origin- Origin of the vulnerability (ex: redscan-urlcrazy).
-
getTags
Tags used by Mantisbt.- Returns:
- Tags used by Mantisbt.
-
setTags
Tags used by Mantisbt.- Parameters:
tags- Tags used by Mantisbt.
-