CSF has a feature that allows users to block countries by their country code.
In the CSF configuration, you can block a country by adding their country code using the CC_DENY directive. Below is an example where three country codes are blocked:
CC_DENY = "US,GB,DE"
The same setting can also be accessed from WHM by navigating to Plugins >> ConfigServer Security & Firewall >> Firewall Configuration. And from the Firewall Configuration screen, the CC_DENY directive can be seen as shown in the screenshot below: