system/Config/Services.php
public static function security(App $config = null, bool $getShared = true)
	{
		if ($getShared)
		{
			return static::getSharedInstance('security', $config);
		}

		if (! is_object($config))
		{
			$config = config(App::class);
		}

		return new Security($config);
	}
public static function security(App $config = null, bool $getShared = true)
	{
		if ($getShared)
		{
			return static::getSharedInstance('security', $config);
		}

		if (! is_object($config))
		{
			$config = config(App::class);
		}

		return new Security($config);
	}
The Security class provides a few handy tools for keeping the site
secure, most notably the CSRF protection tools.

@param \Config\App $config
@param boolean     $getShared

@return \CodeIgniter\Security\Security