Virtual Machines vs. Containers
49 Questions
13 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which security feature is integrated into Android to ensure the integrity of the operating system?

  • Seccomp
  • SELinux
  • eBPF
  • Verified Boot (correct)

Linux requires automated sandboxing for all applications.

False (B)

What is the primary difference between Linux and Android in terms of sandboxing?

Linux requires manual configuration while Android has automated sandboxing built into the ecosystem.

Android uses __________ to enforce mandatory app confinement.

<p>SELinux</p> Signup and view all the answers

Match the following Linux security features with their descriptions:

<p>SELinux = Mandatory Access Control Seccomp = Filters system calls eBPF = Fine-grained monitoring Containers = Robust app isolation</p> Signup and view all the answers

What is the primary advantage of using virtual machines?

<p>They allow multiple applications to run on a single server. (A)</p> Signup and view all the answers

Containers contain their own operating systems, just like virtual machines.

<p>False (B)</p> Signup and view all the answers

What is a hypervisor?

<p>A hypervisor is software that allows one machine to run multiple virtual machines by managing hardware resources.</p> Signup and view all the answers

Containers require a ______ to run, which is an environment specific to its content.

<p>similar operating system</p> Signup and view all the answers

Match the following technologies with their characteristics:

<p>Virtual Machines = Heavyweight and slower to boot Containers = Lightweight and faster to boot Hypervisor = Manages multiple VMs Docker = Popular containerization platform</p> Signup and view all the answers

Which of the following is NOT a disadvantage of virtual machines?

<p>Must be packaged for specific operating systems (D)</p> Signup and view all the answers

Both virtual machines and containers can run on any operating system without restrictions.

<p>False (B)</p> Signup and view all the answers

List one advantage of using containers over virtual machines.

<p>Containers are faster to start up than virtual machines.</p> Signup and view all the answers

A ______ is responsible for unpacking container files and passing them to the operating system kernel.

<p>container engine</p> Signup and view all the answers

Match the file permission commands with their functions:

<p>chmod = Changes file permissions chown = Changes file ownership ls = Lists files in a directory mkdir = Creates a new directory</p> Signup and view all the answers

What does the 'D' in the file permission string (e.g., drwxr-xr-x) indicate?

<p>It is a directory. (B)</p> Signup and view all the answers

When a server's underlying operating system crashes, only the virtual machines on that server go down.

<p>False (B)</p> Signup and view all the answers

What does 'rwx' signify in the permissions of a directory?

<p>Read, write, and execute permissions for the owner.</p> Signup and view all the answers

The sum of read (4), write (2), and execute (1) permissions gives a value of ______.

<p>7</p> Signup and view all the answers

What problem does virtual memory primarily solve?

<p>Insufficient RAM (A)</p> Signup and view all the answers

Each program shares the same memory space in a virtual memory system.

<p>False (B)</p> Signup and view all the answers

What is the term for the additional memory that can be accessed when RAM is insufficient?

<p>Swap memory</p> Signup and view all the answers

When a program tries to access data that is not currently in RAM, this situation is known as a __________.

<p>page fault</p> Signup and view all the answers

Match the following key concepts with their definitions:

<p>Virtual Memory = Memory assigned to programs that doesn't overlap Page Table = Mapping of virtual addresses to physical addresses Page Fault = Exception raised when data is not in RAM Swap Memory = Disk space used as additional memory</p> Signup and view all the answers

What does a page table entry map?

<p>Virtual addresses to physical addresses (D)</p> Signup and view all the answers

The offset in virtual and physical addresses is always identical.

<p>True (A)</p> Signup and view all the answers

What is the purpose of a Translation Lookaside Buffer (TLB)?

<p>To cache translations from virtual to physical addresses</p> Signup and view all the answers

Programs can corrupt each other's data if they access the same __________ in a shared memory space.

<p>address</p> Signup and view all the answers

What happens during a page fault?

<p>The CPU raises an exception (A)</p> Signup and view all the answers

Having more RAM generally improves the performance of a computer during memory swapping.

<p>True (A)</p> Signup and view all the answers

What is memory fragmentation?

<p>A condition where free memory is split into small, non-contiguous blocks</p> Signup and view all the answers

A __________ is used to classify and manage memory for each program efficiently.

<p>page table</p> Signup and view all the answers

Match the following terms with their corresponding definitions:

<p>Physical Memory = The actual RAM in the computer Virtual Address = An address used by a program to access memory Dirty Page = A page that has been modified after it was loaded Least Recently Used = A page replacement strategy for memory management</p> Signup and view all the answers

What command is used to add execute privileges for the owner and group in Linux?

<p>chmod 774 (B)</p> Signup and view all the answers

