# How to use "opensearch.client.security" in python client?

**URL:** https://forum.opensearch.org/t/how-to-use-opensearch-client-security-in-python-client/15046
**Category:** OpenSearch
**Created:** [July 11, 2023, 8:15am UTC](https://forum.opensearch.org/t/how-to-use-opensearch-client-security-in-python-client/15046 "2023-07-11T08:15:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cucukaka](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@cucukaka](https://forum.opensearch.org/u/cucukaka)
#### Post date: [July 11, 2023, 8:15am UTC](https://forum.opensearch.org/t/how-to-use-opensearch-client-security-in-python-client/15046/1 "2023-07-11T08:15:30Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
opensearch 2.7.0  
python module “opensearch-py” 2.2.0

**Describe the issue** :  
I did “pip3 install opensearch-py”  
and then

```auto
rom opensearch import OpenSearch

host = 'localhost'
port = 9200
auth = ('admin', 'admin')
ca_certs_path = 'root_ca.pem'

 client = OpenSearch(
     hosts = [{'host': host, 'port': port}],
     http_auth = auth,
     use_ssl = True,
     verify_certs = True,
     ssl_assert_hostname = False,
     ssl_show_warn = False,
     ca_certs = ca_certs_path
 )

client.security.get_tanant("tenant")

```

I run this .py then gave this error

`AttributeError: 'OpenSearch' object has no attribute 'security'`

how to solve it?

and also there are no opensearchpy.plugins.security in Opensearch  
there is only alerting in opensearch.plugins  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/a/abda096a79e05074c4f76dee230f1d61ad715c1c.png)

refer) [opensearch-py/USER\_GUIDE.md at main · opensearch-project/opensearch-py · GitHub](https://github.com/opensearch-project/opensearch-py/blob/main/USER_GUIDE.md#security-plugin)

---

<div class="post-metadata">

### Author: ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)
#### Post date: [July 11, 2023, 7:12pm UTC](https://forum.opensearch.org/t/how-to-use-opensearch-client-security-in-python-client/15046/2 "2023-07-11T19:12:49Z")

</div>

@cucukaka As far as I can see, this has not been released yet.

The latest opensearch-py version is 2.2.0 and was released on March 1st. The security plugin support in the Python client was merged 2 weeks ago.
