Nix-Security-WG / nix-security-tracker

Web service for managing information on vulnerabilities in software distributed through Nixpkgs
26 stars 4 forks source link

Extract severity from the `metrics` JSON object #112

Open fricklerhandwerk opened 9 months ago

fricklerhandwerk commented 9 months ago

Required for https://github.com/Nix-Security-WG/nix-security-tracker/issues/32

In CVEs the data could look something like this:

            "metrics": [
                {
                    "other": {
                        "content": {
                            "text": "low"
                        },
                        "type": "Textual description of severity"
                    }
                }
            ],

but at the time of writing our data model for that is

class Metric(models.Model):
    """Class representing an impact information related to a CVE record."""

    format = models.CharField(max_length=64)
    scenarios = models.ManyToManyField(Description)
    content = models.JSONField()

class Container(models.Model):
    # ...
    metrics = models.ManyToManyField(Metric)