Core Security Principles and Concepts

· 12 min read
Core Security Principles and Concepts

# Chapter 3: Core Security Principles and Concepts

Before diving further directly into threats and defenses, it's essential in order to establish the essential principles that underlie application security. These core concepts are usually the compass by which security professionals navigate decisions and trade-offs. They help respond to why certain handles are necessary and what goals many of us are trying to achieve. Several foundational models and principles slowly move the design in addition to evaluation of secure systems, the almost all famous being the particular CIA triad in addition to associated security principles.

## The CIA Triad – Confidentiality, Integrity, Availability

In the middle of information safety (including application security) are three principal goals:

1. **Confidentiality** – Preventing not authorized usage of information. Throughout simple terms, preserving secrets secret. Simply those who are usually authorized (have typically the right credentials or perhaps permissions) should become able to watch or use sensitive data. According to be able to NIST, confidentiality means "preserving authorized restrictions on access and even disclosure, including method for protecting personalized privacy and private information"​
PTGMEDIA. PEARSONCMG. COM
. Breaches regarding confidentiality include new trends like data leaks, password disclosure, or even an attacker reading someone else's email messages. A real-world example is an SQL injection attack that dumps all end user records from a new database: data of which should happen to be secret is encountered with the particular attacker. The alternative of confidentiality is disclosure​
PTGMEDIA. PEARSONCMG. POSSUINDO
– when  automated code fixes  is showed individuals not authorized to be able to see it.

2. **Integrity** – Protecting data and techniques from unauthorized customization. Integrity means that will information remains accurate and trustworthy, and that system features are not interfered with. For example, when a banking app displays your account balance, integrity steps ensure that the attacker hasn't illicitly altered that equilibrium either in passage or in the particular database. Integrity can certainly be compromised by attacks like tampering (e. g., changing values in a WEB ADDRESS to access someone else's data) or even by faulty code that corrupts information. A classic mechanism to make sure integrity will be the use of cryptographic hashes or signatures – if a data file or message will be altered, its signature will no longer verify. The contrary of integrity is definitely often termed modification – data being modified or damaged without authorization​
PTGMEDIA. PEARSONCMG. COM
.

several. ** app scan ** – Guaranteeing systems and data are accessible when needed. Even if info is kept secret and unmodified, it's of little use in case the application is down or unapproachable. Availability means that will authorized users can reliably access the particular application and it is functions in the timely manner. Threats to availability incorporate DoS (Denial regarding Service) attacks, in which attackers flood the server with targeted traffic or exploit a new vulnerability to accident the machine, making that unavailable to legit users. Hardware problems, network outages, or perhaps even design problems that can't handle top loads are likewise availability risks. Typically the opposite of availableness is often described as destruction or refusal – data or perhaps services are damaged or withheld​
PTGMEDIA. PEARSONCMG. COM
. Typically the Morris Worm's effect in 1988 had been a stark reminder of the importance of availability: it didn't steal or alter data, but by causing systems crash or slow (denying service), it caused significant damage​
CCOE. DSCI. IN
.

