Nearly $8.7 million in federal funding is headed to dozens of religious institutions and community organizations across Maryland to help improve security.