-
Notifications
You must be signed in to change notification settings - Fork 30
/
EnterpriseLinuxLookup.h
53 lines (47 loc) · 1.76 KB
/
EnterpriseLinuxLookup.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include "Stdafx.h"
#include "VendorPackageLookup.h"
/*!
* Implements the functionality to search Red Hat/CentOS/Fedora packages.
*/
class EnterpriseLinuxLookup : public VendorPackageLookup
{
public:
/*!
* Looks up the status of a vulnerability in the vendor's repository.
*
* \param cve Identifier of the vulnerability.
* \param distrib Operating system distribution.
* \param ver Version number of distribution.
*
* \return If not affected an empty map, otherwise a map of vulnerable
* packages associated to the version number that patches it,
* or empty string if package is not yet fixed.
*/
std::unordered_map<std::string, std::string> FindVulnerability(const std::string& cve, OpSys distrib = OpSys::EnterpriseLinux, double ver = 0.0) override;
/*!
* Gets the changelog of a package from the vendor's repository.
*
* \param pkg Name of the package.
* \param distrib Operating system distribution.
* \param ver Version number of distribution.
*
* \return List of version numbers and their release dates.
*/
std::vector<std::pair<std::string, long>> GetChangelog(const std::string& pkg, OpSys distrib = OpSys::EnterpriseLinux, double ver = 0.0) override;
/*!
* Generates a command which upgrades the specified vulnerable packages
* on the host system.
*
* \param pkgs Vulnerable packages to upgrade.
* \param distrib Operating system distribution.
* \param ver Version number of distribution.
*
* \return Upgrade command.
*/
std::string GetUpgradeCommand(const std::unordered_set<std::string>& pkgs, OpSys distrib = OpSys::EnterpriseLinux, double ver = 0.0) override;
/*!
* Frees up the resources allocated during the lifetime of this instance.
*/
~EnterpriseLinuxLookup() override;
};