public function addToBlacklistForThresholdReached(AddressInterface $ip = null, $ignoreConfig = false)
    {
        if ($ignoreConfig || $this->config->get('concrete.security.ban.ip.enabled')) {
            if ($ip === null) {
                $ip = $this->getRequestIPAddress();
            }
            $banDurationMinutes = (int) $this->config->get('concrete.security.ban.ip.length');
            if ($banDurationMinutes > 0) {
                $expires = new DateTime("+{$banDurationMinutes} minutes");
            } else {
                $expires = null;
            }
            $this->createRange(IPFactory::rangeFromBoundaries($ip, $ip), static::IPRANGETYPE_BLACKLIST_AUTOMATIC, $expires);
            $this->logger->warning(t('IP address %s added to blacklist.', $ip->toString(), $expires), [
                'ip_address' => $ip->toString()
            ]);
        }
    }