howler-api 3.1.0.dev391__py3-none-any.whl → 3.1.0.dev393__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.
howler/datastore/store.py CHANGED
@@ -69,6 +69,7 @@ class ESStore(object):
69
69
  self._password: Optional[str] = None
70
70
  self._hosts = []
71
71
  self._cert: str | None = None
72
+ self._fingerprint: str | None = None
72
73
 
73
74
  for host in config.datastore.hosts:
74
75
  self._hosts.append(str(host))
@@ -77,6 +78,7 @@ class ESStore(object):
77
78
  if cert.exists():
78
79
  if self._cert is None:
79
80
  self._cert = str(cert)
81
+ logger.info("Using certificate %s for elasticsearch network traffic", self._cert)
80
82
  else:
81
83
  logger.error("Only a single certificate path is supported - ignoring additional paths.")
82
84
  logger.error(
@@ -84,6 +86,15 @@ class ESStore(object):
84
86
  "it for the first host."
85
87
  )
86
88
 
89
+ if host.fingerprint:
90
+ if self._fingerprint is None:
91
+ self._fingerprint = host.fingerprint
92
+ logger.info("Using certificate fingerprint %s for elasticsearch network traffic", self._fingerprint)
93
+ else:
94
+ logger.error(
95
+ "Only a single certificate fingerprint is supported - ignoring additional fingerprints."
96
+ )
97
+
87
98
  if os.getenv(f"{host.name.upper()}_HOST_APIKEY_ID", None) is not None:
