With the macOS firewall on, a downloaded app that’s signed by a valid certificate authority is let in automatically by default. It can accept incoming connections without you ever seeing a prompt. I’d rather decide that myself, at least on a laptop that sits on hotel and train Wi-Fi.
The firewall has a command-line tool that’s not on your PATH. First check what it does now:
/usr/libexec/ApplicationFirewall/socketfilterfw --getallowsigned
That shows whether built-in and downloaded signed apps are allowed automatically. To stop it for downloaded apps:
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off
The built-in apps from Apple are a separate switch (--setallowsigned), and I’d leave that one alone. In System Settings it’s the same pair of options: Network, then Firewall, then Options, where you’ll find “Automatically allow downloaded signed software to receive incoming connections”.
To see which apps already have their own firewall entry:
/usr/libexec/ApplicationFirewall/socketfilterfw --listapps
This only matters when the firewall is on at all, which --getglobalstate tells you. It’s about incoming connections only, so it doesn’t stop an app from calling home. After the change, a new app that wants to listen for connections, like a game server or a sync tool, makes macOS ask you first, which is the whole point but takes some getting used to. And if the firewall is set by a configuration profile on a managed Mac, the command line can’t change it.
Further reading: Change Firewall settings on Mac, socketfilterfw man page