A firewall is a network security device that monitors and filters incoming and outgoing network traffic based on an organization's previously established security policies. Essentially, it acts as a barrier between a trusted internal network and untrusted external networks, such as the internet.