# Config suricata using python

**URL:** <https://forum.suricata.io/t/config-suricata-using-python/1006>\
**Category:** Help\
**Created:** [January 23, 2021, 4:05pm UTC](https://forum.suricata.io/t/config-suricata-using-python/1006 "2021-01-23T16:05:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darrkj2049](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/darrkj2049/32/568_2.png) [@darrkj2049](https://forum.suricata.io/u/darrkj2049)\
**Post date:** [January 23, 2021, 4:05pm UTC](https://forum.suricata.io/t/config-suricata-using-python/1006/1 "2021-01-23T16:05:37Z")

</div>

I am writing a python programme to control and configure suricata.yaml. I;m now trying to use configparser to do the work but it seems there are no keys to identify which section am in. For example, i want to read the address-groups so the user can configure which network to scan without going to yaml to edit the value.Can i name some section header in the yaml file?

---

<div class="post-metadata">

**Author:** ![Jeff\_Lucovsky](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/jeff_lucovsky/32/11_2.png) [@Jeff\_Lucovsky](https://forum.suricata.io/u/Jeff_Lucovsky)\
**Post date:** [January 23, 2021, 7:34pm UTC](https://forum.suricata.io/t/config-suricata-using-python/1006/2 "2021-01-23T19:34:02Z")

</div>

Not following … `address-groups` is in the `vars` section.

If you run `suricata --dump-config -c /path/to/suricata.yaml` you’ll see something like:

```auto
 $ src/suricata --dump-config -c suricata.yaml|grep vars.address-groups
vars.address-groups = (null)
vars.address-groups.HOME_NET = [192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]
vars.address-groups.EXTERNAL_NET = !$HOME_NET
vars.address-groups.HTTP_SERVERS = $HOME_NET
vars.address-groups.SMTP_SERVERS = $HOME_NET
vars.address-groups.SQL_SERVERS = $HOME_NET
vars.address-groups.DNS_SERVERS = $HOME_NET
vars.address-groups.TELNET_SERVERS = $HOME_NET
vars.address-groups.AIM_SERVERS = $EXTERNAL_NET
vars.address-groups.DC_SERVERS = $HOME_NET
vars.address-groups.DNP3_SERVER = $HOME_NET
vars.address-groups.DNP3_CLIENT = $HOME_NET
vars.address-groups.MODBUS_CLIENT = $HOME_NET
vars.address-groups.MODBUS_SERVER = $HOME_NET
vars.address-groups.ENIP_CLIENT = $HOME_NET
vars.address-groups.ENIP_SERVER = $HOME_NET

```

---

<div class="post-metadata">

**Author:** ![ish](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/ish/32/8_2.png) [@ish](https://forum.suricata.io/u/ish)\
**Post date:** [January 24, 2021, 12:41am UTC](https://forum.suricata.io/t/config-suricata-using-python/1006/3 "2021-01-24T00:41:03Z")

</div>

> [@darrkj2049](#):
>
> I;m now trying to use configparser

Python’s `configparser` module is for INI files. The Suricata configuration is a YAML file, so you’ll want to look into Python’s yaml module.
