-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a very basic and unstyled version of a CVE details page with links on other pages. Fixes gardenlinux/glvd#120
- Loading branch information
Showing
9 changed files
with
192 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package io.gardenlinux.glvd.db; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "cvedetails") | ||
public class CveDetails { | ||
@Id | ||
@Column(name = "cve_id", nullable = false) | ||
private String cveId; | ||
|
||
@Column(name = "vulnstatus", nullable = false) | ||
private String vulnStatus; | ||
|
||
@Column(name = "description", nullable = false) | ||
private String description; | ||
|
||
@Column(name = "published", nullable = false) | ||
private String cvePublishedDate; | ||
|
||
@Column(name = "base_score_v40", nullable = true) | ||
private Float baseScoreV40; | ||
|
||
@Column(name = "base_score_v31", nullable = true) | ||
private Float baseScoreV31; | ||
|
||
@Column(name = "base_score_v30", nullable = true) | ||
private Float baseScoreV30; | ||
|
||
@Column(name = "base_score_v2", nullable = true) | ||
private Float baseScoreV2; | ||
|
||
@Column(name = "vector_string_v40", nullable = true) | ||
private String vectorStringV40; | ||
|
||
@Column(name = "vector_string_v31", nullable = true) | ||
private String vectorStringV31; | ||
|
||
@Column(name = "vector_string_v30", nullable = true) | ||
private String vectorStringV30; | ||
|
||
@Column(name = "vector_string_v2", nullable = true) | ||
private String vectorStringV2; | ||
|
||
public CveDetails() { | ||
} | ||
|
||
public CveDetails(String cveId, String vulnStatus, String description, String cvePublishedDate, Float baseScoreV40, Float baseScoreV31, Float baseScoreV30, Float baseScoreV2, String vectorStringV40, String vectorStringV31, String vectorStringV30, String vectorStringV2) { | ||
this.cveId = cveId; | ||
this.vulnStatus = vulnStatus; | ||
this.description = description; | ||
this.cvePublishedDate = cvePublishedDate; | ||
this.baseScoreV40 = baseScoreV40; | ||
this.baseScoreV31 = baseScoreV31; | ||
this.baseScoreV30 = baseScoreV30; | ||
this.baseScoreV2 = baseScoreV2; | ||
this.vectorStringV40 = vectorStringV40; | ||
this.vectorStringV31 = vectorStringV31; | ||
this.vectorStringV30 = vectorStringV30; | ||
this.vectorStringV2 = vectorStringV2; | ||
} | ||
|
||
public String getCveId() { | ||
return cveId; | ||
} | ||
|
||
public String getVulnStatus() { | ||
return vulnStatus; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public String getCvePublishedDate() { | ||
return cvePublishedDate; | ||
} | ||
|
||
public Float getBaseScoreV40() { | ||
return baseScoreV40; | ||
} | ||
|
||
public Float getBaseScoreV31() { | ||
return baseScoreV31; | ||
} | ||
|
||
public Float getBaseScoreV30() { | ||
return baseScoreV30; | ||
} | ||
|
||
public Float getBaseScoreV2() { | ||
return baseScoreV2; | ||
} | ||
|
||
public String getVectorStringV40() { | ||
return vectorStringV40; | ||
} | ||
|
||
public String getVectorStringV31() { | ||
return vectorStringV31; | ||
} | ||
|
||
public String getVectorStringV30() { | ||
return vectorStringV30; | ||
} | ||
|
||
public String getVectorStringV2() { | ||
return vectorStringV2; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/io/gardenlinux/glvd/db/CveDetailsRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.gardenlinux.glvd.db; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface CveDetailsRepository extends JpaRepository<CveDetails, String> { | ||
CveDetails findByCveId( | ||
@Param("cve_id") String cve_id | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE HTML> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<title>GLVD: CVE Details</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<style> | ||
table { | ||
table-layout: fixed; | ||
width: 100%; | ||
} | ||
|
||
td { | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
|
||
<p th:text="|Details for ${cveDetails.cveId}|" /> | ||
|
||
<a th:href="@{https://nvd.nist.gov/vuln/detail/} + ${cveDetails.cveId}">NIST NATIONAL VULNERABILITY DATABASE</a> | ||
|
||
<p th:text="|Description: ${cveDetails.description}|" /> | ||
|
||
<p th:text="|Vulnerability Status: ${cveDetails.vulnStatus}|" /> | ||
|
||
<p th:text="|Published Date: ${cveDetails.cvePublishedDate}|" /> | ||
|
||
<p th:text="|Base Score (Version 4): ${cveDetails.baseScoreV40}|" /> | ||
<p th:text="|Vector String (Version 4): ${cveDetails.vectorStringV40}|" /> | ||
|
||
<p th:text="|Base Score (Version 3.1): ${cveDetails.baseScoreV31}|" /> | ||
<p th:text="|Vector String (Version 3.1): ${cveDetails.vectorStringV31}|" /> | ||
|
||
<p th:text="|Base Score (Version 3.0): ${cveDetails.baseScoreV30}|" /> | ||
<p th:text="|Vector String (Version 3.0): ${cveDetails.vectorStringV30}|" /> | ||
|
||
<p th:text="|Base Score (Version 2): ${cveDetails.baseScoreV2}|" /> | ||
<p th:text="|Vector String (Version 2): ${cveDetails.vectorStringV2}|" /> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters