Created
May 14, 2026 14:42
-
-
Save robbmanes/002232c776331838655992a2ab9955be to your computer and use it in GitHub Desktop.
Quickly check CVE's from the Red Hat Security endpoint
This file contains hidden or 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
| import argparse | |
| import httpx | |
| import sys | |
| RH_SEC_ENDPOINT = 'https://access.redhat.com/hydra/rest/securitydata' | |
| def main(): | |
| parser = argparse.ArgumentParser( | |
| prog='rh_cve_check.py', | |
| description='Scrapes the Red Hat Security Endpoint for CVE information' | |
| ) | |
| parser.add_argument('cve') | |
| args = parser.parse_args() | |
| r = httpx.get("%s/cve/%s.json" % (RH_SEC_ENDPOINT, args.cve)) | |
| if r.status_code == 200: | |
| json_response = r.json() | |
| print("CVE ID: %s" % (json_response['name'])) | |
| print("Affected products:") | |
| for package in json_response['affected_release']: | |
| print("\tProduct: %s" % (package['product_name'])) | |
| print("\t\tAdvisory: %s" % (package['advisory'])) | |
| print("\t\tFixed in: %s" % (package['package'])) | |
| if __name__ == '__main__': | |
| sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment