File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1- # Generated by Django 4 .2.25 on 2025-12-16 12:27
1+ # Generated by Django 5 .2.11 on 2026-03-19 01:11
22
3- from django .db import migrations , models
43import django .db .models .deletion
4+ from django .db import migrations , models
55
66
77class Migration (migrations .Migration ):
88
99 dependencies = [
10- ("vulnerabilities" , "0105_packagecommitpatch_patch_and_more " ),
10+ ("vulnerabilities" , "0115_impactedpackageaffecting_and_more " ),
1111 ]
1212
1313 operations = [
Original file line number Diff line number Diff line change 1414from vulnerabilities .models import DetectionRule
1515from vulnerabilities .models import DetectionRuleTypes
1616from vulnerabilities .pipelines import VulnerableCodePipeline
17+ from vulnerabilities .utils import get_advisory_url
1718
1819
1920class YaraRulesImproverPipeline (VulnerableCodePipeline ):
@@ -100,11 +101,20 @@ def collect_and_store_rules(self):
100101 raw_text = file_path .read_text (encoding = "utf-8" , errors = "ignore" )
101102 if not raw_text :
102103 continue
104+ raw_text = raw_text .replace ("\x00 " , "" )
105+
106+ repo_url = repo_url [4 ::]
107+ rule_url = get_advisory_url (
108+ file = file_path ,
109+ base_path = base_directory ,
110+ url = f"{ repo_url } /blob/master/" ,
111+ )
103112
104113 DetectionRule .objects .update_or_create (
105114 rule_text = raw_text ,
106115 rule_type = DetectionRuleTypes .YARA ,
107116 advisory = None ,
117+ source_url = rule_url ,
108118 )
109119
110120 def clean_downloads (self ):
You can’t perform that action at this time.
0 commit comments