Security updates are not provided on versions older than Android 8.0. Newer versions receive security updates if the phone manufacturer supports them. Phones which have Android 10 and above receive security updates (like app updates) directly from Google Play.