To have job security, let go of job security.
Believe that you can be fired tomorrow, no matter how long you have been in this job.
This forces you to not take your job for granted and perform better.
The end result of this is that your job ends up being more secure than people who thought their jobs were secure.
PS - This post is only meant for tech professionals in case that isn't apparent.