Skip to content

Commit f3737d3

Browse files
committed
chore: remove custom vulncheck and github poc features
1 parent 2d52581 commit f3737d3

14 files changed

Lines changed: 58 additions & 271 deletions
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by Django 5.1.7 on 2025-04-01 18:00
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("commons", "0016_merge_20250328_1143"),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name="settings",
15+
name="background_exploits_import_crontab_hours",
16+
),
17+
migrations.RemoveField(
18+
model_name="settings",
19+
name="background_exploits_import_crontab_minutes",
20+
),
21+
migrations.RemoveField(
22+
model_name="settings",
23+
name="exploits_last_sync_github_poc",
24+
),
25+
migrations.RemoveField(
26+
model_name="settings",
27+
name="exploits_last_sync_vulncheck_kev",
28+
),
29+
]

backend/application/commons/models.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,6 @@ class Settings(Model):
166166
feature_disable_user_login = BooleanField(default=False, help_text="Disable user login")
167167
feature_general_rules_need_approval = BooleanField(default=False, help_text="General rules need approval")
168168

169-
exploits_last_sync_vulncheck_kev = DateTimeField(null=True, help_text="Last sync date of Vulncheck KEV data")
170-
171-
exploits_last_sync_github_poc = DateTimeField(null=True, help_text="Last sync date of GitHub PoC data")
172-
173-
background_exploits_import_crontab_minutes = IntegerField(
174-
default=0,
175-
validators=[MinValueValidator(0), MaxValueValidator(59)],
176-
help_text="Minutes crontab expression for exploit data import",
177-
)
178-
179-
background_exploits_import_crontab_hours = IntegerField(
180-
default=4,
181-
validators=[MinValueValidator(0), MaxValueValidator(23)],
182-
help_text="Hours crontab expression for exploit data import (UTC)",
183-
)
184-
185169
risk_acceptance_expiry_days = IntegerField(
186170
default=30,
187171
validators=[MinValueValidator(0), MaxValueValidator(999999)],

backend/application/core/api/filters.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ class ObservationFilter(FilterSet):
270270
("origin_component_location", "origin_component_location"),
271271
("has_potential_duplicates", "has_potential_duplicates"),
272272
("patch_available", "patch_available"),
273-
("in_vulncheck_kev", "in_vulncheck_kev"),
274-
("exploit_available", "exploit_available"),
275273
("origin_component_purl_type", "origin_component_purl_type"),
276274
),
277275
)
@@ -291,8 +289,6 @@ class Meta: # pylint: disable=duplicate-code
291289
"origin_service",
292290
"has_potential_duplicates",
293291
"patch_available",
294-
"in_vulncheck_kev",
295-
"exploit_available",
296292
"origin_component_purl_type",
297293
]
298294

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by Django 5.1.7 on 2025-04-01 18:00
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("core", "0071_merge_20250331_1956"),
10+
]
11+
12+
operations = [
13+
migrations.RemoveIndex(
14+
model_name="observation",
15+
name="core_observ_in_vuln_bb4e6d_idx",
16+
),
17+
migrations.RemoveIndex(
18+
model_name="observation",
19+
name="core_observ_exploit_bc386d_idx",
20+
),
21+
migrations.RemoveField(
22+
model_name="observation",
23+
name="exploit_available",
24+
),
25+
migrations.RemoveField(
26+
model_name="observation",
27+
name="in_vulncheck_kev",
28+
),
29+
]

backend/application/core/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,6 @@ class Observation(Model):
454454
decimal_places=3,
455455
null=True,
456456
)
457-
in_vulncheck_kev = BooleanField(default=False)
458-
exploit_available = BooleanField(default=False)
459457
found = DateField(null=True)
460458
scanner = CharField(max_length=255, blank=True)
461459
upload_filename = CharField(max_length=255, blank=True)
@@ -532,8 +530,6 @@ class Meta:
532530
Index(fields=["stackable_score"]),
533531
Index(fields=["scanner"]),
534532
Index(fields=["patch_available"]),
535-
Index(fields=["in_vulncheck_kev"]),
536-
Index(fields=["exploit_available"]),
537533
Index(fields=["upgrade_impact_score"]),
538534
]
539535

backend/application/core/services/exploits.py

Lines changed: 0 additions & 141 deletions
This file was deleted.

backend/application/core/tasks.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from application.commons import settings_static
77
from application.commons.services.tasks import handle_task_exception
8-
from application.core.services.exploits import import_github_poc, import_vulncheck_kev
98
from application.core.services.housekeeping import (
109
delete_inactive_branches_and_set_flags,
1110
)
@@ -34,25 +33,6 @@ def task_branch_housekeeping() -> None:
3433
logger.info("--- Branch_housekeeping - finished ---")
3534

3635

37-
@db_periodic_task(
38-
crontab(
39-
minute=settings_static.background_exploits_import_crontab_minutes,
40-
hour=settings_static.background_exploits_import_crontab_hours,
41-
)
42-
)
43-
@lock_task("import_exploits")
44-
def task_import_exploits() -> None:
45-
logger.info("--- Import_Exploits - start ---")
46-
47-
try:
48-
import_vulncheck_kev()
49-
import_github_poc()
50-
except Exception as e:
51-
handle_task_exception(e)
52-
53-
logger.info("--- Import_Exploits - finished ---")
54-
55-
5636
@db_periodic_task(
5737
crontab(
5838
minute=settings_static.risk_acceptance_expiry_crontab_minute,

backend/application/exploits/tasks.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

frontend/src/commons/settings/SettingsEdit.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -172,26 +172,6 @@ const SettingsEdit = () => {
172172
sx={{ marginBottom: 2 }}
173173
/>
174174
</Stack>
175-
<Stack direction="row" spacing={2}>
176-
<NumberInput
177-
source="background_exploits_import_crontab_hours"
178-
label="Exploit data import crontab (hours)"
179-
min={0}
180-
step={1}
181-
validate={validate_0_23}
182-
helperText="Hours crontab expression for exploit data import (UTC)"
183-
sx={{ marginBottom: 2 }}
184-
/>
185-
<NumberInput
186-
source="background_exploits_import_crontab_minutes"
187-
label="Exploit data import crontab (minutes)"
188-
min={0}
189-
step={1}
190-
validate={validate_0_59}
191-
helperText="Minutes crontab expression for exploit data import"
192-
sx={{ marginBottom: 2 }}
193-
/>
194-
</Stack>
195175

196176
<Divider flexItem sx={{ marginTop: 2, marginBottom: 2 }} />
197177
<Typography variant="h6" sx={{ marginBottom: 2 }}>

frontend/src/commons/settings/SettingsShow.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ const SettingsShowComponent = () => {
5353
<NumberField source="background_epss_import_crontab_minute" />
5454
</Labeled>
5555
</Stack>
56-
<Stack direction="row" spacing={2}>
57-
<Labeled label="Exploit data import crontab (minutes)">
58-
<NumberField source="background_exploits_import_crontab_minutes" />
59-
</Labeled>
60-
<Labeled label="Exploit data import crontab (hours)">
61-
<NumberField source="background_exploits_import_crontab_hours" />
62-
</Labeled>
63-
</Stack>
6456
</Paper>
6557

6658
<Paper sx={{ marginBottom: 2, padding: 2 }}>

0 commit comments

Comments
 (0)