Skip to content

Commit

Permalink
chg: [website] Added a pretty version for display of the different so…
Browse files Browse the repository at this point in the history
…urces name.
  • Loading branch information
cedricbonhomme committed Jul 15, 2024
1 parent aa4a5c0 commit 5b9b7da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
19 changes: 19 additions & 0 deletions config/website.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,22 @@ LOG_PATH = "logs/website_warning.log"
ADMIN_EMAIL = "[email protected]"
ADMIN_NAME = "Computer Incident Response Center Luxembourg (CIRCL)"
ADMIN_WEBSITE = "https://www.circl.lu"

SOURCES_TO_SHOW = {
"github": "GitHub",
"cvelistv5": "CVE List 5",
"nvd": "NVD",
"pysec": "PySEC",
"gsd": "GSD",
"ossf_malicious_packages": "OpenSSF Malicious Packages",
"csaf_certbund": "CERT-Bund",
"csaf_siemens": "Siemens",
"csaf_redhat": "Red Hat",
"csaf_cisa": "CISA",
"csaf_cisco": "CISCO",
"csaf_sick": "Sick",
"csaf_nozominetworks": "Nozomi Networks",
"csaf_ox": "Open-Xchange",
"variot": "VARIoT",
"circl": "CIRCL",
}
2 changes: 1 addition & 1 deletion website/web/templates/recent.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Recent vulnerabilities</h1>
type="button" role="tab"
aria-controls="{{source}}-tab-pane"
aria-selected="true">
{{source}}
{{sources_to_show[source]}}
</button>
</li>
{%endfor%}
Expand Down
22 changes: 3 additions & 19 deletions website/web/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,28 +131,11 @@ def search() -> str | WerkzeugResponse:
@home_bp.route("/recent/<int:page>", methods=["GET"])
def recent(page: int = 1) -> str:
# For the webinterface, we want the most recent entries by source
source_to_show = [
"github",
"cvelistv5",
"nvd",
"pysec",
"gsd",
"ossf_malicious_packages",
"csaf_certbund",
"csaf_siemens",
"csaf_redhat",
"csaf_cisa",
"csaf_cisco",
"csaf_sick",
"csaf_nozominetworks",
"csaf_ox",
"variot",
local_instance_name,
]
sources_to_show = application.config.get("SOURCES_TO_SHOW", {})
default_source = "cvelistv5"
recent = {
source: vulnerabilitylookup.get_last(source, page=page)
for source in source_to_show
for source in sources_to_show
}
try:
p = int(page)
Expand All @@ -166,6 +149,7 @@ def recent(page: int = 1) -> str:
default_source=default_source,
current_page=page,
local_instance_name=local_instance_name,
sources_to_show=sources_to_show,
)


Expand Down

0 comments on commit 5b9b7da

Please sign in to comment.