diff --git a/CHANGELOG b/CHANGELOG index 2f13dbd30..30e7b706d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- [REPUTATION_CTX] Allow to configure if custom Reputation Context DBs should be downloaded every hour +- [REPUTATION_CTX] Set back update crontab to download Reputation Context files every hour ## [2.33.0] - 2025-10-24 diff --git a/vulture_os/applications/fixtures/reputation_ctx.json b/vulture_os/applications/fixtures/reputation_ctx.json index 990e68340..abffc25a4 100644 --- a/vulture_os/applications/fixtures/reputation_ctx.json +++ b/vulture_os/applications/fixtures/reputation_ctx.json @@ -5,14 +5,17 @@ "name": "Geolite2 Country", "db_type": "GeoIP", "method": "GET", - "url": "https://barricade.vultureproject.org/ipsets/GeoLite2-Country.mmdb", + "url": "https://download.maxmind.com/geoip/databases/GeoLite2-Country/download?suffix=tar.gz", + "auth_type": "basic", + "user": "YOURACCOUNTID", + "password": "YOURLICENSEKEY", "verify_cert": true, "filename": "GeoLite2-Country.mmdb", - "description": "Maxmind DBs Geoip country database", + "description": "Maxmind DBs Geoip country database.\nPLEASE FILL-IN YOUR PERSONAL ACCOUNDID AND LICENSEKEY TO USE THOSE DBS", "nb_netset": 0, "nb_unique": 0, - "internal": true, - "enable_hour_download": true + "internal": false, + "enable_hour_download": false } }, { @@ -21,14 +24,17 @@ "name": "Geolite2 City", "db_type": "GeoIP", "method": "GET", - "url": "https://barricade.vultureproject.org/ipsets/GeoLite2-City.mmdb", + "url": "https://download.maxmind.com/geoip/databases/GeoLite2-City/download?suffix=tar.gz", + "auth_type": "basic", + "user": "YOURACCOUNTID", + "password": "YOURLICENSEKEY", "verify_cert": true, "filename": "GeoLite2-City.mmdb", - "description": "Maxmind DBs Geoip city database", + "description": "Maxmind DBs Geoip city database.\nPLEASE FILL-IN YOUR PERSONAL ACCOUNDID AND LICENSEKEY TO USE THOSE DBS", "nb_netset": 0, "nb_unique": 0, - "internal": true, - "enable_hour_download": true + "internal": false, + "enable_hour_download": false } } ] \ No newline at end of file diff --git a/vulture_os/applications/reputation_ctx/form.py b/vulture_os/applications/reputation_ctx/form.py index 532a1aed4..ef89058da 100644 --- a/vulture_os/applications/reputation_ctx/form.py +++ b/vulture_os/applications/reputation_ctx/form.py @@ -48,7 +48,7 @@ class ReputationContextForm(ModelForm): class Meta: model = ReputationContext fields = ('name', 'description', 'db_type', 'method', 'url', 'verify_cert', 'post_data', 'auth_type', 'user', - 'password', 'tags') + 'password', 'tags', 'enable_hour_download') widgets = { 'name': TextInput(attrs={'class': 'form-control'}), @@ -57,11 +57,12 @@ class Meta: 'method': Select(choices=HTTP_METHOD_CHOICES, attrs={'class': 'form-control select2'}), 'url': TextInput(attrs={'class': 'form-control'}), 'verify_cert': CheckboxInput(attrs={'class': "form-control js-switch"}), + 'enable_hour_download': CheckboxInput(attrs={'class': "form-control js-switch"}), 'post_data': TextInput(attrs={'class': 'form-control'}), 'auth_type': Select(choices=HTTP_AUTH_TYPE_CHOICES, attrs={'class': 'form-control select2'}), 'user': TextInput(attrs={'class': 'form-control'}), - 'password': TextInput(attrs={'class': 'form-control'}), - 'tags': TextInput(attrs={'class': 'form-control', 'data-role': "tagsinput"}) + 'password': TextInput(attrs={'type':'password', 'class': 'form-control'}), + 'tags': TextInput(attrs={'class': 'form-control', 'data-role': "tagsinput"}), } def __init__(self, *args, **kwargs): @@ -70,7 +71,7 @@ def __init__(self, *args, **kwargs): for field_name in ['auth_type', 'verify_cert', 'post_data', 'user', 'password', 'tags']: self.fields[field_name].required = False # Set readonly if internal reputation context - if kwargs.get('instance') and kwargs.get('instance').internal: + if kwargs.get('instance') and kwargs['instance'].internal: for field in self.fields: self.fields[field].widget.attrs['readonly'] = True self.initial['tags'] = ','.join(self.initial.get('tags', []) or self.fields['tags'].initial) diff --git a/vulture_os/applications/reputation_ctx/models.py b/vulture_os/applications/reputation_ctx/models.py index c0a36ccb1..747391f47 100644 --- a/vulture_os/applications/reputation_ctx/models.py +++ b/vulture_os/applications/reputation_ctx/models.py @@ -159,7 +159,12 @@ class ReputationContext(models.Model): nb_netset = models.IntegerField(default=0) nb_unique = models.IntegerField(default=0) internal = models.BooleanField(default=False) - enable_hour_download = models.BooleanField(default=True) + enable_hour_download = models.BooleanField( + default=True, + verbose_name=_("Automatically download file every hour"), + help_text=_("If activated, Vulture will download and save the file, and will automatically" + " restart the service(s) using it") + ) """ Use DjongoManager to use mongo_find() & Co """ objects = models.DjongoManager() diff --git a/vulture_os/applications/templates/apps/reputation_ctx_edit.html b/vulture_os/applications/templates/apps/reputation_ctx_edit.html index 9a68d4156..8c02ca029 100644 --- a/vulture_os/applications/templates/apps/reputation_ctx_edit.html +++ b/vulture_os/applications/templates/apps/reputation_ctx_edit.html @@ -111,6 +111,17 @@