Firewalls are usually seen as the first line of defence against cyber attack. They are essentially gateways to a network, letting in only authorised and trustworthy traffic. What is deemed trustworthy is dependent upon a set of security rules based on the data source, ports and destination involved. Through their moderation of traffic and where it is able to go, firewalls prevent unauthorised access to or from a private network.
A firewall can come in the form of hardware or software (or sometimes both), creating a barrier between secured internal networks and trusted or untrusted outside networks.
Though the term was in use in network security prior, and the idea developed over many years, the book ‘Firewalls and Internet Security: Repelling the Wily Hacker’ popularised the idea.