Notes of Unit - 5 (DBMS)
Notes of Unit - 5 (DBMS)
What is Authentication?
● Authentication is the process of identifying someone's identity by assuring that
the person is the same as what he is claiming for.
● It is used by both server and client. The server uses authentication when
someone wants to access the information, and the server needs to know who
is accessing the information. The client uses it when he wants to know that it
is the same server that it claims to be.
● The authentication by the server is done mostly by using the username and
password. Other ways of authentication by the server can also be done using
cards, retina scans, voice recognition, and fingerprints.
● Authentication does not ensure what tasks under a process one person can
do, what files he can view, read, or update. It mostly identifies who the person
or system is actually.
Authentication Factors
As per the security levels and the type of application, there are different types of
Authentication factors:
● Single-Factor Authentication
Single-factor authentication is the simplest way of authentication. It just needs
a username and password to allows a user to access a system.
● Two-factor Authentication
As per the name, it is two-level security; hence it needs two-step verification
to authenticate a user. It does not require only a username and password but
also needs the unique information that only the particular user knows, such as
first school name, a favorite destination. Apart from this, it can also verify
the user by sending the OTP or a unique link on the user's registered number
or email address.
● Multi-factor Authentication
This is the most secure and advanced level of authorization. It requires two or
more than two levels of security from different and independent categories.
This type of authentication is usually used in financial organizations, banks,
and law enforcement agencies. This ensures to eliminate any data exposer
from the third party or hackers.
Authentication techniques
1. Password-based authentication
It is the simplest way of authentication. It requires the password for the particular
username. If the password matches with the username and both details match the
system's database, the user will be successfully authenticated.
2. Passwordless authentication
In this technique, the user doesn't need any password; instead, he gets an OTP
(One-time password) or link on his registered mobile number or phone number. It
can also be said OTP-based authentication.
What is Authorization?
Authorization Techniques
Advantages of MAC
● Enforceability — MAC administrators set organization-wide policies that
users cannot override, making enforcement easier.
● Compartmentalization — Security labels limit the exposure of each resource
to a subset of the user base.
Disadvantages of MAC
● Collaboration — MAC achieves security by constraining communication.
Highly collaborative organizations may need a less restrictive approach.
● Management burden — A dedicated organizational structure must manage
the creation and maintenance of security labels.
Advantages of DAC
● Conceptual simplicity — ACLs pair a user with their access privileges. As
long as the user is in the table and has the appropriate privileges, they may
access the resource.
● Responsiveness to business needs — Since policy change requests do not
need to go through a security administration, decision-making is more nimble
and aligned with business needs.
Disadvantages of DAC
● Over/underprivileged users — A user can be a member of multiple, nested
workgroups. Conflicting permissions may over- or under privilege the user.
● Limited control — Security administrators cannot easily see how resources
are shared within the organization. And although viewing a resource’s ACL is
straightforward, seeing one user’s privileges requires searching every ACL.
● Compromised security — By giving users discretion over access policies,
the resulting inconsistencies and missing oversight could undermine the
organization’s security posture.
Advantages of RBAC
● Flexibility — Administrators can optimize an RBAC system by assigning
users to multiple roles, creating hierarchies to account for levels of
responsibility, constraining privileges to reflect business rules, and defining
relationships between roles.
● Ease of maintenance — With well-defined roles, the day-to-day
management is the routine on-boarding, off-boarding, and cross-boarding of
users’ roles.
● Centralized, non-discretionary policies — Security professionals can set
consistent RBAC policies across the organization.
● Lower risk exposure — Under RBAC, users only have access to the
resources their roles justify, greatly limiting potential threat vectors.
Disadvantages of RBAC
● Complex deployment — The web of responsibilities and relationships in
larger enterprises makes defining roles so challenging that it spawned its own
subfield: role engineering.
● Balancing security with simplicity — More roles and more granular roles
provide greater security, but administering a system where users have dozens
of overlapping roles becomes more difficult.
● Layered roles and permissions — Assigning too many roles to users also
increases the risk of over-privileging users.
With this basic understanding of ‘what is SQL Injection’, you will now look at the
different types of SQL Injection.
Types of SQL Injection
In-band SQLi - The attackers use the same communication channel to launch their
attacks and collect results.
The two common types of in-band SQL injections are Error-based SQL injection and
Union-based SQL injection.
1. Error-based SQL injection - Here, the attacker performs certain actions that
cause the database to generate error messages. Using the error message,
you can identify what database it utilizes, the version of the server where
the handlers are located, etc.
2. Union-based SQL injection - Here, the UNION SQL operator is used in
combining the results of two or more select statements generated by the
database, to get a single HTTP response. You can craft your queries within
the URL or combine multiple statements within the input fields and try to
generate a response.
Blind SQLi - Here, it does not transfer the data via the web application. The attacker
can not see the result of an attack in-band.
1. Boolean-based SQL Injection - Here, the attacker will send an SQL query
to the database asking the application to return a different result depending
on whether the query returns True or False.
2. Time-based SQL Injection - In this attack, the attacker sends an SQL query
to the database, which makes the database wait for a particular amount of
time before sharing the result. The response time helps the attacker to
decide whether a query is True or False.