Skip to content

Commit

Permalink
Changing cert thumbprint from Sha1 to Sha256 in Az Kusto driver (#775)
Browse files Browse the repository at this point in the history
Updating DataProviders docs to remove outdated content
  • Loading branch information
ianhelle authored May 10, 2024
1 parent 1ccfe16 commit 07a2f0d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 57 deletions.
2 changes: 2 additions & 0 deletions docs/source/DataAcquisition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Common Data Provider Operations
data_acquisition/DataProviders


.. individual-data-environments
Individual Data Environments
----------------------------

Expand Down
67 changes: 11 additions & 56 deletions docs/source/data_acquisition/DataProviders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <msticpy.data.data_providers.QueryProvider>`.
For details of this class see :py:class:`QueryProvider API <msticpy.data.data_providers.QueryProvider>`.


Connecting to a Data Environment
Expand All @@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion msticpy/data/drivers/azure_kusto_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 07a2f0d

Please sign in to comment.