14/12/2023
# Intrusion detection and prevention
# # Defensive Diamond Model :
We will harness the power of the Diamond Model's components, particularly capability and infrastructure, for our defensive endeavours.
1. Defensive Capability :defence is the best offence.
- Threat hunting : is a proactive and iterative process,to actively search for signs of malicious activities or security weaknesses within the organisation's network and systems.Threat hunters analyse behavioural patterns, identify advanced threats, and improve incident response. Developing predefined hunting playbooks and fostering collaboration among teams ensures a systematic and efficient approach to threat hunting.
- Vulnerability management: is a structured process of identifying, assessing, prioritising, mitigating, and monitoring vulnerabilities in an organisation's systems and applications.promptly patching or remediating vulnerabilities, and maintaining an up–to–date asset inventory is essential.
2. Defensive Infrastructure : making it more difficult for them to carry out their intended activities and providing an opportunity for detection and response.
- Firewall : monitoring and controlling the ebb and flow of incoming and outgoing network traffic.With its predetermined security rules.
- Stateless/packet-filtering: based on a set of rules that would point to a source or destination IP address, ports and protocols.
- Stateful inspection: track the state of network connections and use this information to make filtering decisions.
- Proxy service: by filtering messages at the application layer,
- Web application firewall (WAF): block common web attacks such as SQL injection, cross-site scripting, and denial-of-service attacks.
- Next-generation firewall: combines the functionalities of the stateless, stateful, and proxy firewalls with features such as intrusion detection and prevention and content filtering.
# Configuring Firewalls to Block Traffic
uncomplicated firewall is the default firewall configuration tool available on Ubuntu hosts, it's turned off by default ,
1. UFW Default Policies :
sudo ufw default allow outgoing
sudo ufw default deny incoming
2. Adding a Firewall rule with a port number and protocol :
sudo ufw allow 22/tcp
3. UFW Deny Rules :
sudo ufw deny from 192.168.100.25
sudo ufw deny in on eth0 from 192.168.100.26
4. Enabling UFW :
sudo ufw enable
sudo ufw status verbose
5. reset the firewall and, revert to its default state and be able to configure the rules fresh:
sudo ufw reset
man ufw
# Honeypot
It presents itself as an alluring target to the adversaries, drawing them away from the true prizes:
- Low–interaction honeypots: simple systems like web servers or databases.
- High–interaction honeypots: complex systems like operating systems and networks.