Cybersecurity
Cybersecurity
M.Kom.
Imagine
Security is about preparation. Imagine yourself takes an math
exam. You prepare not only physical but also mentality to get along
the exam. You prepare some tools like pencil, eraser, and pen.
Prepare with some concepts and materials. You could also prepare
by doing light physical exercise to refresh your body. Cybersecurity
is nothing different.
1. Definition
The practice of confidentiality, integrity, and
availability information (CIA) by protecting
networks, devices, people, and data from
unauthorize access or criminal exploitation.
2. Cybersecurity Analyst
• Protecting Computer and Network System
Responsibility
• Installing prevention software
• Conduction periodic security audit
I Wayan Pio Pratama,
M.Kom.
Question
This practice will help the student to remember what we have
learned step by step.
Cybersecurity
Reasons
There must a motive why does the surge of cybersecurity happen!
Terms and
Concepts
There are many terms and concepts related to cybersecurity. Being
familiar with them will give us better skills to identify the threats
that can harm organizations and people alike. A security analyst
focus on monitoring networks for breaches. They also help to
develop strategies to secure organization and research IT security
trends to remain alert and informed about potential threats.
Additionally, an anlyst works to prevent incidents.
Key Concepts
• Compliance
• Security frameworks
• Security controls
• Security posture
• Threat actor
• Internal threat
• Network security
• Cloud security
• Programming
I Wayan Pio Pratama,
M.Kom.
Question
This practice will help the student to remember what we have
learned step by step. This practice also let the student pro active to
find what is the meaning of key concepts in cybersecurity
Question
This practice require student to do find information without material
provided. This will train them to be active searching for information
independently.
End of Part 1
By the end of this part the students are expected to understand the
concept of cybersecurity and know the formal definition of
cybersecurity. The student also be able to explain the the
responsibility of security analyst and know the terms and key
concept of cybersecurity. Student also learn the motive behind the
surge of security problem and the threat actors in cybersecurity
world.
is any person or group who presents a security is a process that can be used to create a
risk. This risk can relate to computers, specific set of instructions for a computer to
applications, networks, and data execute tasks
•Technical skills :
Programming Languages, Security Information and Event
Management (SIEM Tools), Intrusion Detection Systems (IDSs), Threat
Landscape, Knowledge, Incident Response
Common Attacks and Their Effectiveness
Phising Why Social Engineering Effective ?
• BEC • Authority
• Spear Phising • Intimidation
• Whaling • Consensus/Social Proof
• Vishing • Scarcity
• Smishing • Familiarity
• Trust
Malware
• Urgency
• Virus
• Worm
• Ransomware
• Spyware
Social Engineering
• Social Media Phising
• Watering Hole Attack
• USB Baiting
• Physical Social Engineering
CISSP (Certified Information Systems Security
Professional)
CISSP has defined eight domains to organize the work of security professionals. (2022)
Threat Actor Type
• Advanced persistent threats
Damaging critical infrastructure, such as the power grid and natural resources
Gaining access to intellectual property, such as trade secrets or patents
• Insider threats
Sabotage
Corruption
Espionage
Unauthorized data access or leaks
• Hacktivists
Demonstrations
Propaganda
Social change campaigns
Fame
Hacker
A hacker is any person who uses computers to gain access to computer systems, networks, or data.
They can be beginner or advanced technology professionals who use their skills for a variety of
reasons. There are three main categories of hackers:
• Authorized hackers are also called ethical hackers.
• Semi-authorized hackers are considered researchers.
• Unauthorized hackers are also called unethical hackers.
Security Frameworks, PII & SPII
Security frameworks are guidelines used for building plans to help mitigate risks and threats to
data and privacy
Purpose of Security Frameworks
1. Protecting PII
2. Securing financial information
3. Identifying security weaknesses
4. Managing operational risks
5. Aligning security with business goals
How controls, frameworks, and compliance are
related
Organization :
• The Federal Energy Regulatory
Commission - North American Electric
Reliability Corporation (FERC-NERC)
• The National Institute of Standards
and Technology (NIST)
• Center for Internet Security (CIS®)
• International Organization for
Standardization (ISO)
• System and Organizations Controls
(SOC)
• Payment Card Industry Data Security
Standard (PCI DSS)
• The Health Insurance Portability and
Accountability Act (HIPAA)
• The Federal Risk and Authorization
Management Program (FedRAMP®)
• General Data Protection Regulation
(GDPR)
Ethical concepts that guide cybersecurity decisions
United States standpoint on counterattacks
In the U.S., deploying a counterattack on a threat actor is illegal because of laws like the Computer
Fraud and Abuse Act of 1986 and the Cybersecurity Information Sharing Act of 2015, among
others. You can only defend. The act of counterattacking in the U.S. is perceived as an act of
vigilantism. A vigilante is a person who is not a member of law enforcement who decides to stop a
crime on their own. And because threat actors are criminals, counterattacks can lead to further
escalation of the attack, which can cause even more damage and harm. Lastly, if the threat actor
in question is a state-sponsored hacktivist, a counterattack can lead to serious international
implications. A hacktivist is a person who uses hacking to achieve a political goal. The political goal
may be to promote social change or civil disobedience
Web vulnerability
A web vulnerability is a unique flaw in a web application that a threat actor could exploit by using
malicious code or behavior, to allow unauthorized access, data theft, and malware deployment.
Open Web Application Security Project (OWASP) Top 10
Antivirus software
Antivirus software is a software program used to prevent, detect, and eliminate malware and
viruses.
Penetration Testing
Penetration testing, also called pen testing, is the act of participating in a simulated attack that
helps identify vulnerabilities in systems, networks, websites, applications, and processes.
Network
A group of connected devices
To connect we can use cable or wareless. IP/Mac Address unique address to locate each others.
Type Of Networks :
• LAN (Local Area Network)
• WAN (Wide Area Network)
• Router • Modem
• Internet Layer
The internet layer, sometimes referred to as the network layer, is responsible for ensuring the
delivery to the destination host, which potentially resides on a different network. It ensures IP
addresses are attached to data packets to indicate the location of the sender and receiver. The
internet layer also determines which protocol is responsible for delivering the data packets and
ensures the delivery to the destination host. Here are some of the common protocols that operate
at the internet layer:
Internet Protocol (IP). IP sends the data packets to the correct destination and relies on the
Transmission Control Protocol/User Datagram Protocol (TCP/UDP) to deliver them to the
corresponding service. IP packets allow communication between two networks. They are
routed from the sending network to the receiving network. TCP in particular retransmits any
data that is lost or corrupt.
Internet Control Message Protocol (ICMP). The ICMP shares error information and status
updates of data packets. This is useful for detecting and troubleshooting network errors. The
ICMP reports information about packets that were dropped or that disappeared in transit,
issues with network connectivity, and packets redirected to other routers.
• Application Layer
The application layer in the TCP/IP model is similar to the application, presentation, and
session layers of the OSI model. The application layer is responsible for making network
requests or responding to requests. This layer defines which internet services and applications
any user can access. Protocols in the application layer determine how the data packets will
interact with receiving devices. Some common protocols used on this layer are:
Hypertext transfer protocol (HTTP)
Simple mail transfer protocol (SMTP)
Secure shell (SSH)
File transfer protocol (FTP)
For more Domain name system
information, visit(DNS)aka.ms/staysafeonline
Sources: U.S.Application layer
Department of Justice, How toprotocols relyfrom
Protect your Networks onRansomware;
underlying layers to transfer the data across the
Anti-Phishingnetwork.
Working Group, Phising Activity Trends Report, Q4 2015;
Verizon, Data Breach Investigations Report, 2015
OSI MODEL DETAIL
• Physical Layer
As the name suggests, the physical layer corresponds to the physical hardware involved in
network transmission. Hubs, modems, and the cables and wiring that connect them are all
considered part of the physical layer. To travel across an ethernet or coaxial cable, a data
packet needs to be translated into a stream of 0s and 1s. The stream of 0s and 1s are sent
across the physical wiring and cables, received, and then passed on to higher levels of the OSI
model.
• Network Layer
The network layer oversees receiving the frames from the data link layer (layer 2) and delivers
them to the intended destination. The intended destination can be found based on the address
that resides in the frame of the data packets. Data packets allow communication between two
networks. These packets include IP addresses that tell routers where to send them. They are
routed from the sending network to the receiving network.
• Transport Layer
The transport layer is responsible for delivering data between devices. This layer also handles
the speed of data transfer, flow of the transfer, and breaking data down into smaller segments
to make them easier to transport. Segmentation is the process of dividing up a large data
transmission into smaller pieces that can be processed by the receiving system. These
For segments
more information,need to bevisit reassembled at their destination so they can be processed at the session
aka.ms/staysafeonline
layer
Sources: (layerof5).
U.S. Department The
Justice, speed
How to and
Protect your ratefrom
Networks ofRansomware;
the transmission also has to match the connection speed
of the destination system. TCP and UDP are transport layer protocols.
Anti-Phishing Working Group, Phising Activity Trends
Verizon, Data Breach Investigations Report, 2015
Report, Q4 2015;
OSI MODEL DETAIL (Cont...)
• Session Layer
A session describes when a connection is established between two devices. An open session
allows the devices to communicate with each other. Session layer protocols keep the session
open while data is being transferred and terminate the session once the transmission is
complete.
The session layer is also responsible for activities such as authentication, reconnection, and
setting checkpoints during a data transfer. If a session is interrupted, checkpoints ensure that
the transmission picks up at the last session checkpoint when the connection resumes.
Sessions include a request and response between applications. Functions in the session layer
respond to requests for service from processes in the presentation layer (layer 6) and send
requests for services to the transport layer (layer 4).
• Presentation Layer
Functions at the presentation layer involve data translation and encryption for the network.
This layer adds to and replaces data with formats that can be understood by applications
(layer 7) on both sending and receiving systems. Formats at the user end may be different
from those of the receiving system. Processes at the presentation layer require the use of a
standardized format.
Some formatting functions that occur at layer 6 include encryption, compression, and
confirmation that the character code set can be interpreted on the receiving system. One
example of encryption that takes place at this layer is SSL, which encrypts data between web
servers and browsers as part of websites with HTTPS.
• Application Layer
The application layer includes processes that directly involve the everyday user. This layer
includes all of the networking protocols that software applications use to connect a user to the
internet. This characteristic is the identifying feature of the application layer—user connection
For to morethe internet
information, via applications and requests.
visit aka.ms/staysafeonline
An
Sources: U.S. example of a How
Department of Justice, type of communication
to Protect that happens at the application layer is using a web
your Networks from Ransomware;
browser. The internet browser uses HTTP or HTTPS to send and receive information from the
Anti-Phishing Working Group, Phising Activity Trends
Verizon, Data Breach Investigations Report, 2015
Report, Q4 2015;
website server. The email application uses simple mail transfer protocol (SMTP) to send and
Components of network layer communication
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.
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.
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.
For more information, visit aka.ms/staysafeonline
Sources: U.S. Department of Justice, How to Protect your Networks from Ransomware;
Anti-Phishing Working Group, Phising Activity Trends Report, Q4 2015;
Verizon, Data Breach Investigations Report, 2015
Network components, devices, and diagrams
Cloud computing refers to the practice of using remote servers, applications, and
network services that are hosted on the internet instead of at a physical location owned by
the company.
A cloud service provider (CSP) is a company that offers cloud computing services. These
companies own large data centers in locations around the globe that house millions of servers.
Benefit :
• Reliability
• Cost
• Scalability
D
a
How to do Experiment ?
The problem is that we normally doesn’t have adequate resources to do the
experiment.
In real scenario we will need to have more than one PC to try the concept.
We also need to have the right Operating System (OS) for convenient.
That’s why we need to do another approach by utilizing virtual machine. One
of them is by installing docker desktop in our personal machine.
WEF
(Windows
Event
Forwarding)
Log Event
Management
Indexing Dashboard / UI
Database
D
a
How to do Experiment ?
Some tools have indexing database and dashboard by default some are not.
Some tools has capability to be integrated with wide variety of indexing
database and dashboard. In this class we’ll stick to use “wazuh” and
“elastic search” and “kibana”. The combination of those tools is to
monitoring log/activity and preserve the CIA principal is called SIEM tools.
Wazuh
Agent
D
a
Architecture For Experiment
node/server/cluster
Master
Wazuh Manager + elastic search +
kibana + wazuh agent installed in the Wazuh Agent
same node/machine
All tools are installed in the same machine so it means the machine
become the master/manager/storage/interface and also become the
agen for itself.
Not really happen in real scenario.
node/server/cluster
Master
Wazuh Manager + elastic search +
kibana installed in the same
node/machine
node/server/cluster
Master
Wazuh Manager No SQL DB
Dashboard UI
Load Balancer
WSL
We can create docker image from base docker file. You can override it by
writing your own Dockerfile or install anything in the container and build
your own image after that.
You can get based docker image from Docker Hub repository.
https://hub.docker.com/
We can create docker image from base docker file. You can override it by
writing your own Dockerfile or install anything in the container and build
your own image after that.
You can get based docker image from Docker Hub repository.
https://hub.docker.com/
Check
installation
O
R
After images downloaded using “docker pull” command from docker hub repository then it will be store in (for
windows OS):
The status exit directly after the container start because no process in the foreground
of ubuntu after we run it. So we have no option to use the container again. Even if you
try to use “docker start <containerid>” it will stop directly after it. For images that
run in the foreground like “nginx” as example, do “docker run <image_name>” will
not stop the container directly, but it will attach your terminal. So you need to open
another terminal to interact. The solution is add “-d” in your docker run command
(“docker run -d <image_name>”).
For image like this I recommend to build the container using “docker run -it pp-
ubuntu”. As information : we cannot update command for existing container. The
Ionly
Wayan Pio is
option Pratama, M.Kom.
to create another container with the command we want using docker
run and remove unsed docker container with command “docker rm
<containerid>”.
Access Docker in CMD
Running images to be docker container
You can stop the container using “docker stop <containerid>” and run it again
using “docker start <containerid>”. For any docker is still running then you can go
into its interactive mode by using “docker exec -it <containerid>”.
To exit from interative mode you can type “exit” then press enter. We also be able
to inspect the container to see its configuration especially volume and network. To
do that execute “docker inspect <containerid>”.
We also be able to see any network config in the docker and its volume by “docker
network ls” and “docker volume ls”. So does createa and remove network or
volume using
• “docker network create <network_name>”
• “docker network rm<network_name>”
• “docker volume create <volume_name>”
• “docker volume rm <volume_name>”
• No systemd (systemctl)
Let’s say you want to run multiple service in a real ubuntu you will need to have
systemd to manage the service. But container normally running only single
application for example web service or database service only (so typically you
don’t need system for container in docker).
Systemd will be beneficial when you have to run multi service for example redis and
nginx on the same linux machine (full linux).
In order to get full linux system in docker container you have to do several
steps:
1. Run docker container (docker run –it –name=pp-ubuntu-systemd ubuntu-
image)
2. Sudo apt-get install -y systemd systemd-sysv
3. Commit ubuntu container then recreate it with option in step 3, 4, and 5
4. Mount your container with -v /sys/fs/cgroup:/sys/fs/cgroup:ro (ro: readonly)
5. Create temporary file system using tmpfs for /run and /run/lock
6. /sbin/init the main process of system
docker run --privileged --name my-systemd-container -d ` --tmpfs /run --
You /run/lock
tmpfs can pull ` -vthe image from my docker
/sys/fs/cgroup:/sys/fs/cgroup:rw hub repo
(docker pull piopratama/pp-
` pp-ubuntu-
systemd /sbin/init
ubuntu-systemd) and skip step 1 and 2 then just run bellow command :
Docker Network
Network
overlay
and
need to
create
docker
swarm
Docker File
We can automate the process of pulling image, build container, and settings
through code that is saved in a file called “Dockerfile”.
services:
web:
image: nginx:latest
ports:
- "8080:80" # Map port 80 in the container to port 8080 on
the host
environment:
- NGINX_ENV=production
volumes:
- ./webdata:/usr/share/nginx/html # Mount host directory to
container
networks:
- frontend
depends_on:
- db
db:
image: postgres:13
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
volumes:
- dbdata:/var/lib/postgresql/data
networks:
- backend
networks:
frontend:
backend:
volumes:
dbdata:
I Wayan Pio Pratama, M.Kom.
Wazuh Installation using Docker Compose (Single
Docker compose is a tool for defining and running multi-container
Node)
applications.
Step 1. Pull docker compose file. (Make sure you have installed git).
Type this in the terminal/cmd/powershell :
git clone https://github.com/wazuh/wazuh-docker.git -b v4.9.0
Step 4.
Execute this for ssl/tls certificate : docker-compose -f generate-indexer-
certs.yml run --rm generator
Step 5. docker-compose up –d
After all the installation you probably want to commit the container into a
new image so that you can use it for another tasks. (tools like suod, vim,
iputils-ping, net-tools, and curl is really useful in ubuntu).
• ACL will give us flexibility to manage user permission across different user and group.
• Normally we will lock root account and limit the sudo command for specific user
• Use “su - username” and input password to login to a different user
• Use “ls -la” to show who own a file or directory
• Use “whoami” to show what user is currently in use
• Own a file/dir doesn’t directly mean you have the permission. Own a file means you have the right to manage the permission
• Bash (Bourne-Again SHell) the default shell in ubuntu. When you see sign : # (root), $ (non root)
Step 2.
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable
main" | tee –a /etc/apt/sources.list.d/wazuh.list
Step 3.
apt-get update
Step 4.
WAZUH_MANAGER=“IP/domain of wazuh manager" apt-get install wazuh-agent
Step 5.
/var/ossec/bin/wazuh-control start.
Step 2.
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable
main" | tee –a /etc/apt/sources.list.d/wazuh.list
Step 3.
apt-get update
Step 5.
/var/ossec/bin/wazuh-control start.
https://documentation.wazuh.com/curre
nt/user-manual/agent/index.html
To configure this :
1. Open the file using text editor (in this case we are using vim)
2. Backup ossec.conf in case you did something wrong using “cp ossec.conf
ossec.conf.bak”
3. Edit ossec.conf frequency to monitoring it every minute
(<frequency>60</frequency>)
4. Restart the agent using “var/ossec/bin/wazuh-control restart”
5. Check agen status using “var/ossec/bin/wazuh-control status”
6. Create a file in monitoring directory e.g “echo "This is new content" >>
newfile.txt”
7. Check log in “sudo tail -f /var/ossec/logs/ossec.log” in real time or “sudo
tail –n 100 /var/ossec/logs/ossec.log” to get last 100 logs only
8. Move to dashboard and look if something change in FIM menu for specific agent
Agent
Database
Event Queue
Wazuh
Agent
FIM syscheck
Agent logs
global config
Wazuh
Manager
Port
Mirroring
I Wayan Pio Pratama, M.Kom.
Wazuh Integrate with IDS
Wazuh lack capability to monitoring network or
doing
Intrussion Detection System (IDS).
So we need to integrate it with IDS such as
Suricata or
Zeek.
Source :
https://documentation.wazuh.com/current/proof-
of-concept-guide/integrate-network-ids-suricata.
html
Suricata can reside in dedicated machine or in the same machine where Wazuh
Manager or Agent installed
This will record the log in fast.log Alert : This specifies that Suricata should generate an alert when this rule is matched.
Icmp : Specifies the protocol to match, which is ICMP (used by ping and other
diagnostic tools)
Any any -> any any : This part of the rule means it will match ICMP packets from any IP
address and port going to any IP address and port, thus catching both incoming and
outgoing ICMP traffic.
rule-files:
- custom.rules
How ?
PAM vs PIM ?
CASE PRIVILAGE ACCESS MANAGEMENT
SERVE
Developer R Administrat
or
Suppor Vendor
t
Imagine the server installed with mysql database and many users (Developer, Administrator,
Support, Vendor) with credential can access it.
Or you have multiple applications then it will embrace security hole if you had to maintain all
of it differently.
So, it is better to have one gate to go in every apps.
MYSQL
Developer Administrat
or
Suppor Vendor
t
We can create static user for vendor in example with mysql feature. But how to track the
vendor using the credential ?, how to audit ?, what if the contract end but you as someone
who responsible forget to remove the access ?
1. Install mysql-client
2. mysql -h mysql-server -u vendor_user –p
Vendor 3. Try to SELECT, UPDATE, INSERT, etc and see the effect
MYSQL
Administrat
or
Vendor
PAM