Blue
Ravenous Bugblatter Beast of Traal
Another odd case is an automated mechanism making an attack, such as an arrow trap. You could evade (haha) the issue by using a saving throw instead of an attack roll, but if you do go with an attack roll, is the "attacker" visible?
If the trap has a listed +X to hit, it's the attacker.
Is it visible? Depends on the circumstances. A big blade that comes down and slices is visible when attacking, so that seems obvious. Contact poison coating a door handle probably isn't - though that's a poor example since that's probably a save. Except for extenuating circumstances (invisible blades, certain spell attacks, etc.) I'd default to a trap that makes an attack roll being visible while making the attack.