It’s not legitimate. If you can’t close Safari by swiping up from the bottom of the screen force restart your phone:
- Press and quickly release VOLUME UP
- Press and quickly release VOLUME DOWN
- Hold the SIDE button until an Apple logo appears (15-30 seconds), ignoring "slide to power off"
The operative word here is QUICKLY; and try it a couple of times, the timing is a little tricky.
Then go to Settings/Safari and tap Clear History & Website Data.
Your phone doesn’t need any added security; iOS is secure itself. And see→Recognize and avoid phishing messages, phony support calls, and other scams - Apple Support