System for preventing bacterial infections in needle trajectories