Every service your system is listening for is a door. Some of those doors you opened on purpose and guard carefully. Others were opened years ago by an install, a vendor, or a default, and have been standing open ever since with nobody watching them. The first step in securing any system is knowing exactly what doors exist, which are open, and on IBM i you can see every one of them:
SELECT LOCAL_PORT, LOCAL_ADDRESS,
CONNECTION_TYPE, TCP_STATE
FROM QSYS2.NETSTAT_INFO
WHERE TCP_STATE = 'LISTEN'
ORDER BY LOCAL_PORT;
Every row that comes back is a port your system is actively listening on, waiting for a connection. That is your real attack surface, laid out in front of you.
Now read it the way an attacker would. For each listening port, the questions are simple and uncomfortable. Do I know what service this is? Does it still need to be running, or is it a leftover from something we stopped using years ago? Is it exposed more widely than it should be? A port listening for the whole world when it only needs to serve one internal subnet is a door standing open wider than necessary.
This is different from watching who is connected right now, which I have written about before. This is about what is possible, the full set of ways into the system, whether anyone is using them this minute or not. You secure a house by knowing every door and window, not just watching the ones people happen to be walking through.
Print your listening ports this week. For every one, be able to say what it is and why it is open. Every door you cannot explain is one worth closing, and closing an unused service is one of the cheapest security wins there is. This is a much more difficult item to identify and fix; the issue isn’t identifying which are open (That’s easy), the issue is WHY IS IT OPEN, and should it be. Oh, crap, sorry to burden you, but its your job to keep the machine safe.
Originally posted on LinkedIn. Join the conversation there.
Leave a Reply