# Encryption of the main.ini file

**URL:** https://forum.squirro.com/t/encryption-of-the-main-ini-file/103
**Category:** The Insight Engine
**Created:** [March 3, 2022, 3:28pm UTC](https://forum.squirro.com/t/encryption-of-the-main-ini-file/103 "2022-03-03T15:28:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![philipp.meierhofer](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@philipp.meierhofer](https://forum.squirro.com/u/philipp.meierhofer)
#### Post date: [March 3, 2022, 3:28pm UTC](https://forum.squirro.com/t/encryption-of-the-main-ini-file/103/1 "2022-03-03T15:28:01Z")

</div>

Hi Squirro team,

Great to see the new forum 🙂 I would have a question regarding the main.ini file encryption - I have read the encryption section on the documentation and would like to follow-up on the the out-of-the-box encryption service:

- beside the config files in the /etc/squirro folder I’d also like to encrypt the main.ini file located in the config folder to have no more plaintext environment passwords within the instance. Is this also supported by the service or does this need to be specifically added/configured (and if yes, could you advice how this would be best done)?
- alternative to the file encryption would also be the encryption of the plain text values (I think that was done at a client, but not sure anymore how).

Thanks,  
Philipp

---

<div class="post-metadata">

### Author: ![Lauren](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.squirro.com/lauren/32/18_2.png) [@Lauren](https://forum.squirro.com/u/Lauren)
#### Post date: [March 3, 2022, 3:47pm UTC](https://forum.squirro.com/t/encryption-of-the-main-ini-file/103/2 "2022-03-03T15:47:27Z")

</div>

Welcome Philipp! Great to see you here!

---

<div class="post-metadata">

### Author: ![sciurus\_vulgaris](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.squirro.com/sciurus_vulgaris/32/54_2.png) [@sciurus\_vulgaris](https://forum.squirro.com/u/sciurus_vulgaris)
#### Post date: [March 3, 2022, 5:25pm UTC](https://forum.squirro.com/t/encryption-of-the-main-ini-file/103/3 "2022-03-03T17:25:35Z")

</div>

Welcome @philipp.meierhofer! Thanks for your question regarding encryption of the main.ini file.

If as a partner you have access to the Squirro delivery repository you can find a [README.md file in the same config directory where the main.ini file will be located with instructions on how to do this](https://github.com/squirro/delivery/blob/master/config/README.md).

For reference, I have copied these instructions below.

### Encrypted Configuration

For encryption of the main.ini file the same facility is supported as for the Squirro platform itself. See the online documentation for [Securing your Configuration Files](https://squirro.atlassian.net/wiki/spaces/DOC/pages/84017196/Securing+your+Configuration+Files).

If the variables have been defined in `/etc/sysconfig/squirro` , then the `main.ini` file here is decrypted with the exact same options. If you don’t want to change that file, you can instead use `~/.squirro/sysconfig` or expose the environment variables manually by any other means.

#### Encrypting Values

To encrypt config values, use the provided `encrypt` utility. Example usage:

```auto
$ export SQ_ENCRYPTION_KEY=cqZbZlmzPqhjJzMB2Lc_pa_s0VGzzSsv1SSyOoQvw8k=
$ ./common/config/encrypt squirro token
Config value: 5634…6779
The value has been encrypted as:
CK_FERNET::gAAA…C7E2…

```

This resulting string ( `CK_FERNET::…` ) can now be stored manually in the config file as the value for the config setting:

```auto
[squirro]
token = CK_FERNET::gAAA…C7E2…
…

```

#### Manually Encrypting

If you provide your own `SQ_DECRYPT_COMMAND` you can also set `SQ_ENCRYPT_COMMAND` and use the `encrypt` utility as shown above.

If you want to encrypt manually, then take the encrypted value, prefix it with `CK_CMD::` and put it into the config file. Example:

```auto
[squirro]
token = CK_CMD::7VHcxRG4FddlZDHqeY9IltV5jWebbo…

```

---

<div class="post-metadata">

### Author: ![philipp.meierhofer](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@philipp.meierhofer](https://forum.squirro.com/u/philipp.meierhofer)
#### Post date: [March 4, 2022, 10:09am UTC](https://forum.squirro.com/t/encryption-of-the-main-ini-file/103/4 "2022-03-04T10:09:27Z")

</div>

Hi @Lauren, @sciurus_vulgaris,

Thanks a lot for the warm welcome, the quick reply and the provided details, happy to give it a try and will let you know how that works!

Thanks,  
Philipp
