622 final Flashcards
replication pros
improves scalability
distribute requests among replicated data servers
improves robustness
if one data server fails, others may be available
reduces latency of access
(wide-area systems) place data close to where it’s needed
(same box) place frequently accessed data in fast media
replication cons
hard to maintain replica consistency
expensive in case of frequent updates
decide on replica placement may not be trivial
harder in the case of dynamic placement
replicationcomes in many forms
-load balancing
data requests dynamically allocated to co-located replicasEx: database servers, web-search engines
-mirroring
requests directed to one of geographically dispersed replicasEx: web servers
caching: storing data at a convenient place
error
unintended state of a component/system
fault
a component/system characteristic or property that may cause errors
kinds of faults
transient
occurs and disappears; unlikely to reoccur
intermittent
recurrently appears and disappears
permanent
persists until fixed
failure
Failure: external manifestation of an error; undesired behavior
fail-stop
stops doing anything (“crashes”) on failure & we can reliably detect its failure (e.g., announces failure)
fail arbitrary/byzantine
behaves arbitrarily on failure
fail-silent
crashes on failure, but we can’t distinguish crashes from communication link failures
fail-safe
may crash or produce other results on failure, but failure cannot do any harm
fail noisy
crashes on failure, we can eventually determine that it crashed (detection may be delayed)
information redundancy
adding extra bits so that errors may be detected and possibly recovered
time redundancy
retry after detecting failure
physical redundancy
providing extra/replacement components
Triple modular redundancy
(LECTURE 7 SLIDE 20)
If A1 fails in fail-arbitrary way, OK
A2 & A3 outvote in each voter
If A2 & A3 fail in fail-silent way, OK
Only A1’s result received by voters, so it’s the only result used by voters
If A1 & V1 fail in fail-arbitrary way, OK
V2 & V3 will be correct (outvoted by A2 & A3), B1 will produce bad value but will be outvoted by B2 & B3
V10 fail in any way – SYSTEM FAILURE
A1 & A2 fail-arbitrary – SYSTEM FAILURE POSSIBLE (outvote A3)
Byzantine faults
Byzantine fault = “anything can happen”
CAP (Brewer’s) theorem
It’s impossible for a distributed data store to simultaneously provide > 2 of 3 guarantees:
Consistency: Every read receives the most recent write or an error [not same as ACID definition]
Availability: Every request receives a response that is not an error
Partition tolerance: The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes
In presence of (network) partition, must choose between consistency & availability
Consistency > availability:
ACID (Atomicity, Consistency, Isolation, Durability)
Traditional database systems
Availability > consistency:
Eventual consistency / optimistic replication: if no new updates are made to a given data item, eventually all accesses to it will return the last updated value (“converged”)
BASE (Basically Available, Soft state, Eventual consistency) semantics
Many “NoSQL” databases in this category
PACELC
PACELC extends CAP:
“if there is a partition (P), how does the system trade off availability and consistency (A and C) [per CAP];
else (E), when the system is running normally without partitions, how does the system trade off latency (L) and consistency (C)?”
PA/EL systems
if a partition occurs, prefer availability (giving up consistency), else prefer lower latency (also giving up consistency) – consistency always less important
PC/EC systems
PC/EC systems
PA/EC systems
if a partition occurs, prefer availability (giving up consistency), else prefer consistency (giving up lower latency)
Baseline MongoDB classified as PA/EC
Without partition, system guarantees reads and writes to be consistent (EC), but MongoDB’s data replication makes it PA:
If the master node fails or is partitioned from the rest of the system, “it stores all writes that have been sent to the master node but not yet replicated in a local rollback directory.”
“Meanwhile, the rest of the system elects a new master to remain available for reads and writes.”
“Therefore, the state of the old master and the state of the new master become inconsistent until the system repairs the failure and uses the rollback directory to reconcile the states, which is a manual process today.”
PC/EL systems
if a partition occurs, prefer consistency (giving up availability), else (normal case) prefer lower latency (giving up consistency)
security architecture:
set of mechanisms and policiesincorporated in a system for purposes of mitigating the risks from threats
threat:
potential event that could compromise a security requirement
attack:
realization of a threat
vulnerability:
a characteristic or flaw in system design or implementation, or in the security procedures, that, if exploited, could result in a security compromise
benefit of security:for all threats:
expected losses in case of attack,
times chances of attack
- acquisition
- engagement
cost of security
development & maintenance
complex software
infrastructure
product licensing
bigger &/or dedicatedmachines (e.g., firewalls)
degraded performance
encryption, authentication, authorization…
protection
secure channels
authentication
-communicating parties are who they say they are
-confidentiality and integrity:
third parties cannot interfere in the communication
access control
authorization (authorization != authentication)
-which entities can access which assets and operations
accountability
-always knowing who did what
non-repudiation
-entities cannot get away with denying actions
Trusted Computing Base (TCB)
“Set of all security mechanisms in a (distributed) computer system that are needed to enforce a security policy, and thus need to be trusted” [3rd edition pg 507]
Smaller the TCB, the better
Less that must be trusted & less to review)
trusted vs trustworthy
Trusted != trustworthy
Prefer a trustworthy one
symmetric encryption
aka shared secret key
M = DK (EK (M))
M is the data, D is decrypt, E is encrypt, and k is the key
computationally efficient
asymmetric encryption
aka public key/private key
M=DK- (EK+ (M))=DK+ (EK- (M))
K+ is public key, and k- is private key
computationally expensive
hashing & MACs
S = H(M), or S = MACK (M)
S, aka digest, is a unique representation of data such that change to the data will change the representation
fixed size and independent of size of M
collision resistant (both weak and strong)
computationally efficient
authentication and integrity verification
cannot be separated
Access control – general model
Subject -> (request for operation) -> Reference Monitor -> (authorized request) -> Object
Access control list (ACL)
Each object maintains a list of the access rights of all subjects & their rights
Distributes access control matrix column-wise
There may be a “default” set of rights
Capabilities
Each subject maintains a list of the objects it controls & the rights over them
Distributes access control matrix row-wise
using symmetric encryption for authentication brings up scalability issues
in a system with N nodes, each node needs tokeep track of N-1 pair-wise symmetric keysthe number of distinct keys in the system is ~N 2
with asymmetric encryption each nodehas one public key that everyone else usesthe number of distinct keys in the system is ~N
certification authoritiesdistribute certified public keys
a CA stores and makes available pairs<public key, peer identifier>
Least privilege
Each user and program should operate using fewest privileges possible
Limits the damage from an accident, error, or attack
Reduces number of potential interactions among privileged programs
Unintentional, unwanted, or improper uses of privilege less likely
Extend to the internals of a program: only smallest portion of program which needs those privileges should have them
Economy of mechanism/Simplicity
Protection system’s design should be simple and small as possible
“techniques such as line-by-line inspection of software and physical examination of hardware that implements protection mechanisms are necessary. For such techniques to be successful, a small and simple design is essential.‘”
Aka “KISS” principle (``keep it simple, stupid’’)
Open design
The protection mechanism must not depend on attacker ignorance
Instead, the mechanism should be public
Depend on secrecy of relatively few (and easily changeable) items like passwords or private keys
An open design makes extensive public scrutiny possible
Makes it possible for users to convince themselves system is adequate
Not realistic to maintain secrecy for distributed system
Complete mediation(“Non-bypassable”)
Every access attempt must be checked; position the mechanism so it cannot be subverted.
Fail-safe defaults (e.g., permission-based approach)
The default should be denial of service, and the protection scheme should then identify conditions under which access is permitted
Separation of privilege
Ideally, access to objects should depend on more than one condition, so that defeating one protection system won’t enable complete access
Least common mechanism (“limit shared things”)
Minimize the amount and use of shared mechanisms (e.g. use of the /tmp or /var/tmp directories)
Shared objects provide potentially dangerous channels for information flow and unintended interactions
Psychological acceptability / Easy to use
The human interface must be designed for ease of use so users will routinely and automatically use the protection mechanisms correctly
Mistakes will be reduced if the security mechanisms closely match the user’s mental image of his or her protection goals
Minimize “attack surface”
Key application of least privilege – no interface, no problem
Do users need direct access to database? Maybe not
whitelist
narrowly identifies what is allowed; all other things forbidden – do this
Blacklist
list of what is forbidden (all other things permitted) – do not use blacklists (in general)
SQL injection vulnerability
use prepared statements
Buffer overflows
select languages / libraries to eliminate/reduce risk
Cross-site scripting
encode responses
Password database?
Use salted hashes with key-stretching
Prevent, detect, contain, respond
Prevention best, but attackers resourceful
Also work to detect / contain /respond to reduce damage of successful attack
assurance case
Grounds for justified confidence that a claim has been/will be achieved
Claim(s): Top-level claim(s) for a property of a system or product
Arguments: Systematic argumentation justifying this claim
Evidence/assumptions: evidence & explicit assumptions underlying argument
Layered architectures
Organized into layers, call down to lower layers
Protocol stacks, application layering (stacks)