# Whitelist a country, show captcha to country except whitelisted ASNs

**URL:** <https://community.traefik.io/t/whitelist-a-country-show-captcha-to-country-except-whitelisted-asns/22667>\
**Category:** Traefik v3 (latest)\
**Tags:** middleware\
**Created:** [May 9, 2024, 1:19pm UTC](https://community.traefik.io/t/whitelist-a-country-show-captcha-to-country-except-whitelisted-asns/22667 "2024-05-09T13:19:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![angel](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@angel](https://community.traefik.io/u/angel)\
**Post date:** [May 9, 2024, 1:19pm UTC](https://community.traefik.io/t/whitelist-a-country-show-captcha-to-country-except-whitelisted-asns/22667/1 "2024-05-09T13:19:09Z")

</div>

I would like to know if this is achievable with traefik (and crowdsec).

I would like to only allow access to a website for certain countries, the rest should be blocked.  
Inside that country, I have a list of ASNs that I consider to be probably non-malicious. For all of the rest, I would like to show a captcha on the first visit and not again for the next x days.  
If there is anything wrong with an IP from the "good" ASNs, I would like to be able to also give them a captcha/ban.

For the first part, I assume I can use [GitHub - JonasSchubert/traefik-allow-countries: A Traefik plugin to allow only certain countries and block everything else.](https://github.com/JonasSchubert/traefik-allow-countries) and I know about [crowdsec-bouncer-traefik-plugin/examples/captcha/README.md at main · maxlerebourg/crowdsec-bouncer-traefik-plugin · GitHub](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/captcha/README.md) for the second part but I am not sure if it can be configured in the way that I want it.

Is there a way to do it or is that something I am better off asking crowdsec about?
