assemblyline-v4-service 4.4.1.dev149__py3-none-any.whl → 4.4.1.dev151__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of assemblyline-v4-service might be problematic. Click here for more details.

@@ -1 +1 @@
1
- 4.4.1.dev149
1
+ 4.4.1.dev151
@@ -243,6 +243,9 @@ class ServiceUpdater(ThreadedCoreBase):
243
243
  self.source_update_flag.set()
244
244
 
245
245
  def _handle_signature_change_event(self, data: Optional[SignatureChange]):
246
+ if data and data.signature_id == "*":
247
+ # A classification change to the source was made, sync settings
248
+ self._pull_settings()
246
249
  self.local_update_flag.set()
247
250
 
248
251
  def _handle_service_change_event(self, data: Optional[ServiceChange]):
@@ -320,16 +323,16 @@ class ServiceUpdater(ThreadedCoreBase):
320
323
  if not os.path.exists(UPDATER_DIR):
321
324
  os.makedirs(UPDATER_DIR)
322
325
 
323
- _, time_keeper = tempfile.mkstemp(prefix="time_keeper_", dir=UPDATER_DIR)
324
- if self._service.update_config.generates_signatures:
325
- output_directory = tempfile.mkdtemp(prefix="update_dir_", dir=UPDATER_DIR)
326
+ self.log.info("Setup service account.")
327
+ username = self.ensure_service_account()
328
+ self.log.info("Create temporary API key.")
329
+ with temporary_api_key(self.datastore, username) as api_key:
330
+ self.log.info(f"Connecting to Assemblyline API: {UI_SERVER}")
331
+ al_client = get_client(UI_SERVER, apikey=(username, api_key), verify=self.verify)
326
332
 
327
- self.log.info("Setup service account.")
328
- username = self.ensure_service_account()
329
- self.log.info("Create temporary API key.")
330
- with temporary_api_key(self.datastore, username) as api_key:
331
- self.log.info(f"Connecting to Assemblyline API: {UI_SERVER}")
332
- al_client = get_client(UI_SERVER, apikey=(username, api_key), verify=self.verify)
333
+ _, time_keeper = tempfile.mkstemp(prefix="time_keeper_", dir=UPDATER_DIR)
334
+ if self._service.update_config.generates_signatures:
335
+ output_directory = tempfile.mkdtemp(prefix="update_dir_", dir=UPDATER_DIR)
333
336
 
334
337
  # Check if new signatures have been added
335
338
  self.log.info("Check for new signatures.")
@@ -379,9 +382,9 @@ class ServiceUpdater(ThreadedCoreBase):
379
382
  shutil.rmtree(output_directory, ignore_errors=True)
380
383
  if os.path.exists(time_keeper):
381
384
  os.unlink(time_keeper)
382
- else:
383
- output_directory = self.prepare_output_directory()
384
- self.serve_directory(output_directory, time_keeper, al_client)
385
+ else:
386
+ output_directory = self.prepare_output_directory()
387
+ self.serve_directory(output_directory, time_keeper, al_client)
385
388
 
386
389
  def do_source_update(self, service: Service, specific_sources: list[str] = []) -> None:
387
390
  self.log.info(f"Connecting to Assemblyline API: {UI_SERVER}...")
@@ -555,7 +558,7 @@ class ServiceUpdater(ThreadedCoreBase):
555
558
  else:
556
559
  # Pull source metadata from synced service configuration
557
560
  signature_map = {
558
- source.name: {'classification': source['default_classfication']}
561
+ source.name: {'classification': source['default_classification'].value}
559
562
  for source in self._service.update_config.sources
560
563
  }
561
564
  open(os.path.join(new_directory, SIGNATURES_META_FILENAME), 'w').write(json.dumps(signature_map, indent=2))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: assemblyline-v4-service
3
- Version: 4.4.1.dev149
3
+ Version: 4.4.1.dev151
4
4
  Summary: Assemblyline 4 - Service base
5
5
  Home-page: https://github.com/CybercentreCanada/assemblyline-v4-service/
6
6
  Author: CCCS Assemblyline development team
@@ -1,4 +1,4 @@
1
- assemblyline_v4_service/VERSION,sha256=RJ1pG5eQK7GXyN4GDPtaqcwxFre8_drtukWHPxAmGLs,13
1
+ assemblyline_v4_service/VERSION,sha256=h63d9xP2Y2p_SIFY7WupJGvwwLnPoIGTTBIALmKdf3g,13
2
2
  assemblyline_v4_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  assemblyline_v4_service/healthz.py,sha256=sS1cFkDLw8hUPMpj7tbHXFv8ZmHcazrwZ0l6oQDwwkQ,1575
4
4
  assemblyline_v4_service/run_privileged_service.py,sha256=9uTfHetXR5G-EDKMDrgfWUOw34yr64-cj6Cm9eZaCbQ,14547
@@ -20,9 +20,9 @@ assemblyline_v4_service/updater/__main__.py,sha256=9Os-u8Tf7MD73JSrUSPmOaErTgfve
20
20
  assemblyline_v4_service/updater/app.py,sha256=OF-G7J8IYwTjdGw_BI9numBicZBN5lspm8Eqb3qbIl8,3229
21
21
  assemblyline_v4_service/updater/gunicorn_config.py,sha256=p3j2KPBeD5jvMw9O5i7vAtlRgPSVVxIG9AO0DfN82J8,1247
22
22
  assemblyline_v4_service/updater/helper.py,sha256=lUGEz-z6iL5xav8m-F1czKVp8_3Fo3FpSJxJZJ-q24U,9100
23
- assemblyline_v4_service/updater/updater.py,sha256=IXdJjGMXONhmj0D9GcRK7BmrFQdjO736kyAMju4IZ_c,31126
24
- assemblyline_v4_service-4.4.1.dev149.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
25
- assemblyline_v4_service-4.4.1.dev149.dist-info/METADATA,sha256=kzQnBwN27i9TCoiPlt5PoWmcVfQ3dQ0GxxP7fu4tbkI,9360
26
- assemblyline_v4_service-4.4.1.dev149.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
27
- assemblyline_v4_service-4.4.1.dev149.dist-info/top_level.txt,sha256=Ut5IqePObcxlJ8rv2--dOAzYbxzqlllfiV_51cbqjbA,24
28
- assemblyline_v4_service-4.4.1.dev149.dist-info/RECORD,,
23
+ assemblyline_v4_service/updater/updater.py,sha256=rjSTrg0m40nv8KoFJg1Z3aRoRszQBjSrkI78BT0TBBI,31289
24
+ assemblyline_v4_service-4.4.1.dev151.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
25
+ assemblyline_v4_service-4.4.1.dev151.dist-info/METADATA,sha256=33vUfqMZMVBDXbc4PgyC_WkfC4BDWp8GiZnlI3rfZo0,9360
26
+ assemblyline_v4_service-4.4.1.dev151.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
27
+ assemblyline_v4_service-4.4.1.dev151.dist-info/top_level.txt,sha256=Ut5IqePObcxlJ8rv2--dOAzYbxzqlllfiV_51cbqjbA,24
28
+ assemblyline_v4_service-4.4.1.dev151.dist-info/RECORD,,