# Profiles configuration

**URL:** <https://discourse.crowdsec.net/t/profiles-configuration/251>\
**Category:** Uncategorized\
**Created:** [August 26, 2021, 12:59pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251 "2021-08-26T12:59:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [August 26, 2021, 12:59pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/1 "2021-08-26T12:59:58Z")

</div>

Hello,

I have an issue with the profiles configuration, have the default profiles.yaml file in /etc/crowdsec/profiles.yaml. I want to use my own profiles.yaml in /etc/crowdsec/profiles/profiles.yaml like this:

name: default\_ip\_remediation  
filters:

- Alert.Remediation == true && Alert.GetScope() == “Ip”  
decisions:
- type: ban  
duration: 8h  
on\_success: break

I have updated the config.yaml file to change the profiles\_path variable to mine. But when i see the decisions (cscli decisions list) i see the ban for my ip for 4h. Can someone help me please ? ive tried a lot of configurations but its not working.

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![blotus](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/blotus/32/109_2.png) [@blotus](https://discourse.crowdsec.net/u/blotus)\
**Post date:** [August 26, 2021, 1:40pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/2 "2021-08-26T13:40:20Z")

</div>

Hello,

Just to make sure, have you reloaded/restarted crowdsec after updating the configuration ?

Updating your profile will only apply the updated ban duration for new bans, existing ban will expire after the old duration.

Also, profiles are _not_ applied when you manually add a ban with cscli, you have to trigger an actual scenario, this might be your issue.

---

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [August 26, 2021, 1:55pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/3 "2021-08-26T13:55:28Z")

</div>

Hello blotus,

Thanks for your answer, yes i restarted the crowdsec container and also deleted manually the ip to test again the profiles but not working. I’am using an http parser with scenarios both are working i only have the issue with the profile which take default 4h ban always

---

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [September 2, 2021, 3:02pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/4 "2021-09-02T15:02:47Z")

</div>

Please any help ?, it is urgent

---

<div class="post-metadata">

**Author:** ![blotus](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/blotus/32/109_2.png) [@blotus](https://discourse.crowdsec.net/u/blotus)\
**Post date:** [September 2, 2021, 3:16pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/5 "2021-09-02T15:16:30Z")

</div>

Sorry, I missed your last reply.

I was not able to reproduce your issue locally.

What is your crowdsec version ?  
Does `/etc/crowdsec/profiles.yaml` still exist ?  
What is the value of `profiles_path` in `/etc/crowdsec/config.yaml` ?

You can also just update the default profile and keep the default `config.yaml`, it would also work.

---

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [September 2, 2021, 3:32pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/6 "2021-09-02T15:32:43Z")

</div>

Hello Blotus,

Yes /etc/crowdsec/profiles.yaml still exists i tried to modify it also but it doesnt work, my crowdsec version is v1.1.1 under docker. in my /etc/crowdsec/conf.d/config.yaml the profiles\_path: /etc/crowdsec/profiles/profiles.yaml. Because i use a custom profile located in /etc/crowdsec/profiles/profiles.yaml.

config.yaml

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/crowdsec/original/1X/cc23816ba57abe281294e7e40187ec1b76d970ff.png)

profiles.yaml  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/crowdsec/original/1X/d289135dfbce84b4f97d30fdc0e7a167b8114c2a.png)

---

<div class="post-metadata">

**Author:** ![blotus](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/blotus/32/109_2.png) [@blotus](https://discourse.crowdsec.net/u/blotus)\
**Post date:** [September 2, 2021, 3:35pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/7 "2021-09-02T15:35:37Z")

</div>

Thanks.

How do you run your container ?  
By default, crowdsec will only look in `/etc/crowdsec/config.yaml` for its main configuration, not in `/etc/crowdsec/conf.d/config.yaml`.  
If you want to use this configuration file, you will have to pass it with the `-c` flag.

---

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [September 2, 2021, 3:36pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/8 "2021-09-02T15:36:28Z")

</div>

Yes i use the crowdsec -c /etc/crowdsec/conf.d/config.yaml -dsn file:///etc/crowdsec/tests/httpd.log -type crowdsecurity/http-w00tw00t command to specify my custom config file.

I can see that my scenario matched with parsers. But the profiles always take the default ban duration (4h)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/crowdsec/original/1X/35b63e794e9571be356e9276cd2c6f5b852d35d8.png)

---

<div class="post-metadata">

**Author:** ![thibault](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/thibault/32/2_2.png) [@thibault](https://discourse.crowdsec.net/u/thibault)\
**Post date:** [September 2, 2021, 3:53pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/9 "2021-09-02T15:53:03Z")

</div>

Can you show the output of `cscli config show` ? It seems that your profiles.yaml isn’t taken into account.

Thanks

---

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [September 3, 2021, 6:39am UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/10 "2021-09-03T06:39:16Z")

</div>

> [@thibault](#):
>
> cscli config show

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/crowdsec/original/1X/dd2cb918294a00bdf06d06b3998eac0a043fb03a.png)

I know that we see the profiles.yaml file is located in the default path /etc/crowdsec/profiles.yaml But when i launch the scenario test i use my own config with the crowdsec -c /etc/crowdsec/conf.d/config.yaml -dsn file:///etc/crowdsec/tests/httpd.log -type crowdsecurity/http-w00tw00t command. And in my config.yaml file the profiles file is located here /etc/crowdsec/profiles/profiles.yaml. So it should work right ?

With the -c flag  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/crowdsec/original/1X/0599b31afad9cc29aac560c1a3c3afe915645176.png)

Thanks

---

<div class="post-metadata">

**Author:** ![thibault](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/thibault/32/2_2.png) [@thibault](https://discourse.crowdsec.net/u/thibault)\
**Post date:** [September 3, 2021, 8:38am UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/11 "2021-09-03T08:38:58Z")

</div>

Hello,

Please keep in mind that the profiles are evaluated by the local api and not by the crowdsec agent.  
Is your local api running with the configuration pointing to your alternative profiles config ?

I’m sure I understand your setup completely, this sounds like a configuration issue rather than a bug, but looking forward to solve it with you 🙂

---

<div class="post-metadata">

**Author:** ![moha](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@moha](https://discourse.crowdsec.net/u/moha)\
**Post date:** [September 3, 2021, 12:47pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/12 "2021-09-03T12:47:39Z")

</div>

> [@thibault](#):
>
> Is your local api running with the configuration pointing to your alternative profiles config ?

Thanks for your answer thibault, how can i know if my local api is running with the configuration pointing to my alternative profiles config ? 🙂  
Because i though only have to put the profiles\_path in my custom config.yaml if i refer to the documentation. I have a local\_api\_credentials.yaml file but it is only for credentials

---

<div class="post-metadata">

**Author:** ![thibault](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/thibault/32/2_2.png) [@thibault](https://discourse.crowdsec.net/u/thibault)\
**Post date:** [September 3, 2021, 1:26pm UTC](https://discourse.crowdsec.net/t/profiles-configuration/251/13 "2021-09-03T13:26:11Z")

</div>

The local api is usually the “long running” process that will receive alerts from the agent. So it’s a bit hard to tell without knowing your setup. Typically, if you have the crowdsec service running “in the background”, what is relevant would be the configuration with which this service runs.

Hope I make sense 😅