The default permissions for a key pair on AWS EC2 instances is set to 644.

<p>False (B)</p> Signup and view all the answers

Which mechanism is used in Android for inter-process communication?

<p>Binder</p> Signup and view all the answers

In a typical directory, the baseline permission can be set to _____ for the owner, group, and others.

<p>755</p> Signup and view all the answers

Match the Linux commands with their respective functions:

<p>chmod = Change file permissions chroot = Change root directory seccomp = Restrict system calls iptables = Manage network traffic rules</p> Signup and view all the answers

Which of the following best describes a key difference between Linux and Android sandboxing?

<p>Android apps run in isolated environments with unique UIDs. (D)</p> Signup and view all the answers

Linux uses a mandatory permission model for applications.

<p>False (B)</p> Signup and view all the answers

What is the primary purpose of cgroups in Linux sandboxing?

<p>Limit and monitor resource usage</p> Signup and view all the answers

In Linux, the permission mode _____ lets the owner read and write, while the group can read only.

<p>640</p> Signup and view all the answers

Match the following sandboxing features to their purposes:

<p>SELinux = Mandatory access controls Namespaces = Isolate resources AppArmor = Security profiles IPCs = Inter-app communication</p> Signup and view all the answers

What does the 'chmod 664' command do?

<p>Adds read and write for owner and group, but read only for others (D)</p> Signup and view all the answers

Android's permission model allows users to revoke permissions at runtime.

<p>True (A)</p> Signup and view all the answers

What is the base permission level for files in Linux commonly used for regular files?

<p>644</p> Signup and view all the answers

Applications in Android have their own unique _____ assigned at install time for sandboxing.

<p>UID and GID</p> Signup and view all the answers

Which security feature in Android helps prevent privilege escalation attacks?

<p>SELinux (B)</p> Signup and view all the answers

Network isolation in Linux can be achieved through network namespaces.

<p>True (A)</p> Signup and view all the answers

Flashcards

SELinux/AppArmor

SELinux and AppArmor are security tools that enforce strict access control policies, limiting what programs and users can do within the system.

Seccomp

Seccomp is a mechanism that allows you to restrict the system calls a program can make, preventing it from doing harmful operations.

eBPF

eBPF allows you to monitor and filter network traffic in real-time, enabling you to identify and block suspicious activity.

Verified Boot

Verified Boot ensures that the Android operating system has not been tampered with, verifying its integrity before booting.

Signup and view all the flashcards

Google Play Protect

Google Play Protect actively scans apps on your device for malware and other threats, protecting your privacy and security.

Signup and view all the flashcards

What is a virtual machine?

A virtual machine (VM) is a software-based emulation of a physical computer system. It allows multiple operating systems and applications to run on a single physical server, each operating independently within its own virtualized environment.

Signup and view all the flashcards

What is a hypervisor?

A hypervisor is a software layer that manages and controls the allocation of hardware resources to virtual machines. It acts as an intermediary between the physical server hardware and the guest operating systems running within the VMs.

Signup and view all the flashcards

What is a container?

A container is a lightweight and portable software package that bundles an application with all its dependencies, such as libraries, configurations, and other required software components. This allows the application to run consistently across different computing environments.

Signup and view all the flashcards

What is Docker?

Docker is a popular open-source platform for creating, managing, and deploying containers. It provides tools for building container images, running containers, and orchestrating container deployments.

Signup and view all the flashcards

What is a container engine?

A container engine is a software component that manages the lifecycle of containers. It unpacks container images, allocates resources, and runs containers on the underlying operating system.

Signup and view all the flashcards

What are file permissions in Linux?

File permissions in Linux control who can access and modify files and directories. They are represented by a three-part code: owner, group, and others, each with permissions for read, write, and execute.

Signup and view all the flashcards

What is the chown command in Linux?

The chown command is used to change the owner of a file or directory in Linux. It takes the new owner's username as the first argument and the file or directory name as the second argument.

Signup and view all the flashcards

What is the chmod command in Linux?

The chmod command is used to change the permissions of a file or directory in Linux. It uses octal numbers representing the permissions for owner, group, and others.

Signup and view all the flashcards

What are owner permissions in Linux?

The owner permissions define what actions the owner of a file or directory can perform, such as reading, writing, or executing.

Signup and view all the flashcards

What are group permissions in Linux?

Group permissions determine what actions members of a specific group can perform on a file or directory. Groups are assigned to files and directories and allow for shared access and collaboration.

Signup and view all the flashcards

What are others permissions in Linux?

Others permissions define what actions any other user on the system can perform on a file or directory. These permissions are typically restricted, granting only read access by default.

Signup and view all the flashcards

