I get your feelings. It’s easy to fall into a jealousy trap with friends. That said, it’s pointless and unhelpful. When these feelings creep up, try to remember some of these points:
Other people’s relationships are not reflections of your relationships. What your friend does with boss doesn’t impact what you and your friend do together.
Your boss is not your friend. Even if your friend is low key bragging about the relationship they have with the boss, this isn’t something to be proud of. It’s good to maintain a positive relationship with your supervisor, but it’s healthy to maintain professional boundaries.
Exploring why you have a fear of your friend leaving you for someone else is a good thing, and could be aided by a good therapist.