Latest / CyberCode Academy / Course 42 - Mobile Malware Analysis Fundamentals | Episode 2: iOS Architecture & Security
Transcript
- 0:00Speaker 1: Have you ever, you know, just stopped and wondered what's
- 0:03Speaker 1: actually happening under the glass of your smartphone when you
- 0:05Speaker 1: swipe or tap or download an app.
- 0:08Speaker 2: Oh, all the time. I mean, you touch this piece
- 0:10Speaker 2: of flat, cold glass and suddenly you're talking to someone
- 0:13Speaker 2: halfway across the.
- 0:14Speaker 1: World exactly, or you're exploring this massive three D environment,
- 0:18Speaker 1: or securely authorizing a payment for your morning coffee. It
- 0:21Speaker 1: honestly just feels like magic.
- 0:23Speaker 2: It really does. But underneath that glass there is absolutely
- 0:28Speaker 2: zero magic. I mean, it is pure, intricately designed, just
- 0:33Speaker 2: heavily guarded architecture.
- 0:34Speaker 1: Yeah, and that illusion of simplicity that's totally.
- 0:37Speaker 2: By design isn't one hundred percent. Apple is spent what
- 0:40Speaker 2: nearly two decades refining that illusion, so you just never
- 0:43Speaker 2: have to think about the complexity of it all.
- 0:44Speaker 1: But for anyone wanting to truly understand their technology, whether
- 0:48Speaker 1: you're studying cybersecurity or maybe you're developing software, or you're
- 0:51Speaker 1: just you know, insanely curious about these devices running our lives,
- 0:56Speaker 1: you really can't just accept the magic.
- 0:58Speaker 2: No, you can't. You have to understand the builder's blueprint,
- 1:02Speaker 2: because before you can even begin to understand how hackers
- 1:04Speaker 2: try to break a system, you have to know exactly
- 1:06Speaker 2: how it was built from the ground up.
- 1:07Speaker 1: Okay, let's unpack this because our mission for this deep
- 1:10Speaker 1: dive is to really explore that hidden architecture and the
- 1:15Speaker 1: intricate security of the iOS operating system, right, and.
- 1:18Speaker 2: To understand how we arrived at this highly guarded environment today.
- 1:22Speaker 2: We really need to look back at the moment the
- 1:25Speaker 2: tech industry decided a phone wasn't just a phone anymore, right,
- 1:28Speaker 2: the iPhone launch exactly. We have to rewind to two
- 1:31Speaker 2: thousand and seven when Apple released the very first iteration
- 1:34Speaker 2: of iOS, which was version five five running on that
- 1:39Speaker 2: original iPhone. It represented this massive paradigm shift because.
- 1:43Speaker 1: It was the first truly touch centric mobile operating system.
- 1:46Speaker 2: Yeah. But more importantly than just the touch aspect, it
- 1:49Speaker 2: wasn't built from scratch as some lightweight, flimsy mobile interface.
- 1:54Speaker 2: It was actually built on the rock solid foundation of macOS.
- 1:57Speaker 1: Wow. Okay, so the device in your pocket was like,
- 2:00Speaker 1: for the very first time, a legitimate Unix based computer.
- 2:03Speaker 2: Exactly, and it evolves so rapidly from there. Those early
- 2:07Speaker 2: versions brought constant user enhancements and security updates leading up
- 2:11Speaker 2: to milestones like well, like the beta release of iOS
- 2:15Speaker 2: thirteen in mid twenty nineteen.
- 2:16Speaker 1: But I'd argue the real structural game changer in this
- 2:19Speaker 1: whole history happened a bit earlier. In two thousand and.
- 2:22Speaker 2: Eight, Oh, the launch of the App Store. Yeah totally, Yeah.
- 2:25Speaker 1: Apple released a software development kit that basically allowed anyone
- 2:28Speaker 1: with a Mac and some coding knowledge to build applications
- 2:32Speaker 1: for this platform.
- 2:32Speaker 2: And it just exploded. By twenty seventeen, that ecosystem had
- 2:36Speaker 2: grown to over three million apps available for download.
- 2:39Speaker 1: I mean, it's staggering, which is exactly why understanding malware
- 2:43Speaker 1: on this platform is so critical today. Right, if three
- 2:45Speaker 1: million legitimate developers can figure out how to build incredibly
- 2:49Speaker 1: complex tools for this ecosystem, well, malicious actors are studying
- 2:53Speaker 1: those exact same blueprints to figure out how to exploit it.
- 2:56Speaker 2: That's the terrifying part. Yeah. To understand how a malicious
- 2:59Speaker 2: app operates, we first need to really understand the environment
- 3:03Speaker 2: it lives in.
- 3:03Speaker 1: So the operating system itself, it's highly structured into these
- 3:06Speaker 1: layers of abstraction.
- 3:08Speaker 2: Right, it operates almost like a meticulously organized business.
- 3:11Speaker 1: So let's use an analogy to visualize how these layers
- 3:14Speaker 1: interact without needing a screen in front of us. Think
- 3:18Speaker 1: of the iOS architecture like this massive high end restaurant.
- 3:21Speaker 2: Oh I like this.
- 3:22Speaker 1: Yeah. So at the very top you have the front
- 3:25Speaker 1: of the house where the customers sit. Below that the
- 3:27Speaker 1: presentation area where the plates are all beautifully arranged. Further
- 3:31Speaker 1: down you've got the prep kitchen, and at the very
- 3:33Speaker 1: bottom the supply chain bringing in the raw ingredients.
- 3:36Speaker 2: That's a great way to look at it. Let's start
- 3:38Speaker 2: at the top right, the part the customer actually sees
- 3:41Speaker 2: the dining room exactly. This top layer is called Coco
- 3:45Speaker 2: Touch in our restaurant analogy. This is your waiter and
- 3:49Speaker 2: your menu. It is the interface what the user actually
- 3:52Speaker 2: touches and interacts with. Okay, so when your finger makes
- 3:55Speaker 2: contact with the glass to pull, drag, slideer, tap, Coco
- 3:59Speaker 2: Touch is the layer that's interpreting that physical gesture into
- 4:03Speaker 2: a digital command.
- 4:04Speaker 1: So if I open a messaging app and swipe right
- 4:06Speaker 1: on a conversation to delete it, Coco Touch is basically
- 4:09Speaker 1: the waiter taking my order.
- 4:10Speaker 2: You got it, and it handles much more than just
- 4:14Speaker 2: touch too. Coco Touch houses the controllers that manage an
- 4:18Speaker 2: app's overall behavior like what well, if something goes wrong
- 4:22Speaker 2: and an alert pops up on your screen, that messaging
- 4:25Speaker 2: service is handled right here. It also manages localization.
- 4:29Speaker 1: Oh like changing languages.
- 4:30Speaker 2: Yeah, if you travel to a new country and your
- 4:33Speaker 2: app suddenly shifts its language and date formatting to match
- 4:36Speaker 2: your current region, Coco Touch is dynamically translating that menu
- 4:40Speaker 2: for you.
- 4:40Speaker 1: That's really cool. And it handles native web views for
- 4:43Speaker 1: HTML content right yep.
- 4:45Speaker 2: And it provides the image and people pickers, you know,
- 4:48Speaker 2: those familiar menus that slide up when you want to
- 4:50Speaker 2: choose a photo or select a contact right right.
- 4:53Speaker 1: But then, sticking with our analogy here, the waiter doesn't
- 4:55Speaker 1: cook the food exactly.
- 4:57Speaker 2: If you tap on a high definition video or you
- 4:59Speaker 2: launch a really greatphically intense game, Coco Touch doesn't have
- 5:02Speaker 2: the tools to handle that. It takes that request and
- 5:05Speaker 2: passes it down a level to the core Media.
- 5:07Speaker 1: Air ahh okay, the presentation area of our kitchen.
- 5:11Speaker 2: Yes, this is the entertainment center of the system. Core
- 5:14Speaker 2: Media provides all the multimedia services and holds the heavy
- 5:17Speaker 2: graphics libraries. This is actually where OPENNGL lives.
- 5:21Speaker 1: And for anyone who doesn't know OPENNGL is a it's
- 5:24Speaker 1: a cross language application programming interface, right. Yeah, that renders
- 5:28Speaker 1: two D and three D vector graphics.
- 5:31Speaker 2: Right, And to put that in perspective, rendering a three
- 5:34Speaker 2: D object requires an enormous amount of continuous.
- 5:37Speaker 1: Math, like a staggering amount.
- 5:39Speaker 2: Oh yeah, just constantly calculating lighting, shadows, and geometry in
- 5:42Speaker 2: real time. Coco Touch couldn't possibly handle all that math
- 5:46Speaker 2: while also listening for your next fingertap.
- 5:48Speaker 1: That makes total sense. It would just freeze up completely.
- 5:50Speaker 2: So it offloads that heavy lifting to core media. This
- 5:53Speaker 2: layer gives apps access to audio mixing and recording, video playback,
- 5:57Speaker 2: and really complex animation support.
- 6:00Speaker 1: I read. It also houses the PDP rendering engines, which
- 6:03Speaker 1: kind of surprised me.
- 6:04Speaker 2: Well, think about it. Drawing a highly complex visual document
- 6:07Speaker 2: requires the same kind of heavy media horsepower as rendering
- 6:10Speaker 2: a photograph.
- 6:11Speaker 1: Oh true. Okay, so we have the waiter taking the order,
- 6:14Speaker 1: the presentation kitchen handling the complex visuals. But what about
- 6:17Speaker 1: the raw data?
- 6:18Speaker 2: What do you mean?
- 6:19Speaker 1: Well, if I open my map app, it needs to
- 6:21Speaker 1: know where I am, and it needs to actually download
- 6:24Speaker 1: the map tiles. Right, it needs the basic ingredients.
- 6:28Speaker 2: Yes, that request drops down to the third layer, Core Services,
- 6:32Speaker 2: the prep kitchen exactly. The prep kitchen. It provides plumbing
- 6:35Speaker 2: and utility so that apps can access foundational services without
- 6:40Speaker 2: having to speak directly to the hardware itself.
- 6:42Speaker 1: Okay, can you give an example.
- 6:43Speaker 2: Sure? For instance, it handles your networking state. It is
- 6:46Speaker 2: constantly detecting whether you are on Wi Fi, cellular, or
- 6:49Speaker 2: Bluetooth and managing the basic state of that connection, so
- 6:53Speaker 2: the app itself doesn't have to figure it all out
- 6:55Speaker 2: from scratch.
- 6:56Speaker 1: So the app just asks Core Services, hey, am I online,
- 6:59Speaker 1: and Core Services says, yeah, you're on Wi Fi exactly.
- 7:03Speaker 2: It's also where the data management lives. Core Services houses
- 7:06Speaker 2: the address book framework and squeal it.
- 7:08Speaker 1: Oh, let's talk about school it for a second, because
- 7:10Speaker 1: that is crucial.
- 7:11Speaker 2: It really is. Squilight is essentially the filing cabinet system
- 7:15Speaker 2: for the phone. It allows apps to utilize a local database.
- 7:20Speaker 1: Which means, Okay, if I open my social media feed
- 7:22Speaker 1: while I'm on an airplane with no Wi Fi, I
- 7:25Speaker 1: can still see the posts I scrolled through earlier.
- 7:27Speaker 2: Right, the app doesn't just crash. It pulls that cache
- 7:30Speaker 2: data from the Squilight database, which is managed by Core Services.
- 7:34Speaker 1: Amazing. Okay, that brings us to the very bottom layer,
- 7:38Speaker 1: the supply chain.
- 7:39Speaker 2: Yes, the core OS or core operating system layer. This
- 7:42Speaker 2: interacts directly with the physical hardware chips inside the device,
- 7:46Speaker 2: So this is.
- 7:47Speaker 1: Where things get really.
- 7:48Speaker 2: Low level, very low level. It provides access to the
- 7:51Speaker 2: mac OS kernel, the hardware drivers, and the network sockets.
- 7:55Speaker 1: The raw power essentially, so if Core Services decides we
- 7:58Speaker 1: need to use the cellular antenna, COROS is the layer
- 8:01Speaker 1: actually sending electrical signals to the physical antenna hardware.
- 8:05Speaker 2: You've got it. It also manages power consumption, which obviously
- 8:08Speaker 2: needs to sit as close to the physical battery hardware
- 8:10Speaker 2: as possible. And crucially it houses the key chains and
- 8:14Speaker 2: the foundational security of the device. All the complex cryptographic
- 8:19Speaker 2: functions for encrypting and decrypting your data happen right down
- 8:22Speaker 2: here at the COROS layer, communicating directly with the metal.
- 8:26Speaker 1: Okay, So if we connect this to the bigger picture,
- 8:28Speaker 1: the whole reason we need to understand this restaurant from
- 8:31Speaker 1: Coco Touch all the way down to COROS is because
- 8:34Speaker 1: malware authors they don't have their own secret operating.
- 8:37Speaker 2: System exactly, they are operating in the exact same restaurant
- 8:41Speaker 2: as everyone else. When a legitimate developer builds an app,
- 8:46Speaker 2: they use these specific layers and frameworks. Well, malware authors
- 8:50Speaker 2: use the exact same building blocks.
- 8:52Speaker 1: So if you want to analyze or reverse engineer malicious applications,
- 8:56Speaker 1: you really have to understand how these four layers operate.
- 8:59Speaker 2: You have to You have to be able to spot
- 9:01Speaker 2: how a piece of malware is twisting legitimate tools, like say,
- 9:05Speaker 2: asking Core services to constantly check your location, or using
- 9:09Speaker 2: Core media to secretly record audio. You have to see
- 9:12Speaker 2: how they're using it to their advantage.
- 9:13Speaker 1: Basically, to catch a burglar, you have to know how
- 9:15Speaker 1: the doors and windows of the house actually function.
- 9:18Speaker 2: That's a perfect way to phrase it.
- 9:19Speaker 1: But this actually brings up a rather large puzzle for me.
- 9:22Speaker 1: If malwaur authors have access to the exact same layers
- 9:26Speaker 1: and frameworks as legitimate developers, how does Apple maintain such
- 9:30Speaker 1: a famously low rate of malware infections.
- 9:33Speaker 2: Well, it really comes down to how they designed the
- 9:35Speaker 2: building itself. Apple analyzed the security vulnerabilities that had just
- 9:40Speaker 2: plagued desktop operating systems for decades, and they designed a
- 9:44Speaker 2: mobile architecture that drastically tightened the environment.
- 9:47Speaker 1: See I want to push back on this a little bit. Okay,
- 9:49Speaker 1: go for it, Because early on, this tightened environment frustrated
- 9:53Speaker 1: a lot of users. Apple famously refused to support incredibly
- 9:57Speaker 1: popular software standards. There was no support for Java or
- 10:02Speaker 1: Flash on iOS.
- 10:03Speaker 2: That's true. People were furious.
- 10:04Speaker 1: Yeah, even things like certain movie files or complex PDFs
- 10:08Speaker 1: were only partially supported compared to what a desktop computer
- 10:11Speaker 1: could do. So by artificially limiting the capabilities of the phone,
- 10:15Speaker 1: are you saying they actually made it more secure? Well?
- 10:17Speaker 2: Absolutely, And what's fascinating here is the concept of attack surfaces.
- 10:21Speaker 1: Attack surfaces.
- 10:22Speaker 2: Yeah, software like Adobe Flash or Java, they were historically
- 10:26Speaker 2: just riddled with critical vulnerabilities. I mean, they were incredibly complex,
- 10:32Speaker 2: bloated programs that hackers constantly exploited to gain control of
- 10:35Speaker 2: desktop computers.
- 10:36Speaker 1: Right, You're always downloading a security patch for Flash constantly.
- 10:40Speaker 2: So by choosing not to fully support them in the
- 10:43Speaker 2: mobile ecosystem, Apple effectively shrunk the number of doors and
- 10:47Speaker 2: windows a hacker could even attempt to pry open. Wow.
- 10:51Speaker 1: Okay, So reducing the overall attack surface by eliminating notoriously
- 10:55Speaker 1: weak software might frustrate a user wanting to play a
- 10:58Speaker 1: specific web game, but from a security standpoint. It is
- 11:02Speaker 1: kind of a masterstroke, it really is.
- 11:04Speaker 2: They didn't just build a stronger door, they remove the
- 11:07Speaker 2: weak windows from the blueprint entirely.
- 11:08Speaker 1: Let's look at the doors that have to be there, then,
- 11:10Speaker 1: starting with the system security that kicks in the exact
- 11:13Speaker 1: second you hold down the power button.
- 11:15Speaker 2: The boot process. This is so cool. It relies on
- 11:18Speaker 2: a piece of hardware called the secure enclave.
- 11:21Speaker 1: The secure enclave what is that exactly?
- 11:23Speaker 2: It operates as this highly complex, completely isolated key management
- 11:28Speaker 2: chip on the device itself during the manufacturing process. The
- 11:33Speaker 2: physical silicon of this chip is actually imprinted with an
- 11:36Speaker 2: implicitly trusted unique key.
- 11:39Speaker 1: So the hardware itself has a permanent, unchangeable identity.
- 11:42Speaker 2: Yes, and from the millisecond the device boots up, the
- 11:45Speaker 2: hardware works with the secure enclave to create a chain
- 11:49Speaker 2: of system integrity.
- 11:50Speaker 1: A chain of integrity. How does that work?
- 11:52Speaker 2: Think of it like a relay race where every single
- 11:54Speaker 2: runner has to cryptographically verify a secret password before handing
- 11:58Speaker 2: off the baton to the next process. Oh, I see,
- 12:01Speaker 2: So the initial hardware bootloader verifies the OS kernel, then
- 12:05Speaker 2: the kernel verifies the system partitions.
- 12:07Speaker 1: Wait, so, at any point during this relay race a
- 12:10Speaker 1: piece of code looks tampered with. Say a hacker tried
- 12:13Speaker 1: to I don't know, inject malicious code into the boot sequence.
- 12:16Speaker 2: What happens The phone simply aborts the boot process, just stops.
- 12:19Speaker 2: It just stops. It drops into what it's called DFU
- 12:22Speaker 2: or Device Firmware Update mode, and demands to be restored
- 12:25Speaker 2: to a factory state. It slat out refuses to turn
- 12:28Speaker 2: on if the chain of trust is broken.
- 12:30Speaker 1: That is wild. Okay, But what about the physical data
- 12:33Speaker 1: on the device. Say someone doesn't try to boot the phone,
- 12:36Speaker 1: say they steal it, pry it open, unsolder the memory chip,
- 12:40Speaker 1: and plug it into their own forensic computer. What stops
- 12:44Speaker 1: them from reading my emails and text messages directly off
- 12:47Speaker 1: the raw storage?
- 12:49Speaker 2: Uh? That's where data at rest comes in. Data at
- 12:52Speaker 2: rest is protected using AEES two fifty six encryption. But
- 12:56Speaker 2: the brilliant part is the math behind how the encryption
- 12:59Speaker 2: key is actually generated.
- 13:00Speaker 1: Okay, lay it on me.
- 13:02Speaker 2: When you enable a passcode on your device, the system
- 13:05Speaker 2: takes your user passcode and it entangles it with a
- 13:08Speaker 2: unique physical hardware device ID. We just talked about, the
- 13:11Speaker 2: one inside the secure enclave.
- 13:12Speaker 1: Oh wow, So the passcode alone isn't the queue.
- 13:15Speaker 2: Nope, the key is the mathematical combination of your passcode
- 13:18Speaker 2: and the physical silicon of that specific phone.
- 13:20Speaker 1: That is genius, right.
- 13:22Speaker 2: That entangled key is what encrypts the data at rest.
- 13:25Speaker 2: So if a bad actor rips out the memory chip
- 13:26Speaker 2: and puts it in another machine, the data is just
- 13:29Speaker 2: scrambled noise.
- 13:30Speaker 1: Because they don't have the hardware device ID from your
- 13:32Speaker 1: original motherboard to completely the math required to decrypt it exactly.
- 13:36Speaker 2: It physically anchors your digital privacy to the specific device
- 13:39Speaker 2: in your pocket.
- 13:40Speaker 1: I love that. And I've also noted that system security
- 13:43Speaker 1: includes software authorizations that actively prevent you from installing older
- 13:47Speaker 1: versions of iOS.
- 13:48Speaker 2: Why is that because hackers steady old code. When Apple
- 13:53Speaker 2: patches a security flaw in an update, hackers immediately reverse
- 13:56Speaker 2: engineer that patch to figure out exactly how the exploit
- 14:00Speaker 2: worked in the older version.
- 14:01Speaker 1: Oh so they use the patch as a map to
- 14:03Speaker 1: find the vulnerability exactly.
- 14:05Speaker 2: So if a malicious actor gets hold of your phone,
- 14:08Speaker 2: their very first move might be trying to force it
- 14:10Speaker 2: to downgrade to an older, vulnerable version of iOS so
- 14:14Speaker 2: they can use those known exploits to pick the.
- 14:16Speaker 1: Lock and Apple blocks that.
- 14:18Speaker 2: Yes. To prevent this, the system software authorization checks with
- 14:22Speaker 2: Apple servers during an update or restore to ensure only
- 14:25Speaker 2: the latest, cryptographically signed and most secure version of the
- 14:28Speaker 2: operating system can be installed. It permanently blocks that downgrade path.
- 14:33Speaker 1: Okay, so the core system is essentially fort Knox. The
- 14:37Speaker 1: hardware is checking its own integrity during boot, the data
- 14:41Speaker 1: scrambled using physical hardware keys, and you can't even install
- 14:45Speaker 1: vulnerable software.
- 14:46Speaker 2: Sounds pretty secure, it does?
- 14:48Speaker 1: But will? We just established there are over three million
- 14:51Speaker 1: third party apps available. How can a system remain secure
- 14:56Speaker 1: if users are voluntarily inviting dozens of external programs and
- 15:00Speaker 1: inside the walls every single day?
- 15:01Speaker 2: Yeah, that's the big question. Application security is arguably the
- 15:04Speaker 2: most critical layer when we analyze malware. First off, every
- 15:09Speaker 2: single app must be digitally signed by Apple code signing. Right.
- 15:13Speaker 2: Code signing verifies that the application code has come from
- 15:15Speaker 2: an apprude source and you know, a registered developer pushing
- 15:18Speaker 2: through the app store, and that the code hasn't been
- 15:21Speaker 2: altered by a third party since it was submitted.
- 15:23Speaker 1: So it's basically checking the idea at the door.
- 15:25Speaker 2: Yep iOS enforces this by checking the Apple as signed
- 15:28Speaker 2: certificate and closely monitoring the loaded libraries within the applications
- 15:32Speaker 2: memory space.
- 15:32Speaker 1: Okay, but once the app is actually inside what dictates
- 15:35Speaker 1: its behavior?
- 15:36Speaker 2: The sandbox applications are granted what is called unprivileged user's status.
- 15:43Speaker 2: They're placed in a strictly isolated virtual room known as
- 15:46Speaker 2: a sandbox.
- 15:47Speaker 1: And what does that mean? In practice?
- 15:49Speaker 2: It means an app inside a sandbox cannot see, touch,
- 15:52Speaker 2: or interact with the memory space of any other application
- 15:56Speaker 2: on the device. It only knows about its own files.
- 15:59Speaker 1: See here's where I have to pause because that sounds
- 16:02Speaker 1: great in theory. But my apps talk to each other constantly?
- 16:05Speaker 2: Do they?
- 16:06Speaker 1: Yeah? If I use a third party photo editing app,
- 16:10Speaker 1: it saves the finished graphic directly back to my main
- 16:12Speaker 1: iOS photos app. Or if I download a new messaging service,
- 16:15Speaker 1: it immediately populates with all the contacts from my default
- 16:18Speaker 1: address book. How does that data move around if every
- 16:21Speaker 1: app is permanently trapped in a Windows sandbox?
- 16:24Speaker 2: This rais is a really important question, and it perfectly
- 16:27Speaker 2: highlights how Apple balances security with usability. Because they don't
- 16:31Speaker 2: break the sandbox to allow this, they build highly regulated workarounds. Okay,
- 16:36Speaker 2: how the primary mechanism they use is called an extension.
- 16:39Speaker 1: An extension, So think of an extension as a heavily
- 16:42Speaker 1: guarded courier service operating in the hallways between the sandboxes.
- 16:45Speaker 2: That is a perfect way to visualize it. Let's take
- 16:48Speaker 2: your third party messaging app needing to see your address
- 16:50Speaker 2: book right right. The messaging app does not get to
- 16:53Speaker 2: leave its sandbox, wander down to the core services layer
- 16:56Speaker 2: and just rummage through your contacts database. Instead, it utilizes
- 17:01Speaker 2: an extension. Okay, the extension is actually a separate binary
- 17:04Speaker 2: packaged into the application. This courier operates strictly within its
- 17:09Speaker 2: own specific framework. It takes the request, securely, grabs the
- 17:13Speaker 2: necessary data from the address book, and then hands the
- 17:16Speaker 2: data back to the messaging app.
- 17:18Speaker 1: Ooh, so the address spaces of the apps never actually
- 17:20Speaker 1: cross never.
- 17:22Speaker 2: The messaging app only ever touches the data the extension
- 17:24Speaker 2: handed to it, keeping the sandbox entirely intact.
- 17:27Speaker 1: That's brilliant. Do apps share data any other way?
- 17:30Speaker 2: They do? Developers can use something called app groups.
- 17:34Speaker 1: What's an app group?
- 17:35Speaker 2: Well, if a single software company makes, say a suite
- 17:39Speaker 2: of five different productivity apps, they can register those apps
- 17:43Speaker 2: as a specific family app groups allow that family to
- 17:46Speaker 2: create a secure shared volume.
- 17:49Speaker 1: Like a shared folder.
- 17:50Speaker 2: Yeah, it functions like a locked shared filing cabinet sitting
- 17:53Speaker 2: in the hallway between their specific sandboxes. They can use
- 17:57Speaker 2: this shared volume to safely pass user preferences or log
- 18:00Speaker 2: in credentials back and.
- 18:01Speaker 1: Forth, meaning you only have to log into one of
- 18:04Speaker 1: their apps to authenticate all five without ever exposing their
- 18:08Speaker 1: internal memory to the wider operating system.
- 18:10Speaker 2: Exactly. It's super efficient.
- 18:12Speaker 1: Okay, here's where it gets really interesting. We've talked about
- 18:14Speaker 1: securing the system when it's off and keeping apps trapped
- 18:17Speaker 1: in sandboxes, but what about the raw data itself when
- 18:20Speaker 1: the phone is actually turned on, unlocked, and actively being used.
- 18:24Speaker 2: Securing data in use is incredibly complex. iOS implements a
- 18:28Speaker 2: method called file protection all protection.
- 18:30Speaker 1: How does that work?
- 18:31Speaker 2: When data is stored in the flash memory and actively
- 18:34Speaker 2: being used by system apps like your calendar updating an
- 18:36Speaker 2: appointment or your contacts saving a new number. iOS uses
- 18:40Speaker 2: a key wrap construction.
- 18:41Speaker 1: Okay, let's translate key wrap construction for a second.
- 18:44Speaker 2: Right, Sorry, It's a type of symmetric encryption algorithm. Its
- 18:47Speaker 2: primary job is to protect cryptographic key material while it's
- 18:51Speaker 2: actively in use. Okay, Rather than leaving the encryption keys
- 18:54Speaker 2: exposed in the system memory while the app is reading
- 18:57Speaker 2: a file, the system actually encrypts the keys them Wait.
- 19:00Speaker 1: Really, even while the data is actively being read, the
- 19:03Speaker 1: keys required to read that data are wearing their own
- 19:06Speaker 1: layer of armor.
- 19:07Speaker 2: Yes, and this heavily involves keychains and key bags, which
- 19:11Speaker 2: we briefly mentioned earlier down in the coros layer.
- 19:14Speaker 1: Okay, remind me how those fit in.
- 19:16Speaker 2: So keychains are incredibly secure as two hundred and fifty
- 19:19Speaker 2: six encrypted containers holding your most sensitive bits of data.
- 19:23Speaker 2: Your login tokens, saved web passwords, and API keys all
- 19:27Speaker 2: live in the keychain and the key bags. The key
- 19:30Speaker 2: bag is a specific data structure used to store a
- 19:32Speaker 2: collection of class keys.
- 19:34Speaker 1: Let me see if I can infer how this connects.
- 19:37Speaker 1: The class keys inside the key bag are those the
- 19:39Speaker 1: specific keys used during that file protection key wrapping process.
- 19:44Speaker 2: Precisely, And the key bags themselves are protected with encryption
- 19:47Speaker 2: keys generated by the underlying hardware.
- 19:49Speaker 1: Oh my gosh, it operates like a nesting doll of encryption.
- 19:52Speaker 2: It really does.
- 19:53Speaker 1: The secure enclay of hardware generates a key to lock
- 19:55Speaker 1: the key bag, Then the key bag holds the class
- 19:58Speaker 1: keys and the class keys used to wrap and encrypt
- 20:01Speaker 1: the cryptographic material used in file protection just to read
- 20:05Speaker 1: the data you mailed it. With so many layers of
- 20:08Speaker 1: overlapping encryption, how does data ever safely leave the device
- 20:12Speaker 1: to travel across the Internet?
- 20:14Speaker 2: Well network securities where Apple takes a surprisingly straightforward approach.
- 20:18Speaker 2: Rather than trying to invent a proprietary, secretive Internet language,
- 20:22Speaker 2: they employ mature, commonly supported, industry standard networking technologies.
- 20:27Speaker 1: Oh really, so when the default mail app or Safari
- 20:30Speaker 1: browser sends data, it's just using standard protocols.
- 20:33Speaker 2: Yeah, in most cases these protections are deeply integrated and
- 20:37Speaker 2: enabled by default. It uses TLS Transport Layer Security as
- 20:41Speaker 2: the default protocol to ensure data is encrypted in Transit
- 20:45Speaker 2: makes sense, And if you connect to a VPN or
- 20:47Speaker 2: a Wi Fi network, the architecture supports all the heavy
- 20:50Speaker 2: hitting industry standard encryption and authentication methods. Even local connections
- 20:55Speaker 2: are locked down like air drop. Exactly when you use
- 20:58Speaker 2: features like air drop or a wife by Sharing to
- 21:00Speaker 2: send a file to a device across the room, Apple
- 21:03Speaker 2: is utilizing standard Bluetooth and Wi Fi protocols but layering
- 21:07Speaker 2: them with heavily encrypted data transmissions between the paired devices.
- 21:11Speaker 1: Which actually brings us to the silver lining for anyone
- 21:14Speaker 1: studying cybersecurity or analyzing belware, because so far, this multi
- 21:19Speaker 1: layered fortress sounds completely impenetrable.
- 21:21Speaker 2: The silver lining is that Apple forces all network traffic
- 21:24Speaker 2: to go through these mature, well documented, standardized networking technologies,
- 21:29Speaker 2: and this actually gives malware analysts an enormous advantage. Ow So,
- 21:33Speaker 2: because when a malicious application manages to infect a phone
- 21:36Speaker 2: and attempts to communicate back to a hacker's command and
- 21:39Speaker 2: control server, it generally has to use these same standard protocols.
- 21:43Speaker 2: It can't easily invent its own invisible networking framework to
- 21:47Speaker 2: sneak data out the back door.
- 21:49Speaker 1: It has to drive on the roads Apple paved.
- 21:51Speaker 2: Exactly, it has to use the heavily surveiled front doors.
- 21:55Speaker 2: Because it relies on standard TLS or Wi Fi protocols
- 21:58Speaker 2: to communicate, it leaves a recognizable trackable footprint.
- 22:01Speaker 1: Oh wow, So analysts can monitor the network traffic, identify
- 22:05Speaker 1: the malicious behavior, and actually trace it back to the source.
- 22:08Speaker 2: Yes, the rigid structure ultimately helps the good guys catch
- 22:11Speaker 2: the bad guys.
- 22:12Speaker 1: Man, we have covered a massive amount of architectural ground
- 22:15Speaker 1: today we really have. We started at the foundation of
- 22:18Speaker 1: the four layers, right the core os handling the raw
- 22:21Speaker 1: physical hardware, up through core services managing the plumbing and
- 22:25Speaker 1: databases like schoolight than core media handling the heavy three
- 22:28Speaker 1: D and audio rendering, all the way up to Cocoa
- 22:31Speaker 1: touch where the user interface actually registers your physical tap.
- 22:34Speaker 2: That's the four layer cake, right.
- 22:36Speaker 1: And we explored how shrinking attack surfaces by dropping vulnerable
- 22:40Speaker 1: software creates a tighter perimeter, how code signing and extensions
- 22:44Speaker 1: allow apps to function securely without breaking their sandboxes, and
- 22:47Speaker 1: how hardware level entanglement with the secure enclave locks down
- 22:51Speaker 1: data at rest.
- 22:52Speaker 2: It is honestly a phenomenal blueprint for balancing usability with
- 22:55Speaker 2: aggressive security.
- 22:56Speaker 1: Okay, before we wrap up, let's do a quick mental
- 22:59Speaker 1: check to reaforce how all these concepts connect. For you listening,
- 23:03Speaker 1: I want you to imagine you were designing a brand
- 23:06Speaker 1: new messaging app that needs to access a user's camera
- 23:09Speaker 1: to take a profile picture.
- 23:11Speaker 2: Ooh, good test.
- 23:12Speaker 1: Think about the four layers and the security protocols we
- 23:15Speaker 1: discussed today. Which architectural layer would handle the raw physical
- 23:19Speaker 1: camera hardware and what specific security feature allows your sandboxed
- 23:24Speaker 1: app to securely request that data.
- 23:26Speaker 2: The raw camera hardware operation and power management would be
- 23:30Speaker 2: managed way down at the corowest layer. Then the heavy
- 23:34Speaker 2: graphical processing of the video feed would hit the core
- 23:37Speaker 2: media layer.
- 23:38Speaker 1: And to actually get that camera feed into your isolated
- 23:40Speaker 1: messaging app, you wouldn't break the sandbox. You would use
- 23:43Speaker 1: an extension that highly regulated career just to securely pass
- 23:46Speaker 1: the data across the boundaries.
- 23:47Speaker 2: Perfect. If you can visualize that process, you are well
- 23:50Speaker 2: in your way to truly understanding iOS architecture and how
- 23:53Speaker 2: to secure it.
- 23:54Speaker 1: Okay, any final thoughts?
- 23:55Speaker 2: Yeah, thing, leave you with one final thought to ponder.
- 23:58Speaker 2: We discussed how connecting a unique physical hardware ID from
- 24:01Speaker 2: the secure enclave with the user's passcode creates an unbreakable
- 24:05Speaker 2: encryption key for data at rest.
- 24:07Speaker 1: Right right the hardware entanglement.
- 24:09Speaker 2: So, looking toward the future, what happens to our security
- 24:12Speaker 2: models when entirely virtualized cloud based smartphones become the norm
- 24:16Speaker 2: and that physical hardware chip no longer exists in your
- 24:19Speaker 2: pocket to anchor the encryption.
- 24:21Speaker 1: Wow, that is a fascinating and terrifying puzzle for the
- 24:24Speaker 1: next generation of cybersecurity. Keep questioning how your technology works.
- 24:28Speaker 1: Keep studying the blueprints, and never stop wondering what is
- 24:31Speaker 1: actually happening under the gloss.