What is read permission in Linux?

Read permission allows users to view the contents of a file or list the contents of a directory.

Signup and view all the flashcards

What is write permission in Linux?

Write permission allows users to modify the contents of a file or to create new files or subdirectories within a directory.

Signup and view all the flashcards

What is execute permission in Linux?

Execute permission allows users to run executable files or to access subdirectories within a directory.

Signup and view all the flashcards

What is the key difference in operating system sharing between containers and VMs?

Containers share the underlying operating system of the host machine, while VMs have their own dedicated operating system. This makes containers much lighter and faster, but also means they are less isolated.

Signup and view all the flashcards

Linux Sandboxing

A mechanism that isolates and protects applications and processes from each other in Linux, using features like namespaces, cgroups, SELinux, AppArmor, and file permissions.

Signup and view all the flashcards

Android Sandboxing

A mechanism used in Android to isolate and protect applications, built upon Linux features and tailored for mobile app security.

Signup and view all the flashcards

Namespaces in Linux Sandboxing

In Linux, namespaces create isolated views of resources like process trees, file systems, and network interfaces. For example, a namespace could isolate a process's view of the file system, preventing it from accessing files outside its designated area.

Signup and view all the flashcards

cgroups in Linux Sandboxing

In Linux, cgroups (Control Groups) limit and monitor resource usage (CPU, memory, I/O) for specific processes. It enables the operating system to allocate and track resource consumption for isolated apps.

Signup and view all the flashcards

App Isolation in Android

In Android, each app runs in its own sandbox, isolated using a unique Linux UID (User ID) and GID (Group ID) assigned during installation.

Signup and view all the flashcards

File Access Restrictions in Android

In Android, each app can access its own files, and can only access other files if explicitly shared.

Signup and view all the flashcards

IPC Mechanisms in Android

In Android, apps communicate via controlled inter-process communication (IPC) mechanisms like the Binder framework. For example, Binder can be utilized to pass specific information between apps while enforcing permission restrictions.

Signup and view all the flashcards

Permissions in Linux Sandboxing

In Linux, permissions are based on users and groups. Files and resources are protected using traditional read, write, and execute permissions (rwx).

Signup and view all the flashcards

Permission Systems in Android

In Android, permissions are declared in the app’s AndroidManifest.xml file and are divided into categories, such as normal, dangerous, signature, etc. Users must grant explicit permission for dangerous permissions.

Signup and view all the flashcards

Network Isolation in Linux

In Linux, Network isolation is achieved using techniques like network namespaces that create isolated network stacks, and iptables/nftables to manage network traffic rules.

Signup and view all the flashcards

Network Isolation in Android

In Android, apps cannot directly access network interfaces. Instead, they use system-provided APIs, allowing Android to enforce network restrictions based on user permissions and policies.

Signup and view all the flashcards

Inter-Process Communication (IPC) in Linux

In Linux, traditional IPC mechanisms like pipes, shared memory, and sockets are not sandbox-aware but can be restricted by sandboxing tools to prevent unauthorized communication.

Signup and view all the flashcards

Inter-Process Communication (IPC) in Android

Android uses a custom IPC mechanism called Binder, which enforces permissions for cross-app communication, controls access to data, and prevents apps from directly interfering with each other's processes.

Signup and view all the flashcards

Security Goals of Linux Sandboxing

Linux sandboxing focuses on flexibility and containment, enabling administrators to configure sandboxing policies manually or via tools.

Signup and view all the flashcards

Security Goals of Android Sandboxing

Android sandboxing prioritizes user privacy and malware prevention, protecting users from malicious apps by isolating app data and enforcing strict permissions.

Signup and view all the flashcards

Virtual Memory

The amount of memory that a program thinks it has access to. Each program has its own virtual memory space, which doesn't overlap with other programs.

Signup and view all the flashcards

Physical Memory

The actual amount of RAM available to a computer. This is the physical memory that the CPU directly accesses.

Signup and view all the flashcards

Address Translation

The process of mapping a program's virtual addresses to physical addresses. This allows programs to run even if their total memory needs exceed the available physical RAM.

Signup and view all the flashcards

Page Table

A table that stores the mapping between virtual and physical addresses. It allows the OS to manage the virtual memory system.

Signup and view all the flashcards

Page

A fixed-size block of memory in both virtual and physical memory. Pages are typically 4 kilobytes in size.

Signup and view all the flashcards

Offset

The last 12 bits of a virtual or physical address, used to identify the location within a page.

Signup and view all the flashcards

Page Number

The portion of a virtual or physical address that identifies the page number.

Signup and view all the flashcards

Page Fault

An exception generated by the CPU when a program tries to access a page that is not currently loaded into physical memory.

