From 07a2f0d778cef859ed4660c137a4180f2cd9e305 Mon Sep 17 00:00:00 2001 From: Ian Hellen Date: Fri, 10 May 2024 15:53:59 -0700 Subject: [PATCH] Changing cert thumbprint from Sha1 to Sha256 in Az Kusto driver (#775) Updating DataProviders docs to remove outdated content --- docs/source/DataAcquisition.rst | 2 + .../source/data_acquisition/DataProviders.rst | 67 +++---------------- msticpy/data/drivers/azure_kusto_driver.py | 2 +- 3 files changed, 14 insertions(+), 57 deletions(-) diff --git a/docs/source/DataAcquisition.rst b/docs/source/DataAcquisition.rst index c0580529b..5123ecb9f 100644 --- a/docs/source/DataAcquisition.rst +++ b/docs/source/DataAcquisition.rst @@ -10,6 +10,8 @@ Common Data Provider Operations data_acquisition/DataProviders +.. individual-data-environments + Individual Data Environments ---------------------------- diff --git a/docs/source/data_acquisition/DataProviders.rst b/docs/source/data_acquisition/DataProviders.rst index 88ab54eff..3f65e2b93 100644 --- a/docs/source/data_acquisition/DataProviders.rst +++ b/docs/source/data_acquisition/DataProviders.rst @@ -62,41 +62,19 @@ as loading any built-in queries available for that environment. .. code:: ipython3 - qry_prov = QueryProvider( - data_environment=DATA_ENVIRONMENT, - ) - -There are two other optional parameters we can pass when initializing -our Query Providers to further customize it: - -1. You can also chose to -initialize our Query Provider with a driver other than the default one -for the chosen environment with: - -.. code:: ipython3 - - qry_prov = QueryProvider( - data_environment=DATA_ENVIRONMENT, - driver=DRIVER_CLASS_NAME, - ) - -TThe class must be imported before it can be used in this way. You -would only use this parameter if you were building your own -data driver backend, which is not common. - -2. You can choose to import additional queries from a custom -query directory (see :doc:`../extending/Queries` for more -details) with: + qry_prov = QueryProvider("MSSentinel") + qry_prov2 = QueryProvider(data_environment="Splunk") -.. code:: ipython3 +.. note:: The use of the parameter name `data_environment` is optional + as long as the data environment is the first parameter passed. - qry_prov = QueryProvider( - data_environment=DATA_ENVIRONMENT, - query_paths=QUERY_DIRECTORY_PATH - ) +There are other optional parameters we can pass when initializing +our Query Providers to further customize them. If these are relevant to the +provider, they are detailed in the provider-specific documentation. +:ref:`DataAcquisition:Individual Data Environments`. -For more details see :py:class:`QueryProvider API `. +For details of this class see :py:class:`QueryProvider API `. Connecting to a Data Environment @@ -108,32 +86,9 @@ Environment. This is done by calling the connect() function of the Query Provider we just initialized and passing it a connection string or authentication parameters to use. -Documentation string - -:: - - connect(self, connection_str: str, **kwargs): - - Connect to data source. - - Parameters - ---------- - connection_string : str - Connection string for the data source - - -Example - -.. code:: ipython3 - - la_connection_string = f'loganalytics://code().tenant("{ten_id}").workspace("{ws_id}")' - qry_prov.connect(connection_str=la_connection_string) - +For usage with a specific data provider please see the documentation +for each provider :ref:`DataAcquisition:Individual Data Environments`. -The format of the parameters supplied to the ``connect`` function varies -by the environment/driver you are trying to use. Please check -the details for the environment you are using in the -:ref:`DataAcquisition:Individual Data Environments` section. List of current built-in queries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/msticpy/data/drivers/azure_kusto_driver.py b/msticpy/data/drivers/azure_kusto_driver.py index 3a05331f1..016064f5d 100644 --- a/msticpy/data/drivers/azure_kusto_driver.py +++ b/msticpy/data/drivers/azure_kusto_driver.py @@ -615,7 +615,7 @@ def _create_kql_cert_connection_str( encryption_algorithm=serialization.NoEncryption(), ) public_cert = certificate.public_bytes(encoding=serialization.Encoding.PEM) - thumbprint = certificate.fingerprint(hashes.SHA1()) + thumbprint = certificate.fingerprint(hashes.SHA256()) return KustoConnectionStringBuilder.with_aad_application_certificate_sni_authentication( connection_string=self.cluster_uri, aad_app_id=auth_params.params["client_id"],