# How can i setup the secret-code correctly?

**URL:** <https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332>\
**Category:** Help\
**Tags:** rules, suricata\
**Created:** [March 18, 2022, 7:40am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332 "2022-03-18T07:40:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xifeng](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xifeng](https://forum.suricata.io/u/xifeng)\
**Post date:** [March 18, 2022, 7:40am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/1 "2022-03-18T07:40:53Z")

</div>

Hello, we tried to setup the rule-source with the command like "suricata-update enable-source et/pro secret-code=xxxxxxxxxxxxxxxx“， but why did we receive an error message like:

KeyError: ‘secret-code’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “/usr/local/bin/suricata-update”, line 33, in   
sys.exit(main.main())  
File “/usr/local/lib/python3.8/dist-packages/suricata/update/main.py”, line 1305, in main  
sys.exit(\_main())  
File “/usr/local/lib/python3.8/dist-packages/suricata/update/main.py”, line 1146, in \_main  
files = load\_sources(suricata\_version)  
File “/usr/local/lib/python3.8/dist-packages/suricata/update/main.py”, line 898, in load\_sources  
url = (index.resolve\_url(name, params), http\_header,  
File “/usr/local/lib/python3.8/dist-packages/suricata/update/sources.py”, line 132, in resolve\_url  
raise Exception(“Missing URL parameter: %s” % (str(err.args[0])))  
Exception: Missing URL parameter: secret-code

---

<div class="post-metadata">

**Author:** ![Andreas\_Herz](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/andreas_herz/32/52_2.png) [@Andreas\_Herz](https://forum.suricata.io/u/Andreas_Herz)\
**Post date:** [March 18, 2022, 7:59am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/2 "2022-03-18T07:59:01Z")

</div>

What version of suricata-update are you running?  
I couldn’t reproduce it

---

<div class="post-metadata">

**Author:** ![xifeng](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xifeng](https://forum.suricata.io/u/xifeng)\
**Post date:** [March 18, 2022, 8:06am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/3 "2022-03-18T08:06:15Z")

</div>

thank you, it’s 1.2.2

---

<div class="post-metadata">

**Author:** ![Andreas\_Herz](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/andreas_herz/32/52_2.png) [@Andreas\_Herz](https://forum.suricata.io/u/Andreas_Herz)\
**Post date:** [March 18, 2022, 8:13am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/4 "2022-03-18T08:13:13Z")

</div>

How did you install it?  
What is the system you use and the shell?  
Testing it with 1.2.2 did work as well, so must be something specific to your installation/setup

---

<div class="post-metadata">

**Author:** ![xifeng](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xifeng](https://forum.suricata.io/u/xifeng)\
**Post date:** [March 18, 2022, 8:19am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/5 "2022-03-18T08:19:20Z")

</div>

OS is ubuntu 18.01, after i have suricata installed i didn’t install suricata-update additionally. Should i re-install it with following the instructions from Git-hub?

---

<div class="post-metadata">

**Author:** ![Andreas\_Herz](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/andreas_herz/32/52_2.png) [@Andreas\_Herz](https://forum.suricata.io/u/Andreas_Herz)\
**Post date:** [March 18, 2022, 8:35am UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/6 "2022-03-18T08:35:31Z")

</div>

How did you install it exactly in Ubuntu?  
And yes you could try to directly use the release from github.

---

<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:** [March 21, 2022, 6:37pm UTC](https://forum.suricata.io/t/how-can-i-setup-the-secret-code-correctly/2332/7 "2022-03-21T18:37:58Z")

</div>

Also, if you just run `suricata-update enable-source et/pro` you should be prompted for the secret code.

However, I just tested both variants of adding `et/pro` with 1.2.2 and it works, at least on my system.

Are you getting this error during the `enable-source` command, or a subsequent call to `suricata-update` to update the rules?
