Latest / CyberSecurity Summary / Serverless Security: Understand, Assess, and Implement Secure and Reliable Applications in AWS, Microsoft Azure, and Google Cloud
Transcript
- 0:00Speaker 1: Welcome to a deep dive into serverlest security. We've got
- 0:04Speaker 1: quite a stack of resources this time, including excerpts from
- 0:07Speaker 1: the book serverlest Security, Understand, Assess, and Implement Secure in
- 0:11Speaker 1: Time by miguel A. Collis. So today we're going to
- 0:14Speaker 1: try to extract the essential nuggets and help you get
- 0:18Speaker 1: up to speed on serverlest security.
- 0:19Speaker 2: Yeah, we're gonna be looking at what makes serverlest security unique,
- 0:23Speaker 2: how to think about risk, and the practical steps you
- 0:26Speaker 2: can take to protect your applications.
- 0:28Speaker 1: It's interesting how serverleists can work with any cloud model, right, private, public,
- 0:32Speaker 1: or even a hybrid setup. But you know, the book
- 0:35Speaker 1: makes it very clear that regardless of the model, threats exist.
- 0:38Speaker 1: Why focus on serverleist security specifically, It seems like these
- 0:41Speaker 1: platforms already have some security built in.
- 0:44Speaker 2: You're right, they do come with some inherent security features,
- 0:47Speaker 2: but it's a shared responsibility model. The provider takes care
- 0:51Speaker 2: of the underlying infrastructure, but you're in charge of securing
- 0:54Speaker 2: your apps and your data. And server list brings its
- 0:56Speaker 2: own unique set of security challenges.
- 0:58Speaker 1: Okay, I'm all ears, let's unpack these unique challenges. The
- 1:02Speaker 1: next part of the book focuses on understanding the application
- 1:05Speaker 1: you're trying to secure. It's like know your enemy right exactly.
- 1:10Speaker 2: Every serverless application is unique, so it needs a tailored
- 1:14Speaker 2: security approach. The book recommends starting with a good old
- 1:18Speaker 2: fashioned documentation review. Architecture diagrams are key. They're like blueprints,
- 1:23Speaker 2: mapping out your applications components and how they interact, giving
- 1:26Speaker 2: you a visual guide, so.
- 1:27Speaker 1: Getting a bird's eye view of the application landscape precisely.
- 1:31Speaker 2: Then we move on to source code review. This is
- 1:33Speaker 2: where you get your hands storty, looking at the functions,
- 1:36Speaker 2: run time engines, and event triggers that make up your application.
- 1:39Speaker 2: By understanding the code, you can spot vulnerabilities, things like
- 1:43Speaker 2: insecure coding practices or risky dependencies.
- 1:46Speaker 1: This is where we roll up our sleeves and get
- 1:47Speaker 1: into the nuts and bolts. What about system accounts? The
- 1:50Speaker 1: book mentioned those right.
- 1:51Speaker 2: System account review is critical. You're looking for threats both
- 1:54Speaker 2: from the outside and the inside. By analyzing user accounts, permissions,
- 1:58Speaker 2: and access controls. We want to make sure that only
- 2:01Speaker 2: the right people can access sensitive resources. Got it, locking
- 2:05Speaker 2: things down, making sure the right people have the right access.
- 2:08Speaker 2: But this next part is interesting. The book actually suggests
- 2:12Speaker 2: using the application to understand its security hands on approach.
- 2:16Speaker 2: I like it.
- 2:16Speaker 1: H By actually using the app, you can see its
- 2:18Speaker 1: network traffic in real time. You see how data is
- 2:21Speaker 1: transmitted and identify any red flags. Think of it as
- 2:24Speaker 1: a security test drive.
- 2:26Speaker 2: I love it. We've got the application blueprint from the documentation,
- 2:30Speaker 2: we've looked under the hood with the source code, and
- 2:32Speaker 2: we've taken it for a security test drive. Now let's
- 2:35Speaker 2: talk threats.
- 2:36Speaker 1: Okay, but first we've got to define the security enclave,
- 2:40Speaker 1: sometimes called the trust boundary. It's like drawing a line
- 2:43Speaker 1: around the parts of your application that you're responsible for securing.
- 2:47Speaker 1: Anything outside that line might have different security needs or
- 2:49Speaker 1: be managed by someone else.
- 2:51Speaker 2: Okay, establishing the defensive perimeter exactly. Now, about those threats.
- 2:55Speaker 2: The FBI's Internet Crime Complaint Center or IC three, they've
- 3:00Speaker 2: seen a huge increase in Internet crime costs, going from
- 3:03Speaker 2: five hundred and eighty one point four million dollars in
- 3:05Speaker 2: twenty twelve to a whopping two point seven billion dollars
- 3:08Speaker 2: in twenty eighteen. And you know, serverless applications, with all
- 3:12Speaker 2: their moving parts and reliance on other services they could
- 3:15Speaker 2: be attempting target.
- 3:16Speaker 1: Those numbers are scary, So who are we up against?
- 3:19Speaker 1: The book mentions script kitties, who are they? And should
- 3:22Speaker 1: we be worried?
- 3:23Speaker 2: Script kitties are individuals, usually with limited skills, who use
- 3:26Speaker 2: pre made tools and scripts to launch attacks. They're mostly
- 3:29Speaker 2: driven by curiosity, maybe a desire to cause little chaos.
- 3:33Speaker 2: Think of them as like digital graffiti artists. Annoying but
- 3:36Speaker 2: not super sophisticated, so.
- 3:38Speaker 1: More of a nuisance than a serious threat.
- 3:40Speaker 2: Yeah. Generally, basic security hygiene like keeping your systems up
- 3:43Speaker 2: to date and using firewalls can usually keep them away.
- 3:46Speaker 1: Good to know. What about cybercriminals? They sound much more
- 3:48Speaker 1: formidable they are.
- 3:50Speaker 2: Cybercriminals are motivated by profit, plan and simple. They use malware, phishing, scams,
- 3:54Speaker 2: social engineering, all kinds of tactics to steal data, compromise systems,
- 3:58Speaker 2: basically make money.
- 3:59Speaker 1: These are the pro the ones who really know what
- 4:00Speaker 1: they're doing exactly.
- 4:02Speaker 2: And they're constantly evolving. Defending against them takes a multi
- 4:05Speaker 2: layered approach, strong authentication, intrusion detection systems, security audits, you
- 4:11Speaker 2: name it. It's a constant battle.
- 4:13Speaker 1: Sounds like we need to stay agile to stay ahead.
- 4:17Speaker 1: The book also mentions activists, how are they different activists.
- 4:21Speaker 2: Are groups sometimes individuals, driven by a cause or an ideology.
- 4:26Speaker 2: They might target organizations or governments they don't agree with,
- 4:29Speaker 2: to facing websites, leaking information, disrupting operations, that kind of thing.
- 4:34Speaker 1: Hacking with a purpose. Their motives seem unpredictable, which makes
- 4:37Speaker 1: them harder to anticipate.
- 4:39Speaker 2: Yeah, their motivations can make them tough to defend against.
- 4:42Speaker 2: They might not care about financial loss or legal consequences.
- 4:46Speaker 2: To mitigate this risk, you really need to understand their
- 4:49Speaker 2: ideology who they might target.
- 4:51Speaker 1: So we've got curious kids, criminals after money, and activists
- 4:54Speaker 1: with an agenda. Is there anyone else lurking around that
- 4:57Speaker 1: we need to worry about?
- 4:59Speaker 2: Unfortunately? Yeah, yes, state sponsored attackers. These groups have backing
- 5:04Speaker 2: from governments, and they often have significant resources and very
- 5:08Speaker 2: advanced techniques. They might go after critical infrastructure, steal intellectual property,
- 5:13Speaker 2: or conduct espionage.
- 5:15Speaker 1: Wow, the heavy hitters of the cyber world.
- 5:18Speaker 2: That's right. Defending against these guys takes proactive threat intelligence
- 5:22Speaker 2: and advanced security measures. You've got to be one step ahead.
- 5:25Speaker 1: Constantly monitoring the threat landscape, trying to anticipate their moves.
- 5:30Speaker 1: Any other threats we need to consider don't forget.
- 5:32Speaker 2: About insider threats. These can be current employees or even
- 5:35Speaker 2: former employees, contractors, partners, anyone with legitimate access to your systems,
- 5:40Speaker 2: but they misuse that access, either intentionally or unintentionally, like
- 5:45Speaker 2: stealing data or accidentally leaking information.
- 5:48Speaker 1: The wolf in sheep's clothing exactly.
- 5:50Speaker 2: They often have a deep understanding of your systems in security,
- 5:53Speaker 2: which makes them especially dangerous.
- 5:55Speaker 1: This threat landscape is pretty intense. So where do we
- 5:57Speaker 1: even begin to assess all these risks and feel a
- 6:00Speaker 1: little overwhelmed.
- 6:01Speaker 2: That's where a risk assessment comes in. It's a systematic
- 6:04Speaker 2: way to identify potential threats, figure out how likely they
- 6:07Speaker 2: are to happen and what their impact could be, and
- 6:10Speaker 2: then come up with the right mitigation strategies.
- 6:12Speaker 1: Okay, so we're bringing some order to the chaos, prioritizing
- 6:15Speaker 1: our efforts based on a clear understanding of the risks.
- 6:19Speaker 2: Right. The book suggests using a risk assessment table. It's
- 6:22Speaker 2: simple but effective. You list your assets, the threats they face,
- 6:26Speaker 2: the likelihood of those threats actually happening, their impact, and
- 6:30Speaker 2: what you can do to mitigate them.
- 6:31Speaker 1: Can you give me a simplified example just to see
- 6:33Speaker 1: this in action.
- 6:34Speaker 2: Sure. Let's say one of your assets is accounts. One
- 6:37Speaker 2: potential threat would be account hijacking, where someone gains unauthorized
- 6:41Speaker 2: access to your cloud provider account. Now, thinking about how
- 6:45Speaker 2: advanced cyber attacks are these days, we could say the
- 6:48Speaker 2: likelihood of this happening is probable.
- 6:50Speaker 1: And the impact if we've got strong security measures in
- 6:53Speaker 1: place for our accounts, the impact could be minor.
- 6:56Speaker 2: Right, But without those measures, the impact could be catastrophic.
- 7:00Speaker 2: Imagine losing control of your entire cloud setup.
- 7:02Speaker 1: I definitely don't want to think about that. So how
- 7:04Speaker 1: do we mitigate that risk?
- 7:05Speaker 2: The most effective mitigation would be multi factor authentication MFA.
- 7:10Speaker 2: It adds an extra layer of security, making a lot
- 7:12Speaker 2: harder for attackers to get in, even if they do
- 7:14Speaker 2: manage to get your password.
- 7:15Speaker 1: Right, MFA the security superhero.
- 7:18Speaker 2: You got it? And you do this same process for
- 7:21Speaker 2: each asset and each potential threat, building a complete picture
- 7:24Speaker 2: of your risks. This lets you prioritize your security efforts effectively.
- 7:28Speaker 1: Okay, I like how organized and visual that is. Now.
- 7:31Speaker 1: The book also mentions a risk matrix. What is that
- 7:35Speaker 1: exactly and how is it different from the risk assessment table?
- 7:38Speaker 2: A risk matrix combines how likely a threat is to
- 7:41Speaker 2: occur with its impact, and that gives you an overall
- 7:43Speaker 2: risk level. So something that's unlikely but would be devastating
- 7:47Speaker 2: if it did happen might still need your attention.
- 7:49Speaker 1: So not just looking at the probability, but also the
- 7:52Speaker 1: potential fallout. It's a more holistic approach.
- 7:55Speaker 2: You got it. It's a powerful tool for making informed
- 7:58Speaker 2: security decisions, helping prioritize your efforts based on a combination
- 8:02Speaker 2: of factors. Okay, we've mapped out our application, We've identified
- 8:06Speaker 2: the bad guys, we've assessed the risks. Where do we
- 8:09Speaker 2: go from here on our serverlest security journey?
- 8:12Speaker 1: Now it's time to dive into the code itself and
- 8:14Speaker 1: secure the very heart of your serverless application.
- 8:17Speaker 2: This is where it gets interesting. I know code is
- 8:19Speaker 2: often where vulnerabilities hide. What's the first thing we need
- 8:23Speaker 2: to think about when it comes to securing.
- 8:24Speaker 1: Our code choosing the right run time engine and its version.
- 8:28Speaker 1: That's the environment where your functions run. For instance, with
- 8:32Speaker 1: AWS Lambda you have options like no JS, Python, Java,
- 8:36Speaker 1: and so on.
- 8:37Speaker 2: Wait, so the choice of environment affects security. I hadn't
- 8:39Speaker 2: thought about that.
- 8:40Speaker 1: Oh, it definitely does. Different runtime engines have different security profiles.
- 8:44Speaker 1: Some are more mature with fewer known vulnerabilities, while others
- 8:47Speaker 1: are newer and might still be a bit rough around
- 8:50Speaker 1: the edges.
- 8:50Speaker 2: So how do we pick the right one? From a security.
- 8:53Speaker 1: Perspective, do your research? Websites like cve details keep track
- 8:57Speaker 1: of common vulnerabilities and exposures known as cvees. You can
- 9:00Speaker 1: search for a specific runtime engine and version and see
- 9:03Speaker 1: its track record how many vulnerabilities have been reported, so
- 9:06Speaker 1: it's like a security report card for different runtime engines.
- 9:10Speaker 2: You could say that the book has a great suggestion
- 9:13Speaker 2: use a bar chart to compare the number of cvees
- 9:16Speaker 2: across different versions. This way you can quickly see which
- 9:19Speaker 2: versions have a better security history.
- 9:21Speaker 1: Okay, we've chosen our run time one with a clean
- 9:24Speaker 1: bill of health, or as clean as we can find.
- 9:27Speaker 1: What's next on our code security checklist?
- 9:29Speaker 2: Now we dive into the sometimes complicated world of the
- 9:33Speaker 2: dependency tree A. This is where things can get a
- 9:36Speaker 2: little messed.
- 9:36Speaker 1: Okay, you've got my attention. Tell me more about this
- 9:39Speaker 1: dependency tree and why it's so important.
- 9:41Speaker 2: Serverless apps, just like most software today, rely on external
- 9:45Speaker 2: libraries and packages. These are pre built code modules that
- 9:48Speaker 2: handle specific tasks, but these dependencies often have their own dependencies,
- 9:52Speaker 2: creating a complex web of connections.
- 9:55Speaker 1: Sounds like a tangled web, it can be.
- 9:57Speaker 2: And the problem is vulnerabilities can be hidden deep within
- 9:59Speaker 2: this tree of vulnerability and a seemingly small dependency can
- 10:03Speaker 2: impact your entire application.
- 10:05Speaker 1: Yikes, that's a little scary. So how do we untangle
- 10:08Speaker 1: this mess and find those vulnerabilities before they cause trouble?
- 10:11Speaker 2: Dependency tree tools are your friends. They can help you
- 10:14Speaker 2: visualize and understand the relationships between your applications dependencies.
- 10:18Speaker 1: So we can see the whole ecosystem and its potential
- 10:21Speaker 1: weak points exactly well.
- 10:23Speaker 2: For example, if you're working with NOJS, there's a tool
- 10:26Speaker 2: called an vodka that creates a visual map of your
- 10:29Speaker 2: dependency tree. Once you have that map, you can assess
- 10:32Speaker 2: each package's security individually.
- 10:34Speaker 1: So it's not just about picking a package that does
- 10:37Speaker 1: the job, but also making sure it's secure absolutely.
- 10:40Speaker 2: Look for packages that are well maintained, have a solid
- 10:42Speaker 2: security track record, and ideally are actively supported by a
- 10:46Speaker 2: large community.
- 10:47Speaker 1: So looking for packages that are not just functional, but
- 10:49Speaker 1: also have a good reputation for security.
- 10:52Speaker 2: Right and remember, security is an ongoing effort. You need
- 10:55Speaker 2: to keep your dependencies up to date and watch out
- 10:57Speaker 2: for new vulnerabilities. Things are all always changing.
- 11:01Speaker 1: Got it? Okay, so we've picked a secure run time
- 11:04Speaker 1: engine and we've vetted our dependencies. What else can we
- 11:08Speaker 1: do to secure our code?
- 11:09Speaker 2: Static code analysis is a must. It's where you use
- 11:12Speaker 2: tools to scan your code for potential security flaws without
- 11:15Speaker 2: actually running it.
- 11:17Speaker 1: So like a spell checker for code catching mistakes that
- 11:19Speaker 1: could lead to problems.
- 11:21Speaker 2: That's a good way to think about it. These tools
- 11:23Speaker 2: can find things like buffer overflows, SEQL injection vulnerabilities, cross
- 11:28Speaker 2: site scripting issues, and so on. There are tons of
- 11:31Speaker 2: tools out there, some free, some paid. Pick one that
- 11:35Speaker 2: works for you and make it part of your development process.
- 11:38Speaker 1: Got it? Static code analysis? Check what's next?
- 11:41Speaker 2: Unit tests and regression tests. Don't underestimate their importance.
- 11:44Speaker 1: Testing testing, I know it's important, but why is it
- 11:48Speaker 1: so crucial for security?
- 11:49Speaker 2: Unit tests verify that individual parts of your code work
- 11:52Speaker 2: as expected. But you can also use them to simulate attacks.
- 11:57Speaker 1: Hold on, we can attack our own code? Sounds a
- 11:59Speaker 1: little strange.
- 12:00Speaker 2: You can, and you should. By simulating attacks like SEQL
- 12:04Speaker 2: injection or cross eight scripting, you can see how your
- 12:07Speaker 2: code handles it and make sure it can withstand those attacks.
- 12:10Speaker 1: So finding the weaknesses in our defenses before the attackers do.
- 12:13Speaker 2: Exactly, and regression tests make sure that any changes you
- 12:16Speaker 2: make to your code don't accidentally introduce new security flaws.
- 12:19Speaker 1: Right, making sure that fixing one thing doesn't break something
- 12:22Speaker 1: else and open up a new vulnerability.
- 12:24Speaker 2: You got it. By automating these tests, you're creating a
- 12:27Speaker 2: safety net that catches security issues early in the development process.
- 12:31Speaker 1: Okay, that makes sense. We've analyzed the code, We've tested
- 12:34Speaker 1: it thoroughly. Anything else we need to consider when it
- 12:37Speaker 1: comes to the code itself.
- 12:38Speaker 2: Input validation is a big one. Serveralist functions are often
- 12:41Speaker 2: triggered by different events, like an HTDP request or a
- 12:45Speaker 2: file upload. You need to validate that the data coming
- 12:48Speaker 2: in is what you're expecting.
- 12:49Speaker 1: So don't just trust the data blindly.
- 12:51Speaker 2: Right. Attackers can try to sneak malicious code in through
- 12:54Speaker 2: those inputs. They might try to inject SQL into a
- 12:57Speaker 2: database query or upload a file with a hidden and payload.
- 13:00Speaker 1: Okay, I can see how that could be a problem.
- 13:02Speaker 1: How do we validate these inputs and keep the bad
- 13:04Speaker 1: stuff out?
- 13:05Speaker 2: It depends on where the data is coming from. If
- 13:07Speaker 2: it's an HTTP request, you can validate the body content,
- 13:10Speaker 2: check for required fields, and make sure the data types
- 13:13Speaker 2: match what you expect. For example, if you're expecting a number,
- 13:17Speaker 2: verify that it is a number, not some text that
- 13:19Speaker 2: could contain harmful code.
- 13:21Speaker 1: So being cautious and double checking everything we receive exactly.
- 13:25Speaker 2: And the book has some really clear code examples for
- 13:28Speaker 2: different event sources like HTDP requests and S three that
- 13:32Speaker 2: show how to do input validation the right way.
- 13:34Speaker 1: Okay, input validation check. We've covered a lot choosing the
- 13:38Speaker 1: right run time, assessing dependencies, static code analysis, testing, and
- 13:42Speaker 1: input validation. It feels like we've built a pretty solid
- 13:45Speaker 1: foundation for secure code.
- 13:47Speaker 2: What's next Now, let's zom out from the code itself
- 13:50Speaker 2: and look at the broader serverless environment. We need to
- 13:53Speaker 2: talk about how to restrict permissions across your infrastructure.
- 13:56Speaker 1: Okay, I'm ready to start locking things down. The book
- 13:59Speaker 1: talks about least privilege. What does that mean for serverless?
- 14:03Speaker 2: Least privilege means giving your users and services only the
- 14:06Speaker 2: permissions they absolutely need, like giving someone the key to
- 14:09Speaker 2: a specific room instead of a master key to the
- 14:12Speaker 2: entire building.
- 14:13Speaker 1: So compartmentalizing access, limiting the damage if something goes wrong exactly.
- 14:18Speaker 2: In serverleists, this means carefully setting permissions for your functions,
- 14:21Speaker 2: data stores, and other resources, give each component just enough
- 14:25Speaker 2: access to do its job, nothing more.
- 14:27Speaker 1: Okay, that makes sense in theory, but how do we
- 14:29Speaker 1: actually do this? It seems like it could get pretty complicated.
- 14:32Speaker 2: It can be, but the good news is that cloud
- 14:35Speaker 2: providers like AWS, Azure, and Google Cloud offer very fine
- 14:40Speaker 2: grained permission controls. Let's start with AWS. They use a
- 14:44Speaker 2: system of users, groups, roles, and policies.
- 14:47Speaker 1: Okay, break that down for me. I know about users
- 14:50Speaker 1: in groups, but what are roles in policies.
- 14:52Speaker 2: Users are individual accounts like the ones your developers and
- 14:55Speaker 2: admins use. Groups are collections of users who need similar permissions.
- 15:00Speaker 2: Roles are sets of permissions that you can assign to users, groups,
- 15:03Speaker 2: or even AWS services themselves.
- 15:05Speaker 1: So roles are like templates for permissions, predefined sets that
- 15:08Speaker 1: we can apply to different entities exactly.
- 15:11Speaker 2: And policies are the rules that define what's allowed and
- 15:13Speaker 2: what's not. They're written in JSON, which could be a
- 15:17Speaker 2: bit intimidating at first, but it's actually quite logical once
- 15:19Speaker 2: you get used to it.
- 15:20Speaker 1: Okay, I'm willing to give it a try. So how
- 15:22Speaker 1: do we use all of this to put the principle
- 15:24Speaker 1: of least privilege into practice.
- 15:26Speaker 2: Let's say you have a Lambda function that needs to
- 15:28Speaker 2: read data from a Dynamo dB table. You'd create a
- 15:32Speaker 2: role just for that function, give it read access to
- 15:34Speaker 2: only that specific Dynamo dB table, and deny access to
- 15:38Speaker 2: everything else.
- 15:39Speaker 1: So very specific, limited permissions tailored to that function's exact
- 15:44Speaker 1: needs precisely.
- 15:45Speaker 2: The book has a really clear example of how to
- 15:47Speaker 2: create a policy for this scenario. It even shows you
- 15:51Speaker 2: the JSON code and explains how to apply it to
- 15:53Speaker 2: your Lambda function.
- 15:54Speaker 1: That's helpful. What about Azure is their system similar.
- 15:57Speaker 2: Azure also uses users, groups, and roles, but their permission
- 16:01Speaker 2: documents are called role definitions. These role definitions outline what
- 16:05Speaker 2: a user or group can do with a specific resource.
- 16:08Speaker 1: Okay, so the principles are the same, just slightly different terminology.
- 16:11Speaker 2: Right, And Azure also has managed identities for services. This
- 16:15Speaker 2: means you don't have to directly manage credentials for your services.
- 16:18Speaker 2: Azure takes care of that behind the scenes.
- 16:20Speaker 1: That sounds like it could make things a lot easier.
- 16:22Speaker 2: It Can and Google Cloud well, they have their own
- 16:25Speaker 2: flavor of permission management called cloud iam. It's based on roles, members, policies,
- 16:31Speaker 2: and scopes.
- 16:31Speaker 1: Okay, so each provider has its own way of doing things,
- 16:35Speaker 1: but the core idea of least privilege is the same.
- 16:38Speaker 2: Absolutely and regardless of the platform. It's super important to
- 16:42Speaker 2: review and update your permissions regularly.
- 16:45Speaker 1: Why is that so important? I get setting things up
- 16:47Speaker 1: correctly initially, but why revisit them later?
- 16:51Speaker 2: Because things change, your application grows, you add new features,
- 16:55Speaker 2: team members come and go. You need to make sure
- 16:57Speaker 2: your permissions are always up to date and that nobody
- 17:00Speaker 2: has access they don't need anymore.
- 17:01Speaker 1: So permissions are not a one time thing. They need
- 17:04Speaker 1: ongoing attention exactly.
- 17:06Speaker 2: It's an essential part of keeping your serverlist environment secure.
- 17:09Speaker 1: Got it? Okay, so we've tackled rescripting permissions. What's next
- 17:13Speaker 1: on our server list security checklist?
- 17:15Speaker 2: Let's move on to account management. Your first line of
- 17:18Speaker 2: defense makes sense.
- 17:19Speaker 1: Secure the foundation before building on top of it.
- 17:22Speaker 2: Right, every cloud provider has a master account, which is
- 17:26Speaker 2: like having the keys to the kingdom. If that account
- 17:28Speaker 2: is compromised, an attacker can do a lot of damage.
- 17:31Speaker 1: Okay, that's not good. How do we protect this master
- 17:34Speaker 1: account and make sure those keys don't fall into the
- 17:36Speaker 1: wrong hands.
- 17:37Speaker 2: The book has some really good tips. First, don't use
- 17:40Speaker 2: a personal email address for the master account. Use a
- 17:43Speaker 2: dedicated service or group email address instead.
- 17:46Speaker 1: That way, if someone leaves, we don't lose access.
- 17:48Speaker 2: Right. Next, make sure you provide detailed contact information for
- 17:53Speaker 2: the account. This helps the provider reach you quickly if
- 17:56Speaker 2: there's any suspicious activity.
- 17:57Speaker 1: Okay, be reachable just in case something happened.
- 18:00Speaker 2: Right, And obviously, use a strong password for the master account.
- 18:03Speaker 2: That means long, complex, unique, not use anywhere else.
- 18:07Speaker 1: No password one, two three for the master account.
- 18:10Speaker 2: Definitely not and super important. Enable multi factor authentication.
- 18:14Speaker 1: We've talked about MFA a lot. It's like the gold
- 18:16Speaker 1: standard of security, right.
- 18:17Speaker 2: It's pretty close. Yeah. MFA makes it a lot harder
- 18:19Speaker 2: for attackers to gain access even if they get hold
- 18:21Speaker 2: of your password, because they need that second factor.
- 18:24Speaker 1: Okay, MFA. Check any other best practices for securing the
- 18:28Speaker 1: master account.
- 18:28Speaker 2: Yeah. Make it a habit to review and update your
- 18:31Speaker 2: security settings regularly. Don't get lazy and assume everything is fine.
- 18:35Speaker 2: Stay on top of it.
- 18:36Speaker 1: Proactive security hygiene.
- 18:38Speaker 2: Exactly security is a journey, not a destination.
- 18:41Speaker 1: I'm getting that message loud and clear. So we've locked
- 18:45Speaker 1: down the master account. Anything else to consider when it
- 18:49Speaker 1: comes to account management.
- 18:50Speaker 2: Here's a pro tip. Use separate accounts for different environments
- 18:55Speaker 2: like development, testing, and production.
- 18:57Speaker 1: What's the advantage of doing that?
- 18:59Speaker 2: It limits the damage. If one environment is compromised, it
- 19:02Speaker 2: won't necessarily affect the others, like having firewalls between different
- 19:06Speaker 2: sections of a building.
- 19:07Speaker 1: So it's about isolating and containing any potential breaches exactly.
- 19:12Speaker 2: And it can also help you manage permissions more effectively.
- 19:15Speaker 1: Okay, separate accounts for different environmentst it. We've talked about
- 19:18Speaker 1: account management. What's next in our serverlest security strategy.
- 19:21Speaker 2: Let's talk about protecting secrets. This is where we get
- 19:25Speaker 2: into safeguarding sensitive information.
- 19:27Speaker 1: Okay, let's dive into the world of secrets. Why is
- 19:30Speaker 1: protecting secrets so crucial in the serverless world.
- 19:33Speaker 2: Secrets are like the crown jewels of your app, things
- 19:36Speaker 2: like API keys, database credentials, encryption keys. If these are compromised,
- 19:41Speaker 2: it could mean serious trouble. Attackers could get access to
- 19:44Speaker 2: sensitive data, compromise your systems absolutely, and the first rule
- 19:55Speaker 2: of secret protection is never hard code secrets directly into
- 19:59Speaker 2: your code.
- 20:00Speaker 1: Why is that so bad? It seems like the easiest
- 20:02Speaker 1: way to do things.
- 20:03Speaker 2: If your code has ever compromised, those hard coded secrets
- 20:06Speaker 2: are out in the open for anyone to see. Plus,
- 20:09Speaker 2: it makes it much harder to rotate secrets, which is
- 20:11Speaker 2: a security best practice.
- 20:12Speaker 1: Okay, so no hard coding secrets, got it? What are
- 20:16Speaker 1: the alternatives? How do we manage these secrets securely?
- 20:19Speaker 2: Cloud providers offer secure secret management services? For example, AWS
- 20:24Speaker 2: has Systems Manager Parameter Store or SSM and Key Management
- 20:28Speaker 2: Service KMS.
- 20:29Speaker 1: Okay, those are some mouthful acronyms. Tell me more about
- 20:31Speaker 1: how they work and how they can help us keep
- 20:32Speaker 1: our secrets safe.
- 20:33Speaker 2: Think of SSM as a secure vault. You can store
- 20:36Speaker 2: secrets there either as plain text or encrypted values, and
- 20:40Speaker 2: you control access using those im policies we talked about earlier. So,
- 20:44Speaker 2: for example, let's say you have an apikey that your
- 20:46Speaker 2: function needs. Instead of hard coding it, you store it
- 20:49Speaker 2: an SSM and retrieve it when your function runs.
- 20:52Speaker 1: So the secret stays outside the code, making it much
- 20:54Speaker 1: harder for attackers to get to it.
- 20:56Speaker 2: Exactly, and CAMTS adds another layer of protection. You can
- 20:59Speaker 2: use it to encrypt and decrypt those secrets, and even
- 21:02Speaker 2: use it with SSM to encrypt the secrets you.
- 21:04Speaker 1: Store there double the protection. What about other cloud providers
- 21:08Speaker 1: do they have similar services?
- 21:10Speaker 2: They do. Azure has key vault and Google Cloud has
- 21:12Speaker 2: Secret Manager. They both offer similar features for securely storing
- 21:16Speaker 2: and managing secrets.
- 21:18Speaker 1: Okay, so regardless of which platform we're using, there are
- 21:20Speaker 1: secure ways to handle those secrets. But how do we
- 21:23Speaker 1: choose the right approach? There are a few options.
- 21:26Speaker 2: It depends on your needs and how sensive your secrets are.
- 21:29Speaker 2: For example, if you need to change your secrets often,
- 21:32Speaker 2: SSM might be a good choice. If you're working with
- 21:35Speaker 2: really sensitive data, encrypting your secrets with KMS might be
- 21:39Speaker 2: the best approach.
- 21:40Speaker 1: So it's about figuring out the risks and picking the
- 21:43Speaker 1: best tool for the job.
- 21:44Speaker 2: You got it, And just like with permissions, secret management
- 21:48Speaker 2: is an ongoing thing. Check your secrets regularly, rotate them
- 21:51Speaker 2: when needed, and make sure only those who absolutely need
- 21:54Speaker 2: access can get to them.
- 21:56Speaker 1: Got it, So secure the code, lock down the secrets.
- 22:00Speaker 1: What's the next step in building our serverless security? Fortress?
- 22:03Speaker 2: Authentication and authorization? The gatekeepers of your application.
- 22:07Speaker 1: Okay, bring on the gatekeepers. Can you remind me what
- 22:09Speaker 1: the difference is between authentication and authorization? I always get
- 22:12Speaker 1: those mixed up.
- 22:13Speaker 2: Of course, authentication is proving who you are, like showing
- 22:15Speaker 2: your idea. Authorization is about what you're allowed to do
- 22:18Speaker 2: once you're in, like having different levels of access into building.
- 22:21Speaker 1: Okay, So authentication confirms your identity and authorization determines your
- 22:25Speaker 1: access privileges.
- 22:27Speaker 2: Exactly, and in serverless there are a few different ways
- 22:30Speaker 2: to handle authentication.
- 22:32Speaker 1: Let's talk about those. The book mentions the classic username
- 22:36Speaker 1: and password approach. How does that work with serverless?
- 22:39Speaker 2: The basics are the same as with traditional applications. The
- 22:42Speaker 2: user enters their credentials and the system checks them against
- 22:45Speaker 2: a database of valid users. But there are some important
- 22:49Speaker 2: security things could consider. You need to make sure those
- 22:52Speaker 2: passwords are hashed securely and stored safely, ideally using a
- 22:56Speaker 2: strong algorithm and something called salting.
- 22:58Speaker 1: So even if the database is compromised, the passwords themselves
- 23:01Speaker 1: are protected.
- 23:02Speaker 2: Right. It's also good to have things like rate limiting
- 23:05Speaker 2: and account lockout to prevent brute force attacks.
- 23:08Speaker 1: So we're limiting how many times someone can try to
- 23:10Speaker 1: log in and making it harder to guess passwords exactly.
- 23:13Speaker 2: But the username and password approach has some limitations, especially
- 23:17Speaker 2: these days. Oh it can be a pain for users,
- 23:20Speaker 2: especially on mobile, and it's not ideal for communication between machines,
- 23:24Speaker 2: which happens a lot and serverless.
- 23:25Speaker 1: Okay, so what are the alternatives when username and password
- 23:29Speaker 1: isn't the best choice.
- 23:30Speaker 2: Apikeys are often used for machine to machine communication. They're
- 23:34Speaker 2: basically long unique passwords that identify as specific application or service.
- 23:39Speaker 1: So machines can authenticate themselves without a human typing and
- 23:42Speaker 1: a password.
- 23:43Speaker 2: Right. But API keys can be risky if they're not
- 23:46Speaker 2: handled properly. Static keys, the ones that never change, are
- 23:50Speaker 2: particularly vulnerable. If an attacker gets a static key, they
- 23:54Speaker 2: basically have access forever.
- 23:56Speaker 1: That sounds like a nightmare. So how do we avoid that?
- 24:00Speaker 2: Rotate your apikeys regularly and store them securely. Those secret
- 24:04Speaker 2: management services we talked about earlier could be really helpful
- 24:07Speaker 2: for this.
- 24:08Speaker 1: Okay. Apikes are good for machine communication, but we need
- 24:11Speaker 1: to protect them just like any other sensitive information. What
- 24:14Speaker 1: other options are there for authentication?
- 24:16Speaker 2: Jason Web tokens or JWTs are a great tool for authorization.
- 24:21Speaker 1: I've heard of those. They're like digital passports.
- 24:23Speaker 2: Right, that's a good analogy.
- 24:24Speaker 1: Yeah.
- 24:25Speaker 2: JWT is a digitally signed token that contains info about
- 24:28Speaker 2: a user, like their ID and.
- 24:29Speaker 1: Permissions and what makes them secure.
- 24:31Speaker 2: They're digitally signed. This makes sure nobody has tampered with
- 24:34Speaker 2: the information in the token.
- 24:36Speaker 1: Okay, like a tamper proof seal of authenticity. How do
- 24:39Speaker 1: they actually work?
- 24:41Speaker 2: When a user logs in successfully, maybe using a username
- 24:44Speaker 2: and password, the system gives them a JWT. They can
- 24:48Speaker 2: then use this token to access protected resources, so.
- 24:51Speaker 1: It's proof of identity and access privileges all in one exactly.
- 24:56Speaker 2: And JWTs can be used with different authentication methods like
- 24:59Speaker 2: using impact this word, API keys and even social logins.
- 25:03Speaker 1: The prety flexible they are, and.
- 25:04Speaker 2: They're becoming more and more popular in the serverless world.
- 25:07Speaker 1: Okay, JWT's got it. What else is out there? We've
- 25:09Speaker 1: covered quite a few methods already both.
- 25:11Speaker 2: Two point zero is a really common standard for what's
- 25:14Speaker 2: called delegated authorization.
- 25:15Speaker 1: Delegated authorization that sounds complicated. Can you explain it simply?
- 25:20Speaker 2: It's not as complex as it sounds. Imagine you want
- 25:22Speaker 2: to use your Google account to log into another app.
- 25:25Speaker 2: You don't have to give that app your Google password. Instead,
- 25:28Speaker 2: Google gives them a token that lets them access your account,
- 25:32Speaker 2: but only to the extent that you've approved.
- 25:34Speaker 1: So you're giving the app permission to act on your behalf,
- 25:37Speaker 1: but without sharing your actual password exactly.
- 25:40Speaker 2: O WOOF is perfect for things like social logins or
- 25:43Speaker 2: connecting to third party services.
- 25:45Speaker 1: Okay, I'm starting to see how all these pieces fit together.
- 25:48Speaker 1: Anything else to keep in mind about OATH.
- 25:50Speaker 2: It's important that those tokens expire. You don't want an
- 25:53Speaker 2: app to have permit access to your account.
- 25:55Speaker 1: Right That would defeat the purpose exactly.
- 25:58Speaker 2: And always double check what permissions giving an app before
- 26:00Speaker 2: you allow access. Don't just click allow without thinking.
- 26:05Speaker 1: So be aware and careful about what we're authorizing. What
- 26:09Speaker 1: other authentication methods are out there?
- 26:11Speaker 2: Open Idconnect or ODC is built on top of o
- 26:15Speaker 2: OOTH two point zero and adds another authentication layer.
- 26:18Speaker 1: Okay, so what's different about OIDC? What does it add?
- 26:21Speaker 2: It gives you a standardized way to check a user's
- 26:23Speaker 2: identity and get basic profile information. It's like a more
- 26:26Speaker 2: robust version of OTH often used for a single sign on,
- 26:29Speaker 2: where you use one set of credentials to access multiple apps.
- 26:32Speaker 1: That sounds convenient and potentially more secure.
- 26:36Speaker 2: It can be, but it's important to pick a trustworthy
- 26:38Speaker 2: identity provider and make sure those access tokens have an expiration.
- 26:41Speaker 1: Date so the same precautions apply. Choose wisely and limit
- 26:45Speaker 1: those token life spans. What else?
- 26:47Speaker 2: Finally, there's SAML, which stands for Security Assertion Markup Language.
- 26:52Speaker 2: It's a standard for exchanging authentication and authorization data between
- 26:56Speaker 2: different systems using XML.
- 26:58Speaker 1: Another acronym for the list. What's SAML all about.
- 27:02Speaker 2: It's commonly used in enterprise environments for things like single
- 27:05Speaker 2: sign on and managing identities across different systems.
- 27:07Speaker 1: So a more enterprise focused approach. Got it. We've explored
- 27:12Speaker 1: a whole range of authentication and authorization methods, from the
- 27:15Speaker 1: simple username and password to the more advanced JWTs in oath.
- 27:19Speaker 1: How do we actually put all of this into practice
- 27:21Speaker 1: in our serverless apps?
- 27:22Speaker 2: It really depends on the platform you're using and what
- 27:24Speaker 2: your application needs.
- 27:26Speaker 1: Can you give me some platform specific examples?
- 27:28Speaker 2: Sure? For AWSAPI Gateway, you can use resource policies to
- 27:32Speaker 2: control who can access your APIs. You can create whitelists
- 27:35Speaker 2: that only allow specific AWS accounts, IP addresses or even vpcs.
- 27:40Speaker 1: So we can really lock down who's allowed to call
- 27:42Speaker 1: our APIs. What other options are there? In AWS?
- 27:45Speaker 2: You can also use AWS land authorizers for custom authentication
- 27:49Speaker 2: and authorization logic, so.
- 27:51Speaker 1: More flexibility for complex scenarios where the standard approaches aren't
- 27:54Speaker 1: enough exactly.
- 27:55Speaker 2: And AWS Cognito is a fully managed service that handles
- 27:59Speaker 2: user authentication and authorization. It works really well with other
- 28:03Speaker 2: AWS services and can take care of a lot of
- 28:06Speaker 2: the hard work for you.
- 28:07Speaker 1: Sounds like AWS gives you a lot of options for
- 28:09Speaker 1: managing authentication and authorization they do.
- 28:12Speaker 2: Now moving on to Azure, you can use app service
- 28:15Speaker 2: authentication to secure your function apps. You could choose from
- 28:18Speaker 2: different identity providers like az your active directory, Facebook, Google
- 28:23Speaker 2: and more.
- 28:24Speaker 1: So with Azure we have a lot of choices for
- 28:26Speaker 1: how users log in exactly.
- 28:28Speaker 2: And you can control the security even more by setting
- 28:30Speaker 2: different authorization levels for your functions. You can allow anyone
- 28:33Speaker 2: to access them or only admin users or anything in.
- 28:36Speaker 1: Between, so we can customize the security based on what
- 28:39Speaker 1: each function does.
- 28:40Speaker 2: Right, and Azure API Management gives you a central place
- 28:43Speaker 2: to control access to your APIs. You can do things
- 28:45Speaker 2: like rate limiting validating databts, blocking access by IP address,
- 28:50Speaker 2: all kinds of.
- 28:50Speaker 1: Stuff, like a security checkpoint for all of our APIs,
- 28:53Speaker 1: making sure only the right requests get through.
- 28:56Speaker 2: That's a great analogy. Lastly, let's look at Google Cloud.
- 29:00Speaker 2: They offer cloud endpoints to secure cloud functions. It acts
- 29:03Speaker 2: as a gateway sitting in front of your functions and
- 29:06Speaker 2: handles authentication, authorization, and a bunch of other API management features.
- 29:11Speaker 1: So another way to manage access to our serverlest functions.
- 29:14Speaker 1: Anything else? Google Cloud offers for authentication and authorization.
- 29:17Speaker 2: Yes, they have Identity Platform for user authentication and Firebase
- 29:21Speaker 2: which gives you even more flexibility with authentication and authorization.
- 29:25Speaker 1: Okay, so plenty of options across all the major cloud platforms.
- 29:29Speaker 1: It seems like we have the tools we.
- 29:30Speaker 2: Need we do. The trick is to choose the approach
- 29:33Speaker 2: that best fits your application and your security needs. There's
- 29:36Speaker 2: no one size fits all solution.
- 29:38Speaker 1: Okay, so far we've talked about securing the code, managing secrets,
- 29:42Speaker 1: and implementing authentication and authorization. What's the next step in
- 29:46Speaker 1: securing our serverlest applications?
- 29:49Speaker 2: Now we focus on the data itself, protecting that sensitive
- 29:52Speaker 2: information that attackers are often after data protection.
- 29:55Speaker 1: This is the heart of what we're trying to protect.
- 29:58Speaker 1: The book mentions the a lost top ten risks, including
- 30:02Speaker 1: sensitive data exposure. What exactly is that?
- 30:05Speaker 2: Sensitive data exposure is a really common and potentially really
- 30:09Speaker 2: damaging security risk. It's when sensitive information, things like personally
- 30:14Speaker 2: identifiable information PII, credit card numbers, or passwords, gets leaked,
- 30:18Speaker 2: either accidentally or intentionally.
- 30:20Speaker 1: It's like leaving the vault door wide open.
- 30:22Speaker 2: Good analogy. Yeah, and it can happen in lots of ways,
- 30:25Speaker 2: like insecure coding, misconfigured servers, or even lost or stolen devices.
- 30:30Speaker 1: A breach like that could be disastrous.
- 30:33Speaker 2: Data breaches can cost a company a lot of money,
- 30:35Speaker 2: damage their reputation, and even lead to legal problems.
- 30:38Speaker 1: So data protection is not something we can mess around with.
- 30:41Speaker 1: What are the key things we need to keep in
- 30:43Speaker 1: mind to protect sensitive data properly?
- 30:45Speaker 2: First, never just assume the default settings are secure enough.
- 30:49Speaker 2: Cloud providers have lots of services with default configurations that
- 30:52Speaker 2: might not be the most secure. Always take the time
- 30:55Speaker 2: to review and change those defaults to fit your security needs.
- 30:58Speaker 1: Okay, so don't just trust the defaults, take control and
- 31:02Speaker 1: customize the settings exactly.
- 31:04Speaker 2: Encryption is also critical. You want to encrypt sensitive data,
- 31:08Speaker 2: whether it's being stored or transmitted. That means encrypting data
- 31:11Speaker 2: in databases, object storage, log files, everything, and it means
- 31:16Speaker 2: using HTTPS for all communication.
- 31:19Speaker 1: So we need to protect the data both when it's
- 31:21Speaker 1: sitting there and when it's moving between systems.
- 31:23Speaker 2: Right. Another important principle is data lifetime. Don't keep sensitive
- 31:28Speaker 2: data longer than you need it.
- 31:29Speaker 1: It seems weird to delete data, especially in today's world.
- 31:32Speaker 1: Why is that so important.
- 31:33Speaker 2: Longer you keep data, the more chance there is of
- 31:35Speaker 2: it being exposed if you don't need it anymore. Get
- 31:38Speaker 2: rid of it, deleted or archive it securely. Less data, less.
- 31:42Speaker 1: Risk, out of sight, out of mind, and out of reach.
- 31:45Speaker 2: Of attackers exactly. Other things to think about include logging,
- 31:48Speaker 2: software updates, and security scanning.
- 31:50Speaker 1: So it's about using a variety of strategies and best
- 31:53Speaker 1: practices to make sure we're covering all our bases.
- 31:56Speaker 2: You got it. The book goes into detail about how
- 31:59Speaker 2: to secure a specific cloud services like AWSS three, Dynamo,
- 32:03Speaker 2: dB as, your blob storage, Cosmos, DV, and others. It
- 32:07Speaker 2: emphasizes things like changing the default settings, enabling encryption, and
- 32:11Speaker 2: managing access controls.
- 32:13Speaker 1: So we can't just know these principles generally, we need
- 32:15Speaker 1: to apply them to each specific service absolutely.
- 32:18Speaker 2: And remember this isn't a one time thing. You need
- 32:20Speaker 2: to stay on top of it, change your strategies as needed,
- 32:23Speaker 2: and always be evaluating how secure your systems are.
- 32:26Speaker 1: Okay, data protection, check what's next on our Serverleist's security
- 32:30Speaker 1: to do list.
- 32:30Speaker 2: Now we move on to monitoring, auditing, and alerting. These
- 32:33Speaker 2: are like the eyes, ears, and voice of your security system.
- 32:36Speaker 1: So these components help us stay aware of what's happening
- 32:39Speaker 1: and respond to issues quickly. Why are they so crucial
- 32:41Speaker 1: in a serverlest environment?
- 32:43Speaker 2: Serverless apps are constantly changing and they're often spread across
- 32:46Speaker 2: lots of different services. You need a way to keep
- 32:48Speaker 2: track of everything that's happening, spot potential threats in real time,
- 32:52Speaker 2: and react fast as.
- 32:53Speaker 1: Something goes wrong, like a central command center for security exactly.
- 32:58Speaker 2: First, let's talk about monitoring. What are the key things
- 33:01Speaker 2: we need to watch in serverlests?
- 33:03Speaker 1: You mentioned resource utilization before. What else should we be
- 33:06Speaker 1: paying attention to?
- 33:08Speaker 2: That's right, Resource utilization is important. Track how much CPU,
- 33:12Speaker 2: memory and storage your functions are using. This can help
- 33:15Speaker 2: you find performance issues that could become security problems.
- 33:18Speaker 1: So we can see if our systems are being overloaded,
- 33:21Speaker 1: which might make them vulnerable.
- 33:22Speaker 2: Right. Another important metric is function performance. Look at things
- 33:27Speaker 2: like execution time and latency. Make sure your functions are
- 33:30Speaker 2: running quickly and efficiently.
- 33:32Speaker 1: Okay, make sure everything is running smoothly anything else err rates.
- 33:37Speaker 2: You need to know how often your functions are failing
- 33:39Speaker 2: and why. That way you can fix problems and stop
- 33:43Speaker 2: them from happening again.
- 33:44Speaker 1: So troubleshooting and preventing those.
- 33:46Speaker 2: Errors right, and don't forget to monitor costs. Serverleists can
- 33:49Speaker 2: save you money, but it's also easy to spend more
- 33:51Speaker 2: than you planned if you're not careful.
- 33:53Speaker 1: So keep an eye on the budget and make sure
- 33:55Speaker 1: our servilist appointments stay affordable.
- 33:58Speaker 2: Absolutely. Each cloud provider has tools from monitoring all of
- 34:02Speaker 2: this stuff. Aws has Cloud watch as Azure Monitor, and
- 34:08Speaker 2: Google Cloud has Cloud Monitoring.
- 34:10Speaker 1: Great, so we have the tools to collect all this data,
- 34:12Speaker 1: but how do we make sense of it all? It
- 34:14Speaker 1: seems like it could get pretty overwhelming.
- 34:16Speaker 2: That's where dashboards and visualizations come in. They help you
- 34:19Speaker 2: see trends, spot unusual activity, and get a good overall
- 34:22Speaker 2: view of your system's.
- 34:23Speaker 1: Health, so we can see the big picture without getting
- 34:26Speaker 1: lost in all the little details exactly.
- 34:28Speaker 2: But remember monitoring is only the first step. You also
- 34:32Speaker 2: need to be able to audit your system and find
- 34:34Speaker 2: potential security problems that you might not see just from monitoring.
- 34:38Speaker 1: Okay, so what's involved in auditing.
- 34:40Speaker 2: Auditing is about keeping track of everything that's happening, things
- 34:43Speaker 2: like configuration changes, user activity, and other events that could
- 34:47Speaker 2: be relevant to security.
- 34:48Speaker 1: So it's like having a detailed log of all the
- 34:51Speaker 1: activity in our serverleist environment.
- 34:53Speaker 2: You got it. You need to know who made what changes,
- 34:55Speaker 2: when they made them, and what those changes were.
- 34:57Speaker 1: So we can spot suspicious behavior and track down the
- 35:00Speaker 1: source of problems exactly.
- 35:02Speaker 2: Cloud providers have specific tools for auditing too. AWS has
- 35:07Speaker 2: Cloud Trail, Azure has activity log, and Google Cloud has
- 35:11Speaker 2: cloud audit logs.
- 35:13Speaker 1: Okay, so now we have the tools to monitor and
- 35:16Speaker 1: audit our environment. But how do we know when something
- 35:20Speaker 1: goes wrong? How do we get alerted?
- 35:22Speaker 2: That's where alerting comes in. It's all about getting notified
- 35:25Speaker 2: when something needs your attention. It could be a lot
- 35:28Speaker 2: of errors happening, strained user activity, or someone changing in
- 35:32Speaker 2: important security setting.
- 35:34Speaker 1: So our early warning system letting us know when we
- 35:37Speaker 1: need to investigate and take action.
- 35:38Speaker 2: Right, you can set up alerts based on the things
- 35:41Speaker 2: you're monitoring and the events you're auditing.
- 35:42Speaker 1: Can you give me some examples of the kinds of
- 35:44Speaker 1: alerts we might want to set up?
- 35:45Speaker 2: Sure, you might want to get an alert if your
- 35:47Speaker 2: function has a high error rate, someone try to access
- 35:50Speaker 2: something they shouldn't, or if someone changes a key security.
- 35:53Speaker 1: Setting, so anything that could be a security risk or
- 35:55Speaker 1: a performance problem.
- 35:56Speaker 2: Right, And you can choose different ways to get those
- 35:58Speaker 2: alerts depending on how and it is. Email might be
- 36:01Speaker 2: fine for minor things, but you might want text messages
- 36:04Speaker 2: or even phone calls for serious problems.
- 36:06Speaker 1: So we can escalate alerts based on how serious they are.
- 36:09Speaker 2: Exactly. The goal of alerting isn't to overwhelm you with notifications,
- 36:13Speaker 2: but to give you useful information that helps you keep
- 36:16Speaker 2: your serverless environment secure and reliable.
- 36:19Speaker 1: Okay, so we've covered securing the code, restricting permissions, managing accounts,
- 36:23Speaker 1: protecting secrets, authentication and authorization, data protection, and setting up monitoring,
- 36:28Speaker 1: auditing and alerting. Is there anything else we should consider?
- 36:33Speaker 1: Anything we can do to make our serverless environments even
- 36:36Speaker 1: more secure?
- 36:37Speaker 2: There are a few more things that can make a
- 36:38Speaker 2: big difference in how secure your serverless setup is.
- 36:41Speaker 1: Okay, I'm all yours. What else can we do to
- 36:44Speaker 1: improve our security?
- 36:45Speaker 2: Let's start with continuous integration and continuous delivery or CICD.
- 36:50Speaker 1: I know about CICD, but isn't that more of a
- 36:52Speaker 1: developer thing. How does it relate to security?
- 36:55Speaker 2: You're right. CD is mostly used by developers, but it
- 36:58Speaker 2: can have a huge impact on secureecurity. It automates the
- 37:01Speaker 2: process of building, testing, and deploying code. If you add
- 37:04Speaker 2: security checks into your CICD pipeline, you can find vulnerabilities
- 37:08Speaker 2: early on before they ever go live.
- 37:10Speaker 1: So baking security right into the development process exactly.
- 37:14Speaker 2: You can automate things like static code analysis, checking for
- 37:17Speaker 2: vulnerable dependencies, and even security testing.
- 37:21Speaker 1: So all those security checks we talked about, we can
- 37:23Speaker 1: make them part of the development workflow automatically.
- 37:25Speaker 2: Right. That way, you're not relying on developers to remember
- 37:28Speaker 2: to do those checks. It's much more reliable and consistent.
- 37:31Speaker 1: That makes sense. What about source control? It's how we
- 37:35Speaker 1: manage our code, but how does it fit into the
- 37:37Speaker 1: security picture?
- 37:39Speaker 2: Source control is important for collaboration, but it can also
- 37:42Speaker 2: be a security risk if it's not secure.
- 37:44Speaker 1: I hadn't thought about that. What do we need to
- 37:46Speaker 1: do to secure our source control systems?
- 37:49Speaker 2: First? Limit access to your code repositories to authorized users
- 37:53Speaker 2: only strong passwords, MFA, least privilege, all the things we've
- 37:57Speaker 2: talked about.
- 37:58Speaker 1: Lock it down, make sure only the right people can.
- 38:00Speaker 2: See the code right and be careful what you commit
- 38:03Speaker 2: to source control. Don't put sensitive information in there like
- 38:06Speaker 2: apikeys or credentials. Use those secret management services instead, So.
- 38:11Speaker 1: Keep secrets out of the code base exactly.
- 38:14Speaker 2: It's also a good idea to double check your commit
- 38:17Speaker 2: history for anything that shouldn't be there. There are tools
- 38:20Speaker 2: like get secrets that can help you scan for sensitive information.
- 38:23Speaker 1: Think before you commit and make sure no secrets have slipped.
- 38:26Speaker 2: In you got it. Another thing to watch out for
- 38:29Speaker 2: is serveralist framework plugins. Plugins can add a lot of functionality,
- 38:33Speaker 2: but they can also create security risks if you're not careful.
- 38:37Speaker 1: It seems like anything new we add to our environment
- 38:39Speaker 1: could bring new security risks. Dependencies, plugins, features, everything.
- 38:44Speaker 2: That's a good point. You need to be aware of
- 38:46Speaker 2: the risks and take steps to mitigate them.
- 38:48Speaker 1: So how do we approach plugins from a security.
- 38:51Speaker 2: Perspective, if you can look at the plugins code before
- 38:55Speaker 2: you use it. A lot of them are open source,
- 38:57Speaker 2: so you can see exactly what they're doing. Look for
- 38:59Speaker 2: potential price problems, like the use of unsafe functions or
- 39:03Speaker 2: the possibility of code injection.
- 39:05Speaker 1: So we're doing a mini security audit of the plug
- 39:07Speaker 1: in itself.
- 39:08Speaker 2: Right. If you're not comfortable looking at code, make sure
- 39:10Speaker 2: you choose plugins from trusted sources and that they have
- 39:13Speaker 2: a good reputation. See what other developers are saying and
- 39:16Speaker 2: if anyone has reported security.
- 39:17Speaker 1: Issues, so do our research. Choose carefully, and don't just
- 39:21Speaker 1: install plugins without thinking.
- 39:23Speaker 2: Right, And like everything else we've talked about, be mindful
- 39:26Speaker 2: of the permissions you give those plugins. Lea's privilege applied
- 39:30Speaker 2: here too. Only give them access to what they absolutely need.
- 39:34Speaker 1: Treat plugins with the same caution as any other part
- 39:37Speaker 1: of our serverlest environment exactly.
- 39:40Speaker 2: Now, let's switch gears and talk about function optimization.
- 39:43Speaker 1: Function optimization, I thought we were focused on security. Isn't
- 39:47Speaker 1: that more about performance?
- 39:48Speaker 2: Not always? Optimizing your functions can make them more secure?
- 39:53Speaker 1: Really, I'm not sure I get it. How does making
- 39:55Speaker 1: our functions run faster make them more secure?
- 39:58Speaker 2: It reduces their attack surface.
- 39:59Speaker 1: Okay, what's an attack surface?
- 40:01Speaker 2: It's basically all the ways an attacker could interact with
- 40:03Speaker 2: your application and exploit vulnerabilities. When you optimize your functions,
- 40:08Speaker 2: you're cleaning up your code, getting rid of unnecessary dependencies,
- 40:11Speaker 2: and making them run faster. This makes it harder for
- 40:14Speaker 2: attackers to find and exploit weaknesses.
- 40:17Speaker 1: So a more efficient function is a more secure function exactly.
- 40:20Speaker 2: And there are a bunch of ways to optimize your functions,
- 40:23Speaker 2: like One way is to keep each function focused on
- 40:25Speaker 2: one specific task. Small focus functions are easier to understand, test,
- 40:30Speaker 2: and secure.
- 40:31Speaker 1: Break down big tasks into smaller, more manageable pieces.
- 40:35Speaker 2: Right. Also, make sure you're using the right amount of
- 40:37Speaker 2: resources for each function. Using too many resources can cost
- 40:41Speaker 2: you more money and make you a bigger target.
- 40:43Speaker 1: So right sizing those resources for efficiency and security.
- 40:47Speaker 2: You got it. You can also use packaging tools to
- 40:50Speaker 2: make your function deployment packages smaller. Smaller packages deploy faster
- 40:55Speaker 2: and give attackers less code to look at.
- 40:57Speaker 1: So function optimization makes our code faster, sure, more efficient,
- 41:01Speaker 1: and more secure precisely.
- 41:03Speaker 2: Now, let's talk about a really useful tool for proactive
- 41:05Speaker 2: security thinking. Fault trees fault trees.
- 41:08Speaker 1: That sounds a little intimidating.
- 41:10Speaker 2: They're not as complicated as they sound. A fault tree
- 41:12Speaker 2: is a diagram that shows you all the ways something
- 41:14Speaker 2: could go wrong and what might cause those problems.
- 41:17Speaker 1: So we're making a map of everything that could potentially
- 41:19Speaker 1: break exactly.
- 41:21Speaker 2: And by creating a fault tree, you can spot security
- 41:23Speaker 2: vulnerabilities before they happen and figure out how to stop them.
- 41:27Speaker 1: Can you give me an example of how we might
- 41:28Speaker 1: use this for serverless sure?
- 41:30Speaker 2: Imagine you have a function that uses a third party API.
- 41:34Speaker 2: What if that API stops working or start sending bad data.
- 41:39Speaker 2: If you think through those scenarios and draw them out
- 41:41Speaker 2: in a faull tree, you can come up with backup
- 41:43Speaker 2: plans like fallback mechanisms or data validation checks.
- 41:47Speaker 1: So we're planning for the worst and having a plan
- 41:49Speaker 1: be exactly.
- 41:50Speaker 2: Fall trees can help you analyze all kinds of security threats,
- 41:53Speaker 2: not just problems with APIs. You can use them to
- 41:56Speaker 2: look at insider threats, natural disasters, even simple coding mistakes.
- 42:01Speaker 1: Okay, so fault trees help us think like attackers, find
- 42:04Speaker 1: potential problems, and build more resilient systems.
- 42:06Speaker 2: You got it. That kind of proactive thinking is really
- 42:09Speaker 2: important for security.
- 42:11Speaker 1: This has been really eye opening. We've gone through a lot,
- 42:13Speaker 1: from the code itself to managing accounts and protecting those
- 42:16Speaker 1: super important secrets. We even talked about different ways to
- 42:19Speaker 1: handle authentication and authorization, how to keep data safe, and
- 42:23Speaker 1: the importance of monitoring, auditing and alerting. And then we
- 42:26Speaker 1: added on things like CICD source control plugins, optimizing those
- 42:30Speaker 1: functions and even those fault trees.
- 42:32Speaker 2: It's been a lot, that's for sure, But the main
- 42:34Speaker 2: point is serveralist security is never truly finished. You're always
- 42:38Speaker 2: working on it. But if you understand the basics of
- 42:41Speaker 2: follow the best practices we've talked about, you can build
- 42:44Speaker 2: secure and reliable applications that can stand up to those
- 42:47Speaker 2: ever evolving threats.
- 42:49Speaker 1: Okay, before we wrap up completely, let's just quickly go
- 42:51Speaker 1: over the main points again. We started by talking about
- 42:54Speaker 1: really understanding the application when we're trying to secure it's architecture,
- 42:58Speaker 1: it's code, and the threat it might face. Right.
- 43:01Speaker 2: We also learned how to figure out and assess those
- 43:03Speaker 2: risks using a risk assessment table and a risk matrix,
- 43:07Speaker 2: thinking about how likely each threat is and how bad
- 43:10Speaker 2: it would be if it happened.
- 43:11Speaker 1: Then we dug into the details of securing the code,
- 43:14Speaker 1: starting with picking a safe runtime engine and making sure
- 43:16Speaker 1: we're using the right version.
- 43:18Speaker 2: And we talked about carefully checking those dependencies, using static
- 43:22Speaker 2: code analysis to find common vulnerabilities, and doing thorough testing
- 43:26Speaker 2: to make sure our code is strong.
- 43:27Speaker 1: Input validation was a big one, making sure we don't
- 43:30Speaker 1: just assume the data we get as safe and taking
- 43:32Speaker 1: steps to block bad data absolutely.
- 43:35Speaker 2: We talked about restricting permissions using least privilege, making sure
- 43:39Speaker 2: users and services only have access to what they absolutely need.
- 43:43Speaker 2: We also talked about securing those master accounts, the ones
- 43:46Speaker 2: that control everything.
- 43:47Speaker 1: Protecting secrets was crucial, making sure things like API keys
- 43:51Speaker 1: and database credentials are never hard coded and are always
- 43:54Speaker 1: stored securely.
- 43:55Speaker 2: We also went through authentication and authorization, looking at the
- 43:58Speaker 2: different ways we can control who gets into our applications
- 44:02Speaker 2: and what they can do once they're in there.
- 44:04Speaker 1: Data protection was key too, remembering to encrypt sensitive data
- 44:07Speaker 1: whether it's stored or being transmitted, managing how long we
- 44:10Speaker 1: keep data, and never just trusting the default settings.
- 44:14Speaker 2: And finally we talked about monitoring, auditing, and alerting, setting
- 44:17Speaker 2: up those systems to watch our serverleist environment, detect threats
- 44:21Speaker 2: and let us know if something goes wrong.
- 44:22Speaker 1: Wow, that is a lot of stuff. I feel like
- 44:24Speaker 1: I know so much more about servileist security now me too.
- 44:27Speaker 2: And don't forget security isn't a one person job. It
- 44:30Speaker 2: takes a whole team developers, security experts, operations people.
- 44:34Speaker 1: Everyone working together keymwork makes the dream work. As they say. Okay,
- 44:39Speaker 1: before we finish up this episode, I wanted to touch
- 44:41Speaker 1: on the last part of the book, finalizing the risk assessment.
- 44:44Speaker 1: It seems like a good way to tie everything together.
- 44:46Speaker 2: It is. Yeah, it reminds us that risk assessment is
- 44:49Speaker 2: not something you do just once. It's a process you
- 44:52Speaker 2: need to keep revisiting as your application changes, new threats appear,
- 44:56Speaker 2: and your business needs evolve.
- 44:58Speaker 1: So staying fleck and adapting to the changing security landscape.
- 45:03Speaker 1: What are the main steps involved in finalizing a risk assessment?
- 45:08Speaker 2: First, you need to gather all the information you've collected
- 45:10Speaker 2: from all the different things we've talked about, reviewing documentation,
- 45:14Speaker 2: analyzing code, security scans, talking to people who know the
- 45:17Speaker 2: application and its risks.
- 45:19Speaker 1: So bringing together all the intelligence we've gathered exactly.
- 45:22Speaker 2: Then you need to score each finding based on how
- 45:25Speaker 2: serious it is and what could happen to your business
- 45:27Speaker 2: if it became a real.
- 45:28Speaker 1: Problem, prioritizing based on how bad things could get.
- 45:31Speaker 2: Right, But it's not just about how technically serious a
- 45:34Speaker 2: risk is. You also need to figure out the potential
- 45:36Speaker 2: impact on the business. What would happen if this risk
- 45:39Speaker 2: actually became a problem.
- 45:41Speaker 1: That makes sense, We need to translate those technical details
- 45:45Speaker 1: into real world consequences that business people can understand.
- 45:48Speaker 2: You got it. For example, you might say that a
- 45:52Speaker 2: specific vulnerability could lead to a data breach that would
- 45:55Speaker 2: cost the company millions of dollars in fines or lost business,
- 45:59Speaker 2: or it could really hurt the company's reputation and make
- 46:02Speaker 2: customers lose trust.
- 46:04Speaker 1: Okay, now we're talking their language. So we've collected our findings,
- 46:07Speaker 1: scored them, and assess their impact on the business. What's next?
- 46:11Speaker 2: Now it's time to make some decisions. You work with
- 46:13Speaker 2: everyone involved to decide which risks to address, which ones
- 46:17Speaker 2: you can live with, and how to use your resources
- 46:19Speaker 2: to deal with those risks effectively.
- 46:21Speaker 1: So it's about balancing different factors like severity, impact, what's practical,
- 46:26Speaker 1: and of course.
- 46:26Speaker 2: The budget right and you need to think about how
- 46:29Speaker 2: much it costs to fix a problem versus how much
- 46:32Speaker 2: it would cost if the problem actually happened. Sometimes it
- 46:35Speaker 2: might be better to accept a certain amount of risk
- 46:37Speaker 2: than to spent a ton of money trying to completely
- 46:39Speaker 2: eliminate it.
- 46:40Speaker 1: So weigh the options and make smart decisions based on
- 46:43Speaker 1: the organization's overall tolerance for risk.
- 46:46Speaker 2: Exactly. The goal is to come up with a plan
- 46:48Speaker 2: that finds the right balance between security and what the
- 46:51Speaker 2: business needs.
- 46:52Speaker 1: That's a great point. Security isn't about getting rid of
- 46:55Speaker 1: all risk, It's about managing it in a smart way.
- 46:58Speaker 2: Couldn't have set it better myself. And remember, risk assessment
- 47:02Speaker 2: never really ends. You need to revisit it as things change.
- 47:05Speaker 1: Okay, stay aware, adapt keep learning. Well said, Well, we've
- 47:10Speaker 1: reached the end of our deep dive into serverleist security.
- 47:13Speaker 1: It's been a long journey, but I feel like I've
- 47:15Speaker 1: learned a lot of valuable information that I can use
- 47:18Speaker 1: in my own work.
- 47:19Speaker 2: Me too. I hope everyone listening feels ready to tackle
- 47:22Speaker 2: the challenges of securing serverlest applications and building more resilient
- 47:26Speaker 2: and secure systems.
- 47:27Speaker 1: Absolutely, and as we finish up, I want to encourage
- 47:30Speaker 1: everyone to always think about security first, be curious, and
- 47:33Speaker 1: never stop learning. Serverlest is always evolving, and so are
- 47:36Speaker 1: the threats. If we stay informed and proactive, we can
- 47:40Speaker 1: build a more secure digital future for everyone.
- 47:43Speaker 2: I agree, and remember you don't have to do this alone.
- 47:46Speaker 2: There's a whole community of security experts and developers out there.
- 47:49Speaker 2: We're passionate about servilist security. Don't be afraid to ask
- 47:53Speaker 2: questions and share what you know.
- 47:55Speaker 1: Absolutely, sharing knowledge and working together is how we stay
- 47:58Speaker 1: ahead of the game. You're joining us for this deep
- 48:01Speaker 1: dive into serverlest security. Until next time, stay secure.