Signup and view all the flashcards

Translation Lookaside Buffer (TLB)

A special hardware component in the CPU that caches the mappings between virtual and physical addresses to speed up address translation.

Signup and view all the flashcards

Memory Management Unit (MMU)

The hardware component responsible for address translation and generating page faults. It connects virtual addresses to physical memory.

Signup and view all the flashcards

Multi-level TLBs

A technique used to improve the performance of TLBs by adding multiple levels of caches. This reduces the need to access physical RAM.

Signup and view all the flashcards

Multi-level Page Tables

A mechanism that allows the OS to swap out second-level page table entries to disk to save memory. This is especially helpful for programs that don't use much RAM.

Signup and view all the flashcards

Swapping

The process of moving data from disk to RAM when a program needs to access it, and writing data from RAM back to disk when it's no longer needed.

Signup and view all the flashcards

Swap Space

A special area on the disk used to store data that is not currently in RAM. It acts as a temporary holding space for swapped pages.

Signup and view all the flashcards

Study Notes

Virtual Machines vs. Containers

  • Traditional server application setup involved one application per server, often underutilizing server power.
  • Virtual machines (VMs) simulate multiple servers on a single physical machine using a hypervisor allocating hardware resources.
  • Hypervisors include VMware ESXi, Citrix Zen Server, and Microsoft Hyper-V.
  • VMs have drawbacks: large disk space usage due to dedicated OSes, high RAM and CPU consumption, slow startup times, and OS licensing costs.
  • Containers package application code with all needed files, configurations, and dependencies.
  • This allows easy distribution and runs without extra software/configurations.
  • Docker is primarily used to manage containers.
  • Containers share the server's underlying OS, making them lightweight, fast, and portable.
  • Container images must be compatible with the server's OS.
  • Container failure will affect all containers sharing the OS, whereas VM failure affects only the single VM.

Linux File Permissions

  • All Linux files/directories have owner, group, and others permission levels.
  • Each level has read (r), write (w), and execute (x) permissions.
  • The "l" flag in the ls command shows detailed permissions:
    • "d" indicates a directory.
    • "rwx" permissions for owner, group, and others.
    • Dashes represent missing permissions.
  • chown command changes file/directory owners and groups (e.g., sudo chown <new_owner>:<new_group> <filename>).
  • chmod command changes file/directory permissions using a numerical system (e.g., chmod <number> <filename>).
    • Example: chmod 774 <filename> (owner: rwx, group: rwx, others: r-x)

Linux Sandboxing and Android Sandboxing

  • Both mechanisms isolate and protect applications.
  • Linux sandboxing uses namespaces, cgroups, SELinux, AppArmor to isolate processes.
  • Android leverages Linux features, adding layers of abstraction for mobile app security and efficiency.
  • Android's app isolation uses unique UIDs/GIDs, file access restrictions, and IPC mechanisms.
  • Android's declarative permission model requires user consent and runtime permission management.
  • Key Security Differences: Linux sandboxing customization is manual, while Android is automated and integrated into the platform.
  • Android focuses on user privacy and malware prevention utilizing SELinux, Google Play Protect, etc.

Virtual Memory

  • Virtual memory solves problems with insufficient RAM, memory fragmentation, and data security.
  • Older computers often had limited RAM and the presence of multiple applications frequently causing issues.
  • Memory fragmentation occurs when free memory is not contiguous.
  • Security issues exist if programs have access to the same memory space.
  • Virtual memory gives each program a unique address space, preventing overlaps and crashes.
  • It maps virtual addresses (program's view) to physical addresses (RAM).
  • Paging divides memory into fixed-size pages, making memory use efficient.
  • The OS uses a page table for virtual-to-physical address translation.
  • A translation lookaside buffer (TLB) is a cache to speed up translations.
  • Page faults occur when a page is not in memory (RAM), and the OS moves a page from RAM to disk or vice-versa.
  • Memory management units (MMUs) handle address translations and page faults.
  • Multi-level page tables address the challenge of running many programs simultaneously, by keeping the first-level table in RAM, and potentially swapping the second level tables to disk to preserve space.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Explore the differences between virtual machines and containers in server application setups. This quiz covers topics such as hypervisors, resource allocation, and the benefits of using Docker for container management. Understand the technical aspects that make containers lightweight and portable compared to traditional VMs.

More Like This

Virtual Machines
3 questions

Virtual Machines

ArticulateCarnelian8522 avatar
ArticulateCarnelian8522
03 - VMs vs. Containers
18 questions

03 - VMs vs. Containers

EntrancedDobro6607 avatar
EntrancedDobro6607
Use Quizgecko on...
Browser
Browser