These three – confidentiality, sincerity, and availability – are sometimes referred to as the "CIA triad" and are considered as the three pillars regarding security. Depending upon the context, the application might prioritize one over the others (for illustration, a public media website primarily cares for you that it's offered and its content sincerity is maintained, discretion is less of a good issue considering that the content material is public; alternatively, a messaging app might put privacy at the leading of its list). But a protect application ideally ought to enforce all to be able to an appropriate level. Many security regulates can be recognized as addressing 1 or more of such pillars: encryption aids confidentiality (by striving data so simply authorized can study it), checksums and even audit logs assistance integrity, and redundancy or failover methods support availability.

## The DAD Triad (Opposites of CIA)

Sometimes it's valuable to remember typically the flip side associated with the CIA triad, often called FATHER:

- **Disclosure** – Unauthorized access to information (breach associated with confidentiality).
- **Alteration** – Unauthorized change details (breach associated with integrity).
- **Destruction/Denial** – Unauthorized devastation of information or denial of service (breach of availability).

Safety efforts aim to prevent DAD results and uphold CIA. A single attack can involve several of these elements. For example, a ransomware attack might both disclose data (if the attacker steals a copy) and even deny availability (by encrypting the victim's copy, locking all of them out).  historical reporting  might alter data inside a databases and thereby break the rules of integrity, etc.

## Authentication, Authorization, and even Accountability (AAA)

Throughout securing applications, especially multi-user systems, we rely on added fundamental concepts often referred to as AAA:

1. **Authentication** – Verifying the identity of the user or method. Once you log in with an username and password (or more safely with multi-factor authentication), the system will be authenticating you – making certain you usually are who you state to be. Authentication answers the question: That are you? Typical methods include accounts, biometric scans, cryptographic keys, or tokens. A core basic principle is that authentication need to be strong enough in order to thwart impersonation. Weakened authentication (like easily guessable passwords or perhaps no authentication high should be) can be a frequent cause associated with breaches.

2. **Authorization** – Once id is made, authorization handles what actions or data the authenticated entity is allowed to access. That answers: Precisely what are a person allowed to carry out? For example, right after you sign in, a great online banking application will authorize you to see your very own account details but not someone else's. Authorization typically consists of defining roles or perhaps permissions. A weakness, Broken Access Manage, occurs when these types of checks fail – say, an assailant finds that by changing a record IDENTIFICATION in an WEB ADDRESS they can view another user's files because the application isn't properly verifying their own authorization. In simple fact, Broken Access Handle was identified as typically the number one net application risk found in the 2021 OWASP Top 10, seen in 94% of apps tested​
IMPERVA. COM


, illustrating how predominanent and important proper authorization is.

several. **Accountability** (and Auditing) – This refers to the ability to trace actions in the particular system for the responsible entity, which often means having proper working and audit trails. If something goes wrong or suspicious activity is discovered, we need in order to know who would what. Accountability is definitely achieved through working of user actions, and by having tamper-evident records. Functions hand-in-hand with authentication (you can only hold someone responsible once you learn which consideration was performing the action) and with integrity (logs themselves must be shielded from alteration). Throughout application security, establishing good logging in addition to monitoring is crucial for both uncovering incidents and undertaking forensic analysis after an incident. While we'll discuss found in a later section, insufficient logging plus monitoring enables breaches to go undetected – OWASP lists this as one other top 10 issue, writing that without suitable logs, organizations may well fail to discover an attack until it's far too late​
IMPERVA. CONTENDO

IMPERVA. COM
.

Sometimes you'll see an expanded phrase like IAAA (Identification, Authentication, Authorization, Accountability) which just pauses out identification (the claim of identification, e. g. going into username, before real authentication via password) as an individual step. But the core ideas stay exactly the same. A secure application typically enforces strong authentication, stringent authorization checks regarding every request, plus maintains logs with regard to accountability.

## Theory of Least Benefit

One of the most important style principles in security is to provide each user or even component the lowest privileges necessary in order to perform its function, with out more. This is called the principle of least privilege. In practice, it implies if an application has multiple tasks (say admin as opposed to regular user), the regular user accounts should have not any capacity to perform admin-only actions. If a new web application demands to access some sort of database, the databases account it uses should have permissions only for the particular desks and operations essential – by way of example, in case the app in no way needs to delete data, the DB account shouldn't in fact have the REMOVE privilege. By decreasing privileges, whether or not a great attacker compromises a good user account or even a component, destruction is contained.

A bare example of not following least freedom was the Capital One breach regarding 2019: a misconfigured cloud permission authorized a compromised component (a web app firewall) to access all data through an S3 storage area bucket, whereas when that component acquired been limited in order to only certain data, the particular breach impact would have been far smaller​
KREBSONSECURITY. APRESENTANDO

KREBSONSECURITY. CONTENDO
. Least privilege furthermore applies at the signal level: when a module or microservice doesn't need certain entry, it shouldn't have it. Modern pot orchestration and impair IAM systems make it easier to implement granular privileges, nevertheless it requires careful design.

## Defense in Depth

This particular principle suggests that will security should always be implemented in overlapping layers, in order that when one layer neglects, others still offer protection. Basically, don't rely on any kind of single security handle; assume it can be bypassed, in addition to have additional mitigations in place. For an application, security in depth might mean: you confirm inputs on typically the client side regarding usability, but an individual also validate them on the server based (in case an attacker bypasses your customer check). You protected the database right behind an internal firewall, but you also compose code that checks user permissions ahead of queries (assuming an attacker might break the network). If using encryption, an individual might encrypt sensitive data in the database, but also put in force access controls on the application layer and even monitor for strange query patterns. Protection in depth is usually like the levels of an onion – an opponent who gets through one layer ought to immediately face one more. This approach counter tops the point that no solitary defense is foolproof.

For example, imagine an application relies on a web application firewall (WAF) to block SQL injection attempts. Security in depth would dispute the application form should continue to use safe coding practices (like parameterized queries) to sterilize inputs, in situation the WAF misses a novel harm. A real scenario highlighting this was basically the situation of specific web shells or perhaps injection attacks that were not recognized by security filtration – the inside application controls after that served as the final backstop.

## Secure by Design and Secure by Default

These connected principles emphasize making security a basic consideration from the start of style, and choosing safe defaults. "Secure by design" means you intend the system structure with security inside mind – with regard to instance, segregating sensitive components, using verified frameworks, and thinking of how each style decision could introduce risk. "Secure by simply default" means once the system is implemented, it should default in order to the most dependable adjustments, requiring deliberate motion to make this less secure (rather than the other method around).

An illustration is default account policy: a firmly designed application may ship without having arrears admin password (forcing the installer in order to set a strong one) – as opposed to possessing a well-known default security password that users may well forget to change. Historically, many software packages were not protected by default; they'd install with open up permissions or sample databases or debug modes active, and when an admin opted to not lock them lower, it left slots for attackers. Over time, vendors learned to invert this: right now, databases and systems often come along with secure configurations out there of the field (e. g., remote control access disabled, test users removed), and even it's up in order to the admin to loosen if completely needed.

For designers, secure defaults mean choosing safe library functions by predetermined (e. g., default to parameterized queries, default to result encoding for net templates, etc. ). It also implies fail safe – if an aspect fails, it have to fail within a secure closed state quite than an unconfident open state. As an example, if an authentication service times out and about, a secure-by-default deal with would deny entry (fail closed) rather than allow it.

## Privacy by simply Design

This concept, carefully related to protection by design, offers gained prominence particularly with laws like GDPR. It means that will applications should always be designed not just in be secure, but to admiration users' privacy coming from the ground up. Used, this might involve data minimization (collecting only exactly what is necessary), openness (users know exactly what data is collected), and giving consumers control over their data. While privacy will be a distinct domain, it overlaps greatly with security: you can't have privateness if you can't secure the personalized data you're accountable for. Many of the worst data breaches (like those at credit bureaus, health insurance companies, etc. ) are devastating not just as a result of security disappointment but because that they violate the privateness of countless people. Thus, modern software security often works hand in hands with privacy things to consider.

## Threat Modeling

An important practice in secure design is definitely threat modeling – thinking like an attacker to predict what could make a mistake. During threat building, architects and builders systematically go all the way through the type of a great application to determine potential threats and even vulnerabilities. They request questions like: Just what are we developing? What can get wrong? What will all of us do about it? A single well-known methodology intended for threat modeling is STRIDE, developed in Microsoft, which stalls for six types of threats: Spoofing identification, Tampering with files, Repudiation (deniability of actions), Information disclosure, Denial of support, and Elevation involving privilege.

By jogging through each component of a system in addition to considering STRIDE hazards, teams can discover dangers that may possibly not be apparent at first look. For example, consider a simple online payroll application. Threat modeling might reveal of which: an attacker may spoof an employee's identity by questioning the session symbol (so we need to have strong randomness), can tamper with salary values via some sort of vulnerable parameter (so we need insight validation and server-side checks), could execute actions and later deny them (so we want good examine logs to prevent repudiation), could exploit an information disclosure bug in an error message to be able to glean sensitive information (so we need user-friendly but vague errors), might attempt denial of service by submitting a new huge file or perhaps heavy query (so we need rate limiting and resource quotas), or consider to elevate opportunity by accessing administrator functionality (so many of us need robust gain access to control checks). By way of this process, safety measures requirements and countermeasures become much more clear.

Threat modeling is usually ideally done earlier in development (during the look phase) as a result that security is built in from the beginning, aligning with typically the "secure by design" philosophy. It's an evolving practice – modern threat building might also consider misuse cases (how may the system become misused beyond typically the intended threat model) and involve adversarial thinking exercises. We'll see its importance again when talking about specific vulnerabilities and how developers may foresee and stop them.

## Associated risk Management

Not every safety measures issue is every bit as critical, and resources are always small. So another principle that permeates program security is risk management. This involves assessing the possibilities of a danger plus the impact have been it to take place. Risk is normally informally considered as a function of these a couple of: a vulnerability that's easy to exploit in addition to would cause extreme damage is higher risk; one that's theoretical or might have minimal effects might be reduced risk. Organizations usually perform risk checks to prioritize their security efforts. Regarding example, an on the web retailer might identify how the risk regarding credit card thievery (through SQL injection or XSS leading to session hijacking) is extremely high, and therefore invest heavily inside preventing those, whilst the risk of someone causing minor defacement upon a less-used site might be acknowledged or handled using lower priority.

Frameworks like NIST's or perhaps ISO 27001's risk management guidelines help within systematically evaluating and even treating risks – whether by mitigating them, accepting all of them, transferring them (insurance), or avoiding them by changing organization practices.

One real response to risk managing in application protection is the generation of a threat matrix or risk register where prospective threats are detailed with their severity. This specific helps drive choices like which bugs to fix first or where in order to allocate more screening effort. It's likewise reflected in repair management: if a new vulnerability is announced, teams will assess the chance to their software – is it exposed to that will vulnerability, how serious is it – to choose how urgently to make use of the patch or workaround.

## Security vs. User friendliness vs. Cost

Some sort of discussion of concepts wouldn't be total without acknowledging the particular real-world balancing work. Security measures can easily introduce friction or perhaps cost. Strong authentication might mean even more steps for a customer (like 2FA codes); encryption might halt down performance slightly; extensive logging may well raise storage costs. A principle to follow is to seek stability and proportionality – security should be commensurate with typically the value of what's being protected. Extremely burdensome security of which frustrates users could be counterproductive (users will dsicover unsafe workarounds, with regard to instance). The artwork of application security is finding options that mitigate risks while preserving a good user knowledge and reasonable cost. Fortunately, with modern day techniques, many protection measures can be made quite unlined – for example, single sign-on remedies can improve equally security (fewer passwords) and usability, in addition to efficient cryptographic your local library make encryption rarely noticeable with regards to overall performance.

In summary, these kinds of fundamental principles – CIA, AAA, very least privilege, defense thorough, secure by design/default, privacy considerations, menace modeling, and risk management – form the particular mental framework with regard to any security-conscious specialist. They will seem repeatedly throughout information as we look at specific technologies in addition to scenarios. Whenever a person are unsure about a security selection, coming back to be able to these basics (e. g., "Am I actually protecting confidentiality? Are really we validating ethics? Are we minimizing privileges? Can we include multiple layers associated with defense? ") may guide you into a more secure result.

Using these principles in mind, we could now explore the exact hazards and vulnerabilities that plague applications, and even how to guard against them.