Defence in depth, multiple lines of defence. MFA / segregation
Separation of duties. Eg windows admins / network admins / backup admins. No one has full control of the org. We can also look at it like having 3 team members if one gets sick the team is still up
Fix security issues, do root cause analysis and fix for good.
If we opeerate in the EU and take CC payment then we need to comply with GDPR and PCIDSS.
The SIEM takes in all the logs from multiple sources. It will create dashboards / graphs / timelines etc.
Servers are the servers hosting the service s that the clients want to use.
Instead of having all the network devices and servers on site, companies can move their servers and network devices into the cloud and pay a cloud service provider (CSP).
Some benefits include on demand storage and processing power scaling. Cloud analytics (very useful for ops and security teams)
Just like normal infrastrucre, everything sits on top of the network and servers. None of the apps etc can work unless the infrastructure is working.
Basic unit of information that travels from one device to another over the network
- Application (HTTP, SMTP etc)
- Presentation (data translation / encryption / compression TLS)
- Session (Session manages open/active connections / reconnection them etc)
- Transport (transport, breaking up data into packets TCP/UDP)
- Network (get frames from data link and send them where to do, routing)
- Data link (macs and frames, NCP HDLC SDLC)
- Physical (cables etc)
TCP/IP model is real world. OSI is more theoretical. Need to be familiar with both.
IPv4 address
19.117.63.126
IPv6 address (32 characters)
684D:111:222:3333:444:555:6:77
All IPv4 addresses were being used up. We had to make IPv6 so there would be enough addresses for ever. So far it seems to have been adopted by service providers. I've not seen IPv6 on the LAN in most orgs. IPv6 addresses are much harder for humans to read and spot in logs.
Types of addresses:
- Public IP - on the internet
- Private IP - On the LAN
- MAC address - hardware address of the network card
Format of IPv4 packet
header 20-60
total 20 - 65535 bytes
- Version (VER): This 4 bit component tells receiving devices what protocol the packet is using. The packet used in the illustration above is an IPv4 packet.
- IP Header Length (HLEN or IHL): HLEN is the packet’s header length. This value indicates where the packet header ends and the data segment begins.
- Type of Service (ToS): Routers prioritize packets for delivery to maintain quality of service on the network. The ToS field provides the router with this information.
- Total Length: This field communicates the total length of the entire IP packet, including the header and data. The maximum size of an IPv4 packet is 65,535 bytes.
- Identification: IPv4 packets can be up to 65, 535 bytes, but most networks have a smaller limit. In these cases, the packets are divided, or fragmented, into smaller IP packets. The identification field provides a unique identifier for all the fragments of the original IP packet so that they can be reassembled once they reach their destination.
- Flags: This field provides the routing device with more information about whether the original packet has been fragmented and if there are more fragments in transit.
- Fragmentation Offset: The fragment offset field tells routing devices where in the original packet the fragment belongs.
- Time to Live (TTL): TTL prevents data packets from being forwarded by routers indefinitely. It contains a counter that is set by the source. The counter is decremented by one as it passes through each router along its path. When the TTL counter reaches zero, the router currently holding the packet will discard the packet and return an ICMP Time Exceeded error message to the sender.
- Protocol: The protocol field tells the receiving device which protocol will be used for the data portion of the packet.
- Header Checksum: The header checksum field contains a checksum that can be used to detect corruption of the IP header in transit. Corrupted packets are discarded.
- Source IP Address: The source IP address is the IPv4 address of the sending device.
- Destination IP Address: The destination IP address is the IPv4 address of the destination device.
- Options: The options field allows for security options to be applied to the packet if the HLEN value is greater than five. The field communicates these options to the routing devices.
Network protocols
A sample flow of a basic connection to a website.
- DNS - lookup IP to domain name www.website.com
- ARP - Find where next hope gateway is towards internet
- TCP - Make a connection to the website IP
- TLS - Setup secure connection between client and server
- HTTPS - Display the webpage in the browser over the TLS connection
WIFI security
IEEE 802.11 is WIFI
WEP (broken) > WPA (transitional) > WPA2 (KRACK attacks still work) > WPA3 (more secure, more complex)
Firewalls
Allow/block traffic based on their rules. The rules are configured by admin.
- Hardware - physical device has its own memory/CPU
- Software - Software imagine which can run in your virtualization infra
- Cloud - Cloud hosted software firewall
stateless - Just applies its rules to traffic but doesn't keep track of connections (less secure
stateful - keeps track of connections and filters threats
ngfw - Does everything stateful does and more (DPI, IPS, Threat intel, content filtering etc)
Firewalls are often the headend for dial in VPNs (remote access for users)
VPNs (virtual private networks)
- Site links are expensive, we can make VPN across the public internet but keep them secure
- S2S VPNs - connect two sites via an encrypted tunnel
- dial in or RA VPNS - remote access VPNs for end users to work from home etc
Security Zones
Before we had interfaces
Now we can have zones where we have multiple interfaces in one zone
Zones are used as part of network segmentation
Outside/internet - uncontroller
Ideally
Internet > firewall > DMZ > firewall > LAN > firewall > Restricted zone
We can have multiple DMZ's / LANs / WIFIs / Restricted zones
Often to cut costs we will just have one firewall with each zone as an interface off the firewall
Internet > firewall > DMZ/LAN/WIFI/Restricted
The firewall controls access between the zones.
To do some network segmentaiton
- Firewall interface (with firewall rules applied)
- Assign it to the inside security zone
- Attach interface to the LAN vlan on the switch
- Create an IP subnet for the LAN network
Proxy servers
The proxy server forwards requests on.
The most common was a web proxy or forward proxy.
user > web proxy > internet
Users never get direct internet access.
Reverse proxy (often socks5) take data from internet/dmz and forwards it to inside servers.
forward: user > proxy > internet
reverse: internet/dmz > proxy > server
Many left behind forward proxies for cisco umbrella / dns protection.
VPN protocols
Wireguard
- code base: 4K lines
- cryptography: fixed modern suite
- High speed vpn
- newer (2016)
- open source
- key-pairs but not built in identity system
IPsec (IKEV2)
- code base: 10K plus
- Earlier protocol (late 1990s)
- More complex
- cryptography: Negotiable, many cipher/algorithm
- Tried and tested, well supported
TLS/DTLS-based VPNs (OpenVPN, Cisco AnyConnect/DTLS, GlobalProtect)
- code base: 10K plus
- In the middle protocol (openvpn 2001, dtls 2006)
- More complex
- cryptography: Negotiable, many cipher/algorithm
- Tried and tested, well supported
Rule-of-thumb selection guidance
- Need it to work everywhere, even hostile networks > TLS/DTLS (OpenVPN-style)
- Need broad native client support with enterprise auth (RADIUS/certs/MFA) > IPsec/IKEv2
- Need maximum speed/efficiency and control both ends > WireGuard (often paired with an identity/ACL layer like Tailscale for enterprise use)
Security hardening
Just like our house we don't leave doors and windows opens, we might use CCTV cameras and have a house alarm.
In IT we patch/update our systems. We require passwords/MFA to get access, we encrypt data in transit. We monitor logs for suspicious activity
OS hardening
- OS updates/patches
- Application updates/patches
- Library, some applications make use of common public librarys/packages, usually covered by updating the application but not always
- Password policies and MFA
- Baseline config
Brute force attacks - trying every combination of password
Dictionary attacks - trying password lists of credentials from previous breachs
Rainbow table attack - If we have a hash of the users password we can see if the hash has been cracked already to the plain text password.
Hashing
We take a plain text "password" and hash it with give a string. It's a one way password > hash. Then we can store the hash in our database instead of the users password.
Salting
Involves adding salt to the dish. hash = H(password + salt).
The salt is the stored alongside the hash (it doesn't need to be secret).
Rainbow table attacks: Attackers precompute huge tables of hash values for common passwords. If your hash matches an entry, they instantly know the password. Salting defeats this because each password now hashes differently even if the underlying password is the same — a precomputed table would need to account for every possible salt, making the attack impractical.
Duplicate detection: Without salts, two users with the same password get the same hash — visibly revealing that they share a password. Salts make each hash unique even for identical passwords.
Network hardening- Updating software on network devices
- Using a firewall/ACLs to control access
- Port filtering
- network segmentation
- use latest encryption
- network log analysis
- IPS/IDS
Network security in the cloud
Cloud security we should use baseline OS images
You can think about cloud security like living in a house alone. You might leave everything unlocked because its just you there. However if you have roommates you might start locking your room. When you are in a public cloud you are in there with roommates. Then cloud vendor and other customers.
Keep in mind with cloud some aspects will be hidden to you. With on prem you would have access to everything.
CSP secures the cloud infra and OS patches etc.
hypervisor type1: run on hardware
hypervisor type2: software
security holes in hypervisor can lead to VM escapes.
Baselining all security settings
encryption on data in flow and at rest
TPM: chip in computer to store private keys
CLoudHSM: cloud hardware security module
Security groups are groups in cloud that limit exposre of N/S and E/W traffic.
BIOS chips boot the computer
UEFI chips replaced BIOS chips on modern computers
BIOS/UEFI chips have a list of checks to boot the computer hardware
The last instruction activates the bootloader.
Bootloader is a software program that boots the OS
Once the OS boots the user can interface with the computer/applications
There are many attacks on operating systems but keep in mind there are attacks on chips and bootloaders too.
The OS is like a conductor allocating resources when and where needed.
The computer has limited resources but lots of applications asking for memory/CPU/disk access
GUI vs CLI
Often you will need to work on CLI in linux in IT security
GUI: Icons and text
CLI: text based and commands
Using CLI is usually faster when you know what to do
history file is recorded so you can see what you have used
you may look at history file in a security incident
Linux in security
linux is open source
gnu public license so they can be used and improved
global group of people working on code
FSH - file system hierarchy
almalinux replaced centos
Package managers
apt and yum for installing applicaton
Types of shells
bourne again shell (bash)
c shell (csh)
korn shell (ksh)
enchanced c shell (tcsh)
z shell (zsh)
bash is default for most distros
standard input (info you input into the shell)
String data
echo hello
standard output
the computers response on the cli
standard error
any errors the computer needs to output
Linux shell
You will need to work with log files and set permissions via the cli
Bash shell is the default for most distros and often all that is available on older systems
cat - output the full file
more - output the file but paged
head -n 5 - see the top of the file
tail -n 5 - see the end of the file
The root directory is always at the top and its /
/home - user directories
/bin - binary executables (programs)
/etc - config files
/tmp - temp files
/mnt - mounted media stores like USB drives or network shares
man heir to learn more
Grep
grep OS updates.txt
We are looking for "OS" in the updates.txt file
Pipe |
Sends the output of one command to another command
ls /home | grep users
Filtering for certain information is important for cyber sec professionals
Fin search for directories and files and meet a criteria
find /home/analyst/projects
-name is case sensitive
-iname is not case sensitive
find /projects/ -iname log
-mtime 3 all files that have been modified in the last 3 days
-mtrime +1 all files modified more than 1 day ago
Deleting directory
rmdir oldreports
Deleting file
rm file.txt
delete a directory and everything under it
rm -rf oldproject
File editors
Nano is good for beginners
vi or vim is often on older systems, neovim is a newer version
emacs is also popular older editor