Latest / CyberSecurity Summary / MacOS and iOS Internals, Volume III: Security & Insecurity
Transcript
- 0:00Speaker 1: Welcome to our deep dive. Today. We're going to be
- 0:02Speaker 1: looking at something that's both fascinating and a little bit unnerving,
- 0:05Speaker 1: the security of Apple's operating systems.
- 0:08Speaker 2: And to guide us through this intricate landscape, we've got
- 0:11Speaker 2: Jonathan Levin's book OS Internal's Volume three, Security and Insecurity.
- 0:16Speaker 2: This book is like a masterclass in how Apple builds
- 0:20Speaker 2: those defenses, and equally important, how those defenses have been tested, challenged,
- 0:26Speaker 2: and sometimes even broken.
- 0:27Speaker 1: It's like getting a backstage pass to the world of
- 0:30Speaker 1: digital security, a peak behind the curtain to see how
- 0:33Speaker 1: the wizards at Apple try to keep our Max and
- 0:35Speaker 1: iPhones safe exactly.
- 0:37Speaker 2: And what Levin does so brilliantly is he takes us
- 0:39Speaker 2: through both sides of the story, the security and the insecurity.
- 0:42Speaker 2: It's not just about how things are supposed to work,
- 0:44Speaker 2: it's about how they can be made to work differently,
- 0:47Speaker 2: sometimes with unintended consequences.
- 0:49Speaker 1: Okay, so let's start unpacking all of this. Where do
- 0:51Speaker 1: you think we should begin. What's the foundation of all
- 0:54Speaker 1: of the security stuff.
- 0:55Speaker 2: Well, like any good fortress, it all starts with authentication.
- 0:58Speaker 2: How your device knows it's really you trying to get.
- 1:01Speaker 1: In right, So beyond the usual username and password. What's
- 1:05Speaker 1: going on behind the scenes.
- 1:07Speaker 2: You'd think it's just a simple check but Apple actually
- 1:10Speaker 2: uses a multi layered approach that goes beyond those traditional methods.
- 1:15Speaker 2: Think of it like a series of checkpoints, each with
- 1:17Speaker 2: its own set of guards and protocols.
- 1:19Speaker 1: Okay, I'm intrigued. Walk me through these checkpoints.
- 1:22Speaker 2: So you have the familiar login screen, But behind that,
- 1:26Speaker 2: there's a process called open direct read, which uses a
- 1:30Speaker 2: Skellite database to manage user configurations.
- 1:32Speaker 1: And data hold on scale. That's a pretty standard database format,
- 1:36Speaker 1: isn't it the kind that anyone with a little know
- 1:38Speaker 1: how can access.
- 1:39Speaker 2: That's the interesting part. This database isn't locked away in
- 1:42Speaker 2: some impenetrable vault. With the right tools and knowledge, you
- 1:46Speaker 2: can actually pick inside and see what's going on. You
- 1:48Speaker 2: can even manipulate certain user properties.
- 1:51Speaker 1: Wait, are you saying that just by accessing this database,
- 1:53Speaker 1: someone could potentially tinker with user accounts.
- 1:56Speaker 2: Potentially. Yes, It's important to note that there are likely
- 2:00Speaker 2: other security measures in place to prevent unauthorized modifications, but
- 2:04Speaker 2: the fact that this database is relatively accessible highlights a
- 2:08Speaker 2: key concept in security. It's all about layers.
- 2:12Speaker 1: Like an Onion feel back one layer and there's another
- 2:14Speaker 1: one underneath exactly.
- 2:15Speaker 2: No single mechanism is fool proof. Security relies on a
- 2:19Speaker 2: combination of interlocking defenses, each providing a different level of protection.
- 2:23Speaker 1: Okay, so we've got this squarelight database managing user info.
- 2:27Speaker 1: What else is involved in this multi layered authentication system.
- 2:31Speaker 2: Well, in addition to those traditional mechanisms, Apple also introduce
- 2:34Speaker 2: something called the Local Authentication Framework.
- 2:37Speaker 1: What's the purpose of that? Is it like a more
- 2:39Speaker 1: advanced form of authentication.
- 2:41Speaker 2: You could say that it's designed to provide a standardized
- 2:44Speaker 2: and secure way for developers to build authentication features into
- 2:47Speaker 2: their apps. I think touch, id, face, ID, those kinds
- 2:50Speaker 2: of things.
- 2:51Speaker 1: Ah, So it's about streamlining the process for both developers
- 2:55Speaker 1: and users while also making it more secure.
- 2:57Speaker 2: Right, and it aims to create a more concert experience
- 3:00Speaker 2: across all Apple devices. So whether you're using your iPhone,
- 3:04Speaker 2: your iPad, or your Mac, the authentication process feels familiar
- 3:08Speaker 2: and reliable.
- 3:09Speaker 1: That makes sense. So we've got this multi layered system
- 3:12Speaker 1: in place to verify our identity. What happens once we're
- 3:15Speaker 1: in How does the system keep track of what we're doing,
- 3:18Speaker 1: especially from a security standpoint?
- 3:20Speaker 2: That's where auditing comes in. Think of it as a
- 3:22Speaker 2: digital trail of breadcrumbs that records security related events on
- 3:25Speaker 2: your Mac.
- 3:26Speaker 1: So every time something important happens, like accessing a protected
- 3:29Speaker 1: file or changing a system setting, it gets logged.
- 3:32Speaker 2: Exactly. It's like having a security camera that's always watching,
- 3:36Speaker 2: but instead of video footage, it records a log of
- 3:38Speaker 2: actions and events. This information can be invaluable for forensic
- 3:42Speaker 2: analysis if there's ever a security breach.
- 3:45Speaker 1: That makes sense, like being able to retrace your steps
- 3:47Speaker 1: if something goes wrong. But how does the system decide
- 3:50Speaker 1: what to audit in the first place. It can't possibly
- 3:52Speaker 1: log everything we do, right.
- 3:54Speaker 2: That's where another key player enters the scene. KATHUUF, Apple's
- 3:58Speaker 2: kernel level authorization system KAUF.
- 4:01Speaker 1: Never heard of it. What's its role in all of this?
- 4:04Speaker 2: KUF is one of those behind the scenes mechanisms that
- 4:07Speaker 2: most users never interact with directly, but it plays a
- 4:11Speaker 2: crucial role in deciding which actions are allowed and which
- 4:13Speaker 2: ones aren't. Think of it like a security checkpoint within
- 4:17Speaker 2: the core of the operating system.
- 4:18Speaker 1: So it's like a bouncer at a club deciding who
- 4:20Speaker 1: gets in and who stays out.
- 4:21Speaker 2: That's a good analogy. But instead of looking at IDs,
- 4:25Speaker 2: CAUTH uses something called scopes to define areas of interest
- 4:28Speaker 2: for authorization scopes.
- 4:30Speaker 1: Okay, now you're losing me. What exactly is a scope
- 4:32Speaker 1: in this context?
- 4:34Speaker 2: Imagine you have different security zones within a building. Some
- 4:37Speaker 2: areas are open to everyone, while others require special clearance
- 4:40Speaker 2: to enter. Scopes in CAUTH work in a similar way.
- 4:44Speaker 2: They define different categories of actions or resources that require authorization.
- 4:48Speaker 1: So different scopes for different levels of sensitivity. Can you
- 4:51Speaker 1: give me a concrete example?
- 4:52Speaker 2: Absolutely? One example is the coth scope of generic scope,
- 4:56Speaker 2: which covers a wide range of actions. Then you have
- 4:58Speaker 2: more specific scopes like cost co process, which focuses specifically
- 5:02Speaker 2: on actions related to processes like launching a new app
- 5:06Speaker 2: or terminating an existing one.
- 5:08Speaker 1: Interesting. So each scope is like a specific security domain
- 5:12Speaker 1: with its own set of rules and permissions.
- 5:15Speaker 2: Precisely, and here's where it gets really clever. Whenever an
- 5:18Speaker 2: action falls under a particular scope, coth triggers a corresponding
- 5:22Speaker 2: callback function.
- 5:23Speaker 1: A callback function, what does that do?
- 5:25Speaker 2: Think of it like an alarm that goes off when
- 5:27Speaker 2: something specific happens. In this case, the alarm triggers a
- 5:30Speaker 2: piece of code that checks whether the action is allowed
- 5:33Speaker 2: based on predefined rules and policies.
- 5:35Speaker 1: So it's like having a security guard stationed at each
- 5:38Speaker 1: checkpoint who checks your credentials before letting.
- 5:40Speaker 2: You through, exactly, And it's all happening at the kernel level,
- 5:43Speaker 2: which is the heart of the operating system. This means
- 5:46Speaker 2: that COTH has a very low level and fundamental role
- 5:49Speaker 2: in enforcing security.
- 5:50Speaker 1: So code is like the gatekeeper, checking credentials and making decisions.
- 5:55Speaker 1: But where do those credentials come from in the first place?
- 5:57Speaker 1: Are we still talking about user names and passwords?
- 6:00Speaker 2: Actually, this is where things get even more interesting. COTH
- 6:04Speaker 2: uses its own system of credentials that are distinct from
- 6:08Speaker 2: traditional POSXX credentials, which are the ones associated with usernames
- 6:12Speaker 2: and passwords.
- 6:13Speaker 1: Wait, different credentials. Why would they do that? Isn't that
- 6:16Speaker 1: making things unnecessarily complicated?
- 6:18Speaker 2: It might seem that way at first, but there's a
- 6:21Speaker 2: good reason for this separation. It ties into Apple's Mandatory
- 6:25Speaker 2: Access Control MAAC framework, which is another crucial layer of
- 6:30Speaker 2: security that will dive into in a moment.
- 6:31Speaker 1: Okay, I'm starting to see how all of these pieces
- 6:33Speaker 1: are connected. It's like a chain reaction. One security mechanism leading.
- 6:37Speaker 2: To the next exactly, and MAAC relies on these KUTH
- 6:40Speaker 2: credentials to enforce its security policies. So understanding how cualth
- 6:45Speaker 2: works is essential for grapping the bigger picture of how
- 6:48Speaker 2: Apple secures its operating systems.
- 6:50Speaker 1: All right, you've peaked my curiosity. Let's talk about this
- 6:53Speaker 1: MAAC framework. What is it and how does it fit
- 6:55Speaker 1: into this whole security puzzle.
- 6:57Speaker 2: Think of MSS as the judge and jury in the
- 6:59Speaker 2: court of your operating system. It's responsible for evaluating whether
- 7:04Speaker 2: an action should be permitted based on a system of
- 7:07Speaker 2: labels and policies, and it's deeply integrated with the kernel,
- 7:12Speaker 2: which means it's very difficult to bypass or tamper.
- 7:14Speaker 1: With labels and policies. This sounds very official. Can you
- 7:18Speaker 1: break it down for me?
- 7:18Speaker 2: Sure, every object in the system, whether it's a file,
- 7:23Speaker 2: a process, or even a network socket, can be tagged
- 7:26Speaker 2: with an a mass label. Think of it like a security
- 7:29Speaker 2: clearance level for digital objects.
- 7:31Speaker 1: So some files might be marked as top secret while
- 7:33Speaker 1: others are public exactly.
- 7:35Speaker 2: And then you have policies, which are essentially rules that
- 7:38Speaker 2: determine how objects with different labels can interact.
- 7:41Speaker 1: So a top secret file can't be accessed by someone
- 7:43Speaker 1: with a public clearance level.
- 7:45Speaker 2: You got it. It's all about controlling access based on
- 7:48Speaker 2: these labels and policies, ensuring that sensitive information and resources
- 7:52Speaker 2: are protected from unauthorized access.
- 7:54Speaker 1: This is fascinating. It's like a whole security ecosystem operating
- 7:57Speaker 1: beneath the surface of our max. Now, the book also
- 8:00Speaker 1: mentioned something called texts in relation to M SICK. What
- 8:03Speaker 1: are those?
- 8:03Speaker 2: Texts? Are kernel extensions. They're basically little pieces of code
- 8:07Speaker 2: that extend the kernel's functionality, and some texts are dependent
- 8:10Speaker 2: on MAC for their operation.
- 8:13Speaker 1: Meaning they rely on MAS for security checks and enforcement.
- 8:17Speaker 2: That's right. The book even shows you how to use
- 8:19Speaker 2: a simple command line tool to identify these MAC dependent texts.
- 8:24Speaker 2: It's a good example of how Levin provides not just
- 8:26Speaker 2: theoretical knowledge, but also practical insights into how these mechanisms work.
- 8:31Speaker 1: That's really cool. So we've covered authentication, auditing, COTH, and MA.
- 8:35Speaker 1: It seems like we're building up a pretty solid understanding
- 8:38Speaker 1: of Apple's security layers. What's next on our journey.
- 8:42Speaker 2: Let's talk about code signing, Apple's way of guaranteeing the
- 8:44Speaker 2: integrity and origin of executable code. Think of it like
- 8:48Speaker 2: a digital signature that verifies the authenticity of an app
- 8:51Speaker 2: or software.
- 8:52Speaker 1: So it's how Apple ensures the apps were downloading and
- 8:54Speaker 1: running are legitimate and haven't been tampered with, like a
- 8:57Speaker 1: seal of approval.
- 8:58Speaker 2: Exactly, every piece of software that runs on mac os
- 9:01Speaker 2: and iOS has a code signature attached to it. This
- 9:05Speaker 2: signature is cryptographically generated, which means it's very difficult to forge.
- 9:09Speaker 1: Okay, but what does this signature actually look like? How
- 9:12Speaker 1: does it work on a technical level?
- 9:14Speaker 2: Well, get ready to dive a bit deeper, because it
- 9:17Speaker 2: involves something called the superblob.
- 9:19Speaker 1: Superblob sounds a bit intimidating.
- 9:22Speaker 2: Don't worry, it's not as scary as it sounds. It's
- 9:24Speaker 2: basically a container that holds various pieces of information, including
- 9:29Speaker 2: the actual signature itself, which is based on something called
- 9:32Speaker 2: CMS Cryptographic Message syntax. And then there are these special
- 9:38Speaker 2: slots within the superblob for storing additional metadata metadata.
- 9:42Speaker 1: What kind of information are we talking about here?
- 9:44Speaker 2: This is where things get really interesting. These special slots
- 9:47Speaker 2: can contain things like entitlements, which we'll discuss later, but
- 9:50Speaker 2: for now, just know that they add an extra layer
- 9:52Speaker 2: of control over what an app can do.
- 9:54Speaker 1: Okay, entitlements sound intreating, But first, tell me more about
- 9:58Speaker 1: this superblob. Can we actually see it? Can we examine
- 10:01Speaker 1: its contents?
- 10:02Speaker 2: Absolutely? The book walks you through how to extract and
- 10:05Speaker 2: inspect code signatures using the command line tools. You can
- 10:08Speaker 2: actually see the structure of the superblob in its different components.
- 10:11Speaker 1: So we can peek under the hood and see how
- 10:14Speaker 1: this digital signature is constructed. Very cool. What else is
- 10:19Speaker 1: important about these code signatures?
- 10:21Speaker 2: They also include flags that influence how the code can
- 10:24Speaker 2: be executed. These flags control things like whether the code
- 10:27Speaker 2: can be debugged or injected into other processes, So another
- 10:31Speaker 2: way Apple tries to limit what malicious actors can do.
- 10:34Speaker 1: So it's not just about verifying the integrity of the
- 10:37Speaker 1: code itself, it's also about controlling how that code behaves
- 10:41Speaker 1: once it's running on the system. Another layer of security.
- 10:44Speaker 2: You've got it. It's all about making it as difficult
- 10:46Speaker 2: as possible for attackers to exploit vulnerabilities and compromise the system.
- 10:51Speaker 1: Well, it seems like Apple has put a lot of
- 10:53Speaker 1: thought and effort into securing its operating systems. We've only
- 10:56Speaker 1: just scratched the surface, and I'm already impressed by the
- 10:58Speaker 1: complexity and depth of these security mechanisms, and.
- 11:01Speaker 2: We've only just begun. There's much more to explore in
- 11:04Speaker 2: the world of Apple security, so stay tuned for more
- 11:07Speaker 2: insights as we continue our deep dive.
- 11:09Speaker 1: Welcome back. It's amazing to think about all the security
- 11:12Speaker 1: measures working behind the scenes every time we use our
- 11:15Speaker 1: Apple devices. It's like having a whole team of digital
- 11:18Speaker 1: bodyguards protecting us from unseen threats.
- 11:21Speaker 2: And like any good security team, they've got multiple layers
- 11:24Speaker 2: of defense. It's not just about keeping the bad guys out,
- 11:27Speaker 2: it's also about limiting the damage they can do if
- 11:30Speaker 2: they manage to slip through the cracks.
- 11:32Speaker 1: Okay, that makes sense. So what kind of damage control
- 11:34Speaker 1: measures are we talking about here? What else does Apple
- 11:37Speaker 1: have up its sleeve?
- 11:38Speaker 2: Well, let's talk about software restrictions, specifically, how even Apple's
- 11:43Speaker 2: own apps have limits on what they can do.
- 11:46Speaker 1: Wait a minute, even Apple's apps. I thought they had
- 11:48Speaker 1: free rein of the system.
- 11:49Speaker 2: Not quite. Even Apple recognizes that some operations are just
- 11:53Speaker 2: too sensitive to allow unrestricted access.
- 11:56Speaker 1: Like, what kind of things are we talking about?
- 11:58Speaker 2: Think about accessing your keychain, where all your passwords and
- 12:01Speaker 2: sensitive data are stored, or modifying critical system files. Those
- 12:06Speaker 2: are actions that shouldn't be taken lightly.
- 12:08Speaker 1: Right, That makes sense. You don't want just any app
- 12:10Speaker 1: messing around with that kind of stuff. So how does
- 12:12Speaker 1: macOS keep things in check?
- 12:14Speaker 2: It uses something called the authorizations mechanism, which relies on
- 12:19Speaker 2: you guessed it, another Scoli database.
- 12:21Speaker 1: Cerusly, another Scualae database. They seem to be everywhere.
- 12:24Speaker 2: They're just really good at what they do. This particular
- 12:27Speaker 2: database stores rules that is, termine which operations require special
- 12:31Speaker 2: authorization and under what conditions that authorization can be granted.
- 12:35Speaker 1: So it's like a set of bylaws for apps, defining
- 12:38Speaker 1: what they can and can't do exactly.
- 12:40Speaker 2: And what's really interesting is that you can actually examine
- 12:43Speaker 2: this authorization database yourself using the command line.
- 12:46Speaker 1: Wait, you mean we can see the actual rules that
- 12:49Speaker 1: govern what apps can do?
- 12:51Speaker 2: You can. The book even gives examples of how to
- 12:53Speaker 2: extract specific rules from the database using this quad three tool.
- 12:57Speaker 2: It's a fascinating way to see how these restrictions are implemented.
- 13:01Speaker 1: I can see how that would be useful for developers
- 13:03Speaker 1: and security researchers. But is there any risk in making
- 13:06Speaker 1: this information accessible. Could someone with bad intentions manipulate these rules?
- 13:11Speaker 2: It's definitely a possibility, although Apple has implemented various safeguards
- 13:15Speaker 2: to make it more difficult. But it highlights the constant
- 13:18Speaker 2: cat and mouse game between security and those who seek
- 13:22Speaker 2: to circumvent it.
- 13:23Speaker 1: Right, because if you can change the rules of the game,
- 13:26Speaker 1: you can potentially change the outcome exactly.
- 13:29Speaker 2: And that brings us to another important player in Apple's
- 13:32Speaker 2: security lineup, Gatekeepers.
- 13:34Speaker 1: Gatekeepers is that like a bouncer for apps, checking IDs
- 13:38Speaker 1: at the door.
- 13:39Speaker 2: You could say that it's Apple's first line of defense
- 13:41Speaker 2: against untrusted software. When you download an application from the Internet,
- 13:46Speaker 2: Gatekeeper steps in to verify its credentials.
- 13:49Speaker 1: Credentials, so is it looking for a code signature like
- 13:52Speaker 1: we talked about earlier, that's.
- 13:53Speaker 2: A big part of it. If an app isn't signed
- 13:55Speaker 2: by a trusted developer, Gatekeepers will raise a red flag
- 14:00Speaker 2: and prevent you from running it without explicit confirmation.
- 14:03Speaker 1: I've definitely seen those warnings pop up before, especially when
- 14:06Speaker 1: I try to run something I've downloaded from a less
- 14:08Speaker 1: and reputable source.
- 14:09Speaker 2: That's exactly when Gatekeeper is doing its job, protecting you
- 14:13Speaker 2: from potentially a harmful software. But you might be wondering
- 14:17Speaker 2: how Gatekeeper knows that a file was downloaded from the
- 14:20Speaker 2: Internet in the first place.
- 14:21Speaker 1: Yeah, how does it tell the difference between something I
- 14:24Speaker 1: downloaded and something that's always been on my computer?
- 14:26Speaker 2: It uses a clever trick called quarantine attributes. When you
- 14:30Speaker 2: download a file, the system automatically tags it with these attributes,
- 14:34Speaker 2: marking it as potentially untrusted.
- 14:37Speaker 1: So it's like a little sticky note that says handle.
- 14:39Speaker 2: With care exactly. And what's really interesting is that you
- 14:42Speaker 2: can actually manipulate these quarantine attributes yourself using the zatri
- 14:46Speaker 2: command line tool.
- 14:47Speaker 1: Hold on, are you saying I could potentially remove these
- 14:50Speaker 1: attributes and trick Gatekeepers into thinking a downloaded file is safe.
- 14:54Speaker 2: It's possible, but Apple has implemented additional measures to make
- 14:57Speaker 2: it more difficult. For example, Keeper's also checks for a
- 15:01Speaker 2: special extended attribute called comm dot apple dot quarantine, which
- 15:06Speaker 2: stores more detailed information about the file's origin.
- 15:09Speaker 1: So even if you remove the basic quarantine attributes, there's
- 15:12Speaker 1: still this extra layer of information that could trip you
- 15:15Speaker 1: up exactly.
- 15:16Speaker 2: Apple clearly thought about this and built in some redundancy
- 15:20Speaker 2: to make it harder for attackers to circumvent gatekeepers.
- 15:24Speaker 1: Speaking of redundancy, the book mentions something called lib quarantine
- 15:28Speaker 1: and a rather oddly named system demon called SIPOILCID. What
- 15:33Speaker 1: do those have to do with gatekeeper good catch?
- 15:35Speaker 2: Lib quarantine is basically the toolbox for managing these quarantine attributes.
- 15:40Speaker 2: It provides the functions that apps can use to interact
- 15:43Speaker 2: with these flags.
- 15:44Speaker 1: So it's the behind the scenes worker bee that makes
- 15:46Speaker 1: the whole quarantine system tick. And what about sipoil sid.
- 15:49Speaker 2: That's the enforcer. Sipoil said, is a system demon that
- 15:52Speaker 2: runs in the background and constantly monitors for new files
- 15:56Speaker 2: and downloads.
- 15:56Speaker 1: So it's like a digital security guard patrolling the system,
- 16:00Speaker 1: making sure nothing suspicious gets through exactly.
- 16:02Speaker 2: It works in conjunction with other components like the kernel
- 16:06Speaker 2: and the authorization database to enforce gatekeepers policies.
- 16:10Speaker 1: Wow, it's amazing how much is going on behava scenes
- 16:12Speaker 1: to keep our macs safe from harm. But I'm sensing
- 16:15Speaker 1: a theme here. Apple seems to really like this layered
- 16:18Speaker 1: approach to security.
- 16:20Speaker 2: You're absolutely right, it's all about defense and depth. Yeah,
- 16:22Speaker 2: no single mechanism is perfect, so they combine multiple layers
- 16:27Speaker 2: to make it as difficult as possible for attackers to
- 16:30Speaker 2: exploit any weaknesses.
- 16:31Speaker 1: And that brings us to what might be the most
- 16:33Speaker 1: important layer of all sandboxing.
- 16:36Speaker 2: Ah. Yes, sandboxing. It's one of Apple's most powerful security
- 16:40Speaker 2: mechanisms and a cornerstone of both mac os and iOS.
- 16:45Speaker 1: I've heard the term before, but I'm not exactly sure
- 16:47Speaker 1: what it means. Can you break it down for me?
- 16:49Speaker 2: Think of sandboxing like a playpen for apps. Instead of
- 16:53Speaker 2: letting an app have free rein of the system, it
- 16:55Speaker 2: confines it to a specific area with limited permissions.
- 16:58Speaker 1: So even if an app is militia or compromised, sandboxing
- 17:02Speaker 1: prevents it from doing too much damage.
- 17:04Speaker 2: That's the idea. It's like containing a potentially dangerous experiment
- 17:07Speaker 2: to a controlled environment.
- 17:08Speaker 1: Okay, I'm starting to see how this fits into the
- 17:10Speaker 1: layered security model, But how does sandboxing actually work? What's
- 17:14Speaker 1: the magic behind it?
- 17:15Speaker 2: The magic, or rather the technology behind it, is AMAC
- 17:19Speaker 2: the mandatory Access control framework we discussed earlier. Each sandboxed
- 17:24Speaker 2: app is given a set of Mac labels and policies
- 17:27Speaker 2: that define what it's allowed to do.
- 17:29Speaker 1: AH. So it's back to those labels and policies, but
- 17:32Speaker 1: this time they're being used to restrict what an app
- 17:34Speaker 1: can do, rather than just controlling access to files.
- 17:37Speaker 2: Exactly, and the sandboxes evolved significantly over the years. In
- 17:41Speaker 2: the early days, it used a blacklist approach.
- 17:43Speaker 1: Blacklist meaning they had a list of specific things that
- 17:47Speaker 1: apps weren't allowed to do and everything else was permitted.
- 17:50Speaker 2: You got it. But this approach proved to be too
- 17:52Speaker 2: limiting and difficult to maintain. As the threat landscape changed,
- 17:57Speaker 2: Apple realized they needed a more flexible and robut.
- 18:00Speaker 1: So they switched to a whitelist approach.
- 18:03Speaker 2: Precisely, instead of focusing on what apps can't do, they
- 18:06Speaker 2: shifted to defining what apps can do. This means everything
- 18:10Speaker 2: is forbidden by default unless explicitly allowed by the sandbox rules.
- 18:14Speaker 1: That sounds much more secure, but I imagine it also
- 18:16Speaker 1: makes things more complicated for developers.
- 18:18Speaker 2: It does, but it's a trade off worth making for
- 18:21Speaker 2: the increased security and to make things easier for developers,
- 18:25Speaker 2: Apple introduced sandbox profiles.
- 18:27Speaker 1: Sandbox profiles what are those?
- 18:29Speaker 2: They're essentially configuration files that define the allowed actions for
- 18:33Speaker 2: a specific app.
- 18:34Speaker 1: So instead of having to manually specify every single permission,
- 18:38Speaker 1: developers can just use a predefined profile that matches their
- 18:41Speaker 1: apps needs.
- 18:42Speaker 2: Exactly, and you can actually inspect these profiles. The book
- 18:45Speaker 2: gives examples of how to use a command line tool
- 18:47Speaker 2: called ASTI to do just that.
- 18:49Speaker 1: Ask TI another cryptogachronym, I take it.
- 18:52Speaker 2: It stands for Apple Sandbox command Line Interface. It's a
- 18:56Speaker 2: powerful tool for developers and security researchers.
- 18:59Speaker 1: Alike can peek into these profiles and see exactly what
- 19:02Speaker 1: an app is allowed to do.
- 19:03Speaker 2: You can and you can even modify those permissions for
- 19:06Speaker 2: testing purposes, although as always, we strongly advise against making
- 19:10Speaker 2: any unauthorized changes to your system.
- 19:12Speaker 1: Right We don't want to accidentally unleash any digital monsters.
- 19:15Speaker 1: But it's fascinating to see how much control and transparency
- 19:18Speaker 1: Apple provides with its sandboxing system.
- 19:21Speaker 2: It really is a testament to their commitment to security,
- 19:24Speaker 2: and it's one of the key reasons why macOS and
- 19:27Speaker 2: iOS are considered to be among the most secure operating
- 19:30Speaker 2: systems out there.
- 19:30Speaker 1: Okay, so we've covered code signing, authorizations, gatekeepers, and now
- 19:35Speaker 1: sandboxing all working together to protect our devices. Are we
- 19:38Speaker 1: finally done with our tour of Apple's security measures.
- 19:42Speaker 2: Quite There's one more big one we need to talk about.
- 19:45Speaker 2: System Integrity Protection, or SIP for short SIP.
- 19:49Speaker 1: Okay, I'm all ears, what's that all about?
- 19:51Speaker 2: This is a relatively new addition to Apple's security arsenal,
- 19:54Speaker 2: introduced in MACOSL CAPITAM. It adds an extra layer of
- 19:58Speaker 2: protection for critical system file and processes.
- 20:01Speaker 1: So even if an attacker manages to gain root access,
- 20:04Speaker 1: SIP prevents them from wreaking havoc on the most sensitive
- 20:07Speaker 1: parts of the system.
- 20:08Speaker 2: You got it. SIP restricts root privileges in several ways.
- 20:12Speaker 2: It prevents modification of certain system directories, limits the loading
- 20:15Speaker 2: of unsigned kernel extensions, and restricts debugging of certain processes.
- 20:20Speaker 1: Wow. So it's like putting those critical system components under
- 20:23Speaker 1: lock and key, even from the most powerful using.
- 20:25Speaker 2: Exactly and it's made a huge difference in terms of
- 20:27Speaker 2: knack out security. But as with any security mechanism, attackers
- 20:33Speaker 2: have been trying to find ways to bypass it.
- 20:35Speaker 1: That's what I was going to ask. Is SIP truly
- 20:38Speaker 1: unbreakable or have there been cases where attackers have managed
- 20:41Speaker 1: to circumvent it?
- 20:42Speaker 2: Well, no security system is truly unbreakable, but SIP has
- 20:46Speaker 2: significantly raised the bar for attackers. They've tried different approaches
- 20:51Speaker 2: like exploiting vulnerabilities in other parts of the system to
- 20:54Speaker 2: gain control before SIP can kick in.
- 20:57Speaker 1: So it's like trying to sneak past the guards before
- 20:59Speaker 1: they can lock down the fortress exactly.
- 21:01Speaker 2: And they've also tried targeting sip's own configuration and enforcement mechanisms,
- 21:07Speaker 2: looking for subtle flaws or loopholes.
- 21:09Speaker 1: So even though SIP is a powerful defense, it's still
- 21:12Speaker 1: a target for attackers. It's a reminder that security is
- 21:15Speaker 1: an ongoing arms race, a constant battle between those who
- 21:19Speaker 1: build walls and those who try to tear them down.
- 21:21Speaker 2: Well said, and that's one of the key insights from
- 21:24Speaker 2: os Internal's Volume three. It doesn't just tell you how
- 21:27Speaker 2: things work, it also shows you how those things can
- 21:29Speaker 2: be broken, and more importantly, what can be done to
- 21:31Speaker 2: make them stronger.
- 21:32Speaker 1: It's like a crash course in both offense and defense
- 21:35Speaker 1: in the world of cybersecurity exactly.
- 21:38Speaker 2: And understanding both sides is essential for staying ahead in
- 21:41Speaker 2: this constantly evolving landscape.
- 21:43Speaker 1: Welcome back, Deep Divers. We've spent the last two parts
- 21:46Speaker 1: of this episode building up a pretty solid understanding of
- 21:49Speaker 1: how Apple tries to keep our Max and iPhones safe.
- 21:52Speaker 1: Now it's time to flip the script and explore the
- 21:56Speaker 1: other side of the coin, the insecurity part of the equation.
- 21:59Speaker 2: Because as as robust as Apple security measures are, they've
- 22:03Speaker 2: always faced challenges from those who seek to break them,
- 22:06Speaker 2: bend them, or just plane bypass them.
- 22:08Speaker 1: It's like that old saying, every lock has its key,
- 22:11Speaker 1: or in this case, every digital fortress has its potential weakness, right.
- 22:15Speaker 2: And that's where OS Internal's Volume three really shines. It
- 22:19Speaker 2: doesn't shy away from the vulnerabilities and exploits that have
- 22:23Speaker 2: targeted Apples operating systems.
- 22:24Speaker 1: So we're talking about specific instances where those layers of
- 22:27Speaker 1: security we discuss were breached or circumvented exactly.
- 22:31Speaker 2: And it starts with some classic MAGOS vulnerabilities that existed
- 22:35Speaker 2: in versions ten point two and ten point one to one,
- 22:38Speaker 2: things like issues with specific system calls, exploits that took
- 22:42Speaker 2: advantage of race conditions, and even clever tricks involving path manipulation.
- 22:47Speaker 1: Okay, I'm getting a little loss in the technical jargon here.
- 22:51Speaker 1: Can you break it down for me? What kind of
- 22:52Speaker 1: impact could these vulnerabilities have?
- 22:55Speaker 2: Imagine an attacker being able to execute arbitrary code on
- 22:58Speaker 2: your system? Essentially gaining control of your machine. That's the
- 23:02Speaker 2: kind of power these vulnerabilities could potentially grant.
- 23:05Speaker 1: That sounds pretty serious. So these weren't just minor glitches.
- 23:08Speaker 1: They were potentially major security holes, right.
- 23:11Speaker 2: And what's fascinating is the variety of these vulnerabilities. They
- 23:14Speaker 2: highlight the fact that security weaknesses can crop up in
- 23:17Speaker 2: unexpected places, even in seemingly simple functions or operations.
- 23:21Speaker 1: It's like a reminder that attackers are always looking for
- 23:24Speaker 1: those chinks in the armor, no matter how small they
- 23:26Speaker 1: might seem.
- 23:27Speaker 2: Exactly, and that's why understanding these vulnerabilities is so important.
- 23:31Speaker 2: It helps us see how attackers think and how they exploit.
- 23:34Speaker 2: Even the smallest oversights are inconsistencies encode.
- 23:37Speaker 1: So it's not just about knowing what the vulnerabilities are,
- 23:39Speaker 1: it's about understanding how they came to be in the
- 23:42Speaker 1: first place. Right.
- 23:42Speaker 2: It's about seeing the bigger picture and recognizing the patterns
- 23:46Speaker 2: that often lead to security weaknesses.
- 23:48Speaker 1: Okay, if that makes sense now. The book also delves
- 23:51Speaker 1: into the world of jail breaking, which is something that's
- 23:53Speaker 1: been a constant cat and mouse game between Apple and
- 23:56Speaker 1: a certain segment of its users.
- 23:58Speaker 2: Absolutely, jail breaking is all about removing the restrictions that
- 24:02Speaker 2: Apple places on iOS devices, essentially giving users more control
- 24:06Speaker 2: over their devices.
- 24:07Speaker 1: So it's like saying, Hey, Apple, I appreciate the security,
- 24:10Speaker 1: but I want to be able to do whatever I
- 24:12Speaker 1: want with my own phone.
- 24:13Speaker 2: You could say that, and os Internal's Volume three provides
- 24:17Speaker 2: a fascinating history of iOS jail breaks, starting with the
- 24:21Speaker 2: very first one for the original iPhone all the way
- 24:24Speaker 2: up to more recent exploits.
- 24:25Speaker 1: It's like a timeline of how hackers and security researchers
- 24:28Speaker 1: have been pushing the boundaries of what's possible with iOS devices.
- 24:32Speaker 2: Right, and each jail break is a testament to the
- 24:35Speaker 2: creativity and persistence of those who seek to understand and
- 24:39Speaker 2: sometimes circumvent Apple's security measures.
- 24:42Speaker 1: Can you give me an example of a particularly clever
- 24:44Speaker 1: or memorable jailbreak exploit?
- 24:46Speaker 2: Well, there was Evasin, a jail break for iOS six
- 24:51Speaker 2: that took advantage of vulnerability in the way iOS handled.
- 24:56Speaker 1: PDF files BF files. Really that seems like a strange
- 25:00Speaker 1: place to find a security hole.
- 25:01Speaker 2: It does, but that's the ingenuity of these exploits. Ye
- 25:05Speaker 2: Evasian used a carefully crafted PDF document that, when opened,
- 25:10Speaker 2: would trigger a chain of events that ultimately led to
- 25:12Speaker 2: a jail break.
- 25:13Speaker 1: So it's like a trojan horse disguised as something harmless exactly.
- 25:17Speaker 2: And then there was Pangu, a jail break for iOS
- 25:19Speaker 2: seven that targeted a vulnerability and a core system component
- 25:23Speaker 2: called Apple key store.
- 25:25Speaker 1: And what did that allow attackers to do?
- 25:26Speaker 2: Pangu was a very powerful exploit that gave jail breakers
- 25:29Speaker 2: almost complete control over the device. It was a major
- 25:31Speaker 2: breakthrough in the jailbreak community.
- 25:33Speaker 1: Wow, these exploits sound incredibly complex. It must take a
- 25:36Speaker 1: deep understanding of iOS internals to pull something like that off.
- 25:39Speaker 2: It does, and the book goes into detail about the
- 25:41Speaker 2: technical intricacies of these exploits, showing how they leverage vulnerabilities
- 25:46Speaker 2: bypassed security checks and ultimately achieved their goal.
- 25:49Speaker 1: It's like a masterclass in hacking, but from a defensive
- 25:53Speaker 1: perspective exactly.
- 25:54Speaker 2: By understanding how these exploits work, we can learn how
- 25:57Speaker 2: to better protect against them.
- 25:58Speaker 1: Okay, so we've talked about classic macOS vulnerabilities and iOS
- 26:02Speaker 1: jail breaks. What other kinds of exploits does the book cover?
- 26:05Speaker 2: Well? It goes into some specific attacks like Yalu, which
- 26:10Speaker 2: exploited a kernel memory management vulnerability in iOS ten, and
- 26:14Speaker 2: then there's asinc Wake, which affected versions eleven point zero
- 26:18Speaker 2: to eleven point one point two of iOS.
- 26:21Speaker 1: So it's a pretty comprehensive look at the history of
- 26:23Speaker 1: iOS security research, both from the perspective of those who
- 26:26Speaker 1: seek to protect the system and those who seek to
- 26:29Speaker 1: find its weaknesses.
- 26:30Speaker 2: It is, and it's important to note that the book
- 26:32Speaker 2: doesn't just focus on the exploits themselves. It also delves
- 26:35Speaker 2: into the tools and techniques need to discover and analyze
- 26:38Speaker 2: these vulnerabilities.
- 26:39Speaker 1: It's like a toolkit for security researchers and those who
- 26:42Speaker 1: want to understand how these attacks work exactly.
- 26:44Speaker 2: Gives you a glimpse into the world of security research
- 26:47Speaker 2: and the mindset of those who are constantly probing and
- 26:50Speaker 2: testing the limits of digital security.
- 26:52Speaker 1: It sounds like an invaluable resource for anyone interested in cybersecurity,
- 26:57Speaker 1: whether you're on the offensive or defensive side.
- 26:59Speaker 2: It really is. And one thing that stood out to
- 27:01Speaker 2: me was the emphasis on understanding the why behind these
- 27:07Speaker 2: vulnerabilities and exploits.
- 27:08Speaker 1: What do you mean by that?
- 27:09Speaker 2: It's not enough to just know how an exploit works.
- 27:12Speaker 2: You need to understand the underlying design decisions or coding
- 27:16Speaker 2: practices that made the vulnerability possible in the first place.
- 27:19Speaker 1: Hum, So it's about going beyond the symptoms and understanding
- 27:23Speaker 1: the root cause of.
- 27:24Speaker 2: The problem exactly, because only by understanding the why can
- 27:28Speaker 2: we hope to prevent similar vulnerabilities from appearing in the future.
- 27:31Speaker 1: That makes a lot of sense. So as we wrap
- 27:34Speaker 1: up this deep dive into OS Internals Volume three, what
- 27:38Speaker 1: are some key takeaways for our listeners?
- 27:40Speaker 2: Well, first and foremost, it's a reminder that security is
- 27:43Speaker 2: an ongoing process, a constant evolution. There's no such thing
- 27:46Speaker 2: as a perfectly secure system, and there will always be
- 27:49Speaker 2: those who seek to find and exploit weaknesses.
- 27:52Speaker 1: It's a cat and mouse game, a constant back and
- 27:54Speaker 1: forth between defenders and attackers.
- 27:56Speaker 2: Right, And that's why it's so important to stay informed,
- 27:59Speaker 2: to keep learning, and to adapt to the ever changing
- 28:02Speaker 2: threat landscape.
- 28:03Speaker 1: So it needs to be proactive, not reactive when it
- 28:06Speaker 1: comes to security exactly.
- 28:07Speaker 2: We can't just wait for vulnerabilities to be discovered and
- 28:10Speaker 2: exploits to be developed. We need to be constantly thinking
- 28:12Speaker 2: about security, both as individuals and as a society.
- 28:16Speaker 1: And books like this one can play a valuable role
- 28:19Speaker 1: in that process.
- 28:20Speaker 2: Absolutely, they provide the knowledge and insights. We need to
- 28:23Speaker 2: understand the complexities of digital security and to make informed
- 28:27Speaker 2: decisions about how to protect ourselves and our data.
- 28:31Speaker 1: Well said, so to our listeners, we encourage you to
- 28:35Speaker 1: delve into OS Internal's Volume three yourself and explore the
- 28:39Speaker 1: fascinating world of Apple security and insecurity.
- 28:42Speaker 2: It's a journey that will challenge your assumptions, expand your knowledge,
- 28:46Speaker 2: and ultimately make you a more informed and security conscious user.
- 28:49Speaker 1: Thanks for joining us on this deep dive. We hope
- 28:51Speaker 1: you've enjoyed the exploration and that you'll continue to be curious,
- 28:55Speaker 1: to question and to learn. Until next time, Stay safe
- 28:59Speaker 1: out there in the digital world.