# Custom bad user agents

**URL:** <https://discourse.crowdsec.net/t/custom-bad-user-agents/2117>\
**Category:** crowdsec\
**Created:** [November 4, 2024, 10:23am UTC](https://discourse.crowdsec.net/t/custom-bad-user-agents/2117 "2024-11-04T10:23:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amuench](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@amuench](https://discourse.crowdsec.net/u/amuench)\
**Post date:** [November 4, 2024, 10:23am UTC](https://discourse.crowdsec.net/t/custom-bad-user-agents/2117/1 "2024-11-04T10:23:18Z")

</div>

Hi,  
i am new to crowdsec. First thing I wanna do is to block following bad user agents:

- claudebot
- Bytespider
- bytedance
- facebookexternalhit

I had a look at [https://hub-data.crowdsec.net/web/bad\_user\_agents.regex.txt](https://hub-data.crowdsec.net/web/bad_user_agents.regex.txt) and could not find these agents.

So my question is, what is the best way to add these agents to keep crowdsec updateable.  
Hope that s.o. can help me out …  
Best regards, Alexander

---

<div class="post-metadata">

**Author:** ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)\
**Post date:** [November 5, 2024, 10:18am UTC](https://discourse.crowdsec.net/t/custom-bad-user-agents/2117/2 "2024-11-05T10:18:00Z")

</div>

Best way would be to create a copy of the bad user agents scenario and define your own data file. Note to change the `name` key that within the scenario to something else such as `my/bad-user-agents`

Please note that the datafiles of “local” made scenario are not automatically downloaded so you would have to ensure those files are download manually to the data directory. You can find the configured data directory by looking at the `config.yaml` within the crowdsec directory.

---

<div class="post-metadata">

**Author:** ![amuench](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@amuench](https://discourse.crowdsec.net/u/amuench)\
**Post date:** [November 5, 2024, 2:06pm UTC](https://discourse.crowdsec.net/t/custom-bad-user-agents/2117/3 "2024-11-05T14:06:30Z")

</div>

Ok, thank you so much !

I have a last question regarding this issue.

How can I set the trigger to manually download the datafiles? Or is it enough to copy the data file to data dir manually? Perhaps there is some more documentation out there I haven’t got so far

---

<div class="post-metadata">

**Author:** ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)\
**Post date:** [November 6, 2024, 8:58am UTC](https://discourse.crowdsec.net/t/custom-bad-user-agents/2117/4 "2024-11-06T08:58:24Z")

</div>

If you host a file externally like on github, you can just use a cronjob to download these or scp them. Basically any downloading or copying software can work.
