The command /summon minecraft:endermite ~ ~ ~ {PlayerSpawned:1b} will summon a "player spawned" endermite that endermen will attack. However, if an Endermite has the Invulnerable NBT tag - for example one summoned with the command /summon minecraft:endermite ~ ~ ~ {PlayerSpawned:1b,Invulnerable:1b} - it will not be attacked by Endermen.
Linked issues
Comments 5
This is no longer relevant due to the fix of MC-53518
and the fact that no mobs attack invulnerable mobs
Can confirm for 20w46a.