88
99
  self._apikey = (
89
100
  os.environ[f"{host.name.upper()}_HOST_APIKEY_ID"],
@@ -105,6 +116,7 @@ class ESStore(object):
105
116
  self.client = elasticsearch.Elasticsearch(
106
117
  hosts=self._hosts, # type: ignore
107
118
  ca_certs=self._cert, # type: ignore
119
+ ssl_assert_fingerprint=self._fingerprint, # type: ignore
108
120
  api_key=self._apikey,
109
121
  max_retries=0,
110
122
  request_timeout=TRANSPORT_TIMEOUT,
@@ -113,6 +125,7 @@ class ESStore(object):
113
125
  self.client = elasticsearch.Elasticsearch(
114
126
  hosts=self._hosts, # type: ignore
115
127
  ca_certs=self._cert, # type: ignore
128
+ ssl_assert_fingerprint=self._fingerprint, # type: ignore
116
129
  basic_auth=(self._username, self._password),
117
130
  max_retries=0,
118
131
  request_timeout=TRANSPORT_TIMEOUT,
@@ -121,6 +134,7 @@ class ESStore(object):
121
134
  self.client = elasticsearch.Elasticsearch(
122
135
  hosts=self._hosts, # type: ignore
123
136
  ca_certs=self._cert, # type: ignore
137
+ ssl_assert_fingerprint=self._fingerprint, # type: ignore
124
138
  max_retries=0,
125
139
  request_timeout=TRANSPORT_TIMEOUT,
126
140
  )
@@ -63,6 +63,9 @@ class Host(BaseModel):
63
63
  apikey_secret: Optional[str] = Field(description="Secret data of the API Key to use when connecting", default=None)
64
64
  scheme: Optional[str] = Field(description="Scheme to use when connecting", default="http")
65
65
  host: str = Field(description="URL to connect to")
66
+ fingerprint: str | None = Field(
67
+ description="Optional certificate fingerprint to validate against when connecting to datastore", default=None
68
+ )
66
69
 
67
70
  def __repr__(self):
68
71
  result = ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: howler-api
3
- Version: 3.1.0.dev391
3
+ Version: 3.1.0.dev393
4
4
  Summary: Howler - API server
5
5
  License: MIT
6
6
  Keywords: howler,alerting,gc,canada,cse-cst,cse,cst,cyber,cccs
@@ -60,7 +60,7 @@ howler/datastore/howler_store.py,sha256=kW7FKM-tILcfTmrjSB1yZm-ZnumPS_tiQEZUDaQo
60
60
  howler/datastore/migrations/fix_process.py,sha256=J0FxqcXbQ161sgmQ5teyEcPuX7WYB9wqs0CO8m1jk0U,1218
61
61
  howler/datastore/operations.py,sha256=5WdJBewXRIG71ZexQcYASv0IYoDi1m9ia8332u5mXSs,3919
62
62
  howler/datastore/schemas.py,sha256=kuxqYVWMgqnrdU-ypkDxoSzEtECUrRCKXjU_R5Kg7X4,3158
63
- howler/datastore/store.py,sha256=GXBXqubhALd6fWjFqoM_YqbZOC1YnMA1hSaXsS7F3ak,8187
63
+ howler/datastore/store.py,sha256=NsUU9TEmxRBTKi1fm2j2UUagw6iCPapvt5f96VmUTn0,9005
64
64
  howler/datastore/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  howler/datastore/support/build.py,sha256=iBVfWophzoPlx6rvR5w3Axb6gjqLuDeDBpKj7lO-1l0,7877
66
66
  howler/datastore/support/schemas.py,sha256=kuxqYVWMgqnrdU-ypkDxoSzEtECUrRCKXjU_R5Kg7X4,3158
@@ -95,7 +95,7 @@ howler/odm/models/assemblyline.py,sha256=_wcTiX3A6bhA2SGlK9tDF0v-uwLpIabXE8j2Fw9
95
95
  howler/odm/models/aws.py,sha256=pJVadJqubdgT27riCfp7bEKVP4XsMZB0ZUnKAbmCMd0,895
96
96
  howler/odm/models/azure.py,sha256=o7MZMMo9jh1SB8xXCajl_YSKP2nnnWsjx_DPT6LnQKg,710
97
97
  howler/odm/models/cbs.py,sha256=onUiJOGUxK3iy_-4XkGGwHxFiFq9Td_p59Kum4XaR-w,1366
98
- howler/odm/models/config.py,sha256=KO_-AdTLL1NPHoEHoKqwHiOYa1kCZ-7YX3IcY9-UAsI,21723
98
+ howler/odm/models/config.py,sha256=mDjO8Wpfu0RtdJosL6cQIKIIRTRqB9PRWBOGG2uIOb0,21884
99
99
  howler/odm/models/dossier.py,sha256=Ob2qROrG2-DYzmVo2XVe4NJ8HjWGCoRAu2gPo6p9XGU,1244
100
100
  howler/odm/models/ecs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
101
  howler/odm/models/ecs/agent.py,sha256=idSooyFCLuQAB7_RyEWTYW4-x9w5a3wpy2ct_-EDRQs,713
@@ -192,7 +192,7 @@ howler/utils/path.py,sha256=DfOU4i4zSs4wchHoE8iE7aWVLkTxiC_JRGepF2hBYBk,690
192
192
  howler/utils/socket_utils.py,sha256=nz1SklC9xBHUSfHyTJjpq3mbozX1GDf01WzdGxfaUII,2212
193
193
  howler/utils/str_utils.py,sha256=HE8Hqh2HlOLaj16w0H9zKOyDJLp-f1LQ50y_WeGZaEk,8389
194
194
  howler/utils/uid.py,sha256=p9dsqyvZ-lpiAuzZWCPCeEM99kdk0Ly9czf04HNdSuw,1341
195
- howler_api-3.1.0.dev391.dist-info/METADATA,sha256=LLMThjzPzat64TGPdYt_t382kN-82sBrCB9eWaO_Rjs,2804
196
- howler_api-3.1.0.dev391.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
197
- howler_api-3.1.0.dev391.dist-info/entry_points.txt,sha256=Lu9SBGvwe0wczJHmc-RudC24lmQk7tv3ZBXon9RIihg,259
198
- howler_api-3.1.0.dev391.dist-info/RECORD,,
195
+ howler_api-3.1.0.dev393.dist-info/METADATA,sha256=WPpuFiztpsfsoSprcfpR9gcgjnRGjlCrEbePq0sRiGc,2804
196
+ howler_api-3.1.0.dev393.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
197
+ howler_api-3.1.0.dev393.dist-info/entry_points.txt,sha256=Lu9SBGvwe0wczJHmc-RudC24lmQk7tv3ZBXon9RIihg,259
198
+ howler_api-3.1.0.dev393.dist-info/RECORD,,