fleet/ee/vulnerability-dashboard/api/models/VulnerabilityInstall.js
Eric 48a26f3fe5
Vulnerability dashboard: Add new homepage (#35253)
Related to: https://github.com/fleetdm/fleet/issues/33661

Changes:
- Updated the homepage of the vulnerability dashboard to be a new
dashboard page.
- Updated the `Vulnerability` model to make cveID a unique value.
2025-11-07 12:01:57 -06:00

76 lines
2.4 KiB
JavaScript

/**
* VulnerabilityInstall.js
*
* @description :: A model definition represents a database table/collection.
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
installedAt: {
example: 1670152500000,
description: 'JS timestamp representing when this installation began on the host.',
extendedDescription: 'This JS timestamp represents when the vulnerabiltiy dashboard first saw this vulnerable software on a host',
type: 'number',
isInteger: true,
required: true,
},
uninstalledAt: {
example: 1670152500000,
description: 'JS timestamp representing when this installation ended on the host (i.e. the vuln was patched).',
extendedDescription: 'If not resolved, then this is `0`. (Which is ok, since 1970 is too long ago to be a relevant value.)',
type: 'number',
isInteger: true,
defaultsTo: 0,
},
versionName: {
type: 'string',
description: 'The version of the vulnerable softare that was installed.',
},
softwareName: {
type: 'string',
description: 'The name of the vulnerable software that was installed.',
},
fleetApid: {
type: 'number',
description: 'The Fleet API ID of the vulnerable software that was installed.',
required: true,
},
resolvedInVersion: {
type: 'string',
description: 'The name of the version of this software that is no longer vulnerable.',
extendedDescription: 'This is the resolved_in_version value from the Fleet API.'
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
vulnerability: {
model: 'Vulnerability',
required: true
},
host: {
model: 'Host',
required: true,
},
},
};