Latest / CyberCode Academy / Course 7 - Secure SDLC (Software Development Life Cycle) | Episode 5: Hardening, DevSecOps Integration, Container Security and WAF
Transcript
- 0:00Speaker 1: Welcome to the deep dive. Today. We're zeroing in on
- 0:03Speaker 1: what I think is the security gauntlet. We've been looking
- 0:07Speaker 1: into that final critical stage of software development. You know,
- 0:11Speaker 1: the moment the code leaves the safety of the dev
- 0:15Speaker 1: environment and actually gets deployed.
- 0:17Speaker 2: Yeah, the moment it goes live.
- 0:19Speaker 1: Yeah, exactly, And this is where all that hard security
- 0:22Speaker 1: work is either you know, perfectly locked down or just
- 0:26Speaker 1: completely exposed to the entire Internet.
- 0:28Speaker 2: It's so true. We're diving into what's formally called secure
- 0:31Speaker 2: deploy It's phase five of the secure software development life cycle.
- 0:35Speaker 2: So if you've done your job and mitigated the big
- 0:37Speaker 2: vulnerabilities during development and testing, this phase is well, it's
- 0:42Speaker 2: all about automation and hardening the environment.
- 0:44Speaker 1: So the mission is tactical.
- 0:45Speaker 2: The mission is very tactical. Lockdown the systems and critically
- 0:49Speaker 2: make sure that the deployment pipeline itself can't be used
- 0:52Speaker 2: as an attack factor.
- 0:53Speaker 1: So for you listening, we're going to be exploring the
- 0:55Speaker 1: immediate practical steps for hardening. We'll look at modern automation
- 0:59Speaker 1: models like devsecups and see why they work where manual
- 1:03Speaker 1: security just fails. We'll also get into specific defenses for
- 1:08Speaker 1: things like containers, and maybe most importantly, how you keep
- 1:11Speaker 1: security running continuously after you've hit the launch button.
- 1:14Speaker 2: That's the real challenge.
- 1:15Speaker 1: Let's start with the basics. Then the checklist software is built,
- 1:18Speaker 1: it's ready to go. What are the absolute foundational principles
- 1:22Speaker 1: of hardening we have to follow before it goes live?
- 1:24Speaker 2: Okay, so the foundational principles are all about cutting down
- 1:27Speaker 2: the risk the attack surface area. The first rule is
- 1:31Speaker 2: what we call deployment minimalism. Minimalism only deploy what is
- 1:35Speaker 2: absolutely necessary. I mean, if a service or a library
- 1:39Speaker 2: or some feature isn't strictly required for the app to
- 1:41Speaker 2: function and production, it just shouldn't be there.
- 1:43Speaker 1: That makes a lot of sense, less stuff, less to secure.
- 1:46Speaker 1: But how do you draw that line? I mean, how
- 1:49Speaker 1: do you make sure you don't accidentally remove something vital
- 1:52Speaker 1: like a debugging tool you might need in an emergency.
- 1:55Speaker 2: That's a great question, and that line is drawn by
- 1:58Speaker 2: a really rigorous testing and configuration management before you deploy.
- 2:03Speaker 2: If you can't debug with what's deployed, then I guess
- 2:06Speaker 2: that tool was necessary. But the things we're really talking
- 2:08Speaker 2: about are you know, default config files, sample data, developer
- 2:13Speaker 2: only tools.
- 2:14Speaker 1: Got it? All out all of it.
- 2:16Speaker 2: Then second, we have to look at access control through
- 2:20Speaker 2: account management and the principle of least privilege.
- 2:22Speaker 1: We hear least privilege thrown around all the time. What
- 2:25Speaker 1: does it actually mean practically when you're deploying.
- 2:28Speaker 2: It means two very specific things. First, lock or just
- 2:33Speaker 2: expire all the default user accounts that ship with.
- 2:36Speaker 1: The system, the ones everyone forgets, the one's.
- 2:38Speaker 2: Everyone forgets exactly. And second, enforce really strong access policies.
- 2:43Speaker 2: When we say least privilege, we mean you actively go
- 2:46Speaker 2: in and revoke unnecessary privileges.
- 2:48Speaker 1: Especially from public groups.
- 2:50Speaker 2: That imagine, especially from public user groups. Every single account,
- 2:54Speaker 2: whether it's a user or a service, should only have
- 2:57Speaker 2: the parishions it needs to do its job and absolutely
- 3:00Speaker 2: lean nothing more. That's what stops an attacker from moving
- 3:03Speaker 2: around if one account gets compromised.
- 3:05Speaker 1: And what about the environment itself, the hardware, the OS.
- 3:09Speaker 1: How do we make sure it's not already a risk
- 3:11Speaker 1: before we even put our code on it.
- 3:13Speaker 2: For that, you have to use established standards for what's
- 3:16Speaker 2: called infrastructure hardening. The main one is the CIS BENCHMARKIA. Yeah,
- 3:21Speaker 2: the Center for Information Security. They basically publish these incredibly detailed,
- 3:26Speaker 2: step by step guides for securely configuring well almost every
- 3:31Speaker 2: piece of commercial hardware and software you can think of.
- 3:34Speaker 1: So it's like a recipe book for security.
- 3:35Speaker 2: It is. You follow those guidelines and you eliminate all
- 3:38Speaker 2: the common known security risks across your whole stack before
- 3:43Speaker 2: your code even touches it.
- 3:44Speaker 1: So environments clean access is locked. What about the essential
- 3:49Speaker 1: security tech we need?
- 3:50Speaker 2: Okay, you need robust authentication and access control, think single
- 3:54Speaker 2: sign on, multi factor authentication. Those should be mandatory, negotiable,
- 3:58Speaker 2: non negotiable. For the network, you have to restrict access
- 4:02Speaker 2: with a firewall, and you've got to be constantly monitoring
- 4:04Speaker 2: who's accessing in the system looking for suspicious ips. And
- 4:08Speaker 2: then there's the never ending job patching. You need a
- 4:12Speaker 2: solid process to apply security patches and workarounds the moment
- 4:15Speaker 2: a CVE is announced. And finally, don't forget encryption. You
- 4:20Speaker 2: must use strong transport layer security like TLS one point
- 4:24Speaker 2: two or one point three, with strong ciphers and secure
- 4:27Speaker 2: cookies for everything.
- 4:29Speaker 1: Okay, so we've got this perfect, very detailed checklist for hardening.
- 4:34Speaker 1: But for modern teams, I mean teams that are pushing
- 4:37Speaker 1: code multiple times a day, Trying to manually follow that
- 4:40Speaker 1: giant checklist feels like a recipe for disaster.
- 4:43Speaker 2: It's a guaranteed bottleneck. It can't be done right.
- 4:46Speaker 1: If development doesn't stop, you have to automate. And that's
- 4:49Speaker 1: the whole point of devsekops, isn't it.
- 4:51Speaker 2: It's not just the point, it's an existential necessity. The
- 4:53Speaker 2: old model, you know, the big security audit at the
- 4:55Speaker 2: very end, it's dead. Why because bad actors are using
- 4:59Speaker 2: their own own automation to find vulnerabilities in minutes. Security
- 5:03Speaker 2: has to be embedded right from the start of the pipeline.
- 5:05Speaker 2: It has to be automated to keep pace with both
- 5:07Speaker 2: your developers and the attackers.
- 5:09Speaker 1: So security has to be baked in, not bolted on
- 5:11Speaker 1: at the end. What does that look like? Tool wise?
- 5:13Speaker 2: It requires what i'd call a rational deployment of your tools.
- 5:17Speaker 2: A lot of organizations they just waste money on security
- 5:20Speaker 2: tools that are a nightmare to deploy, or you know,
- 5:23Speaker 2: they just spit out noise instead of actionable insights. Ch
- 5:27Speaker 2: you need tools like SaaS that static analysis so it
- 5:30Speaker 2: finds bugs in the code before it even runs, and
- 5:33Speaker 2: dised which checks the code while it's running. And these tools.
- 5:37Speaker 2: They have to have high integrability.
- 5:40Speaker 1: Many they have to talk to everything else.
- 5:41Speaker 2: They have to talk directly to your issue tracking systems
- 5:44Speaker 2: like Jurra. So you get this continuous loop of assessment
- 5:48Speaker 2: and flaw tracking.
- 5:49Speaker 1: Let's talk about the human side of this, the compliance
- 5:51Speaker 1: automation challenge. You've got compliance departments who traditionally just want
- 5:55Speaker 1: to see paper documented processes. Then you have DevOps teams
- 5:59Speaker 1: who are folks on delivery and think the only proof
- 6:02Speaker 1: that matters is in the code. That sounds like a
- 6:06Speaker 1: culture clash.
- 6:07Speaker 2: That friction is very real. The way you get past
- 6:09Speaker 2: it is by convincing the regulatory folks to shift their
- 6:12Speaker 2: focus from paper to measurable evidence. You identify the regulatory
- 6:17Speaker 2: controls you need to meet, you translate them into software methods,
- 6:20Speaker 2: and then you automate the measurement of those controls at
- 6:23Speaker 2: key points in the life cycle.
- 6:25Speaker 1: So instead of a form, you have a dashboard.
- 6:27Speaker 2: Exactly for instance, automatically tracking that all high risk vulnerabilities
- 6:31Speaker 2: are patched within say twenty four hours. That measurable, repeatable
- 6:36Speaker 2: proof is compliance automation, and it improves risk mitigation without
- 6:40Speaker 2: slowing anyone down.
- 6:42Speaker 1: So automation is key but measuring that automation is how
- 6:46Speaker 1: you prove it's actually working.
- 6:47Speaker 2: Absolutely. Success depends on continuous monitoring and measurement of critical metrics.
- 6:52Speaker 2: If you want to know if your debzac ops pipeline
- 6:54Speaker 2: is actually secure and efficient, you have to track things
- 6:57Speaker 2: like your deployment frequency, your vulnerability patch time, how fast
- 7:01Speaker 2: you fix that, how fast you fixed flaws. Yeah, the
- 7:03Speaker 2: percentage of your code that's automatically tested, and how many
- 7:06Speaker 2: automated tests you have per application. Those are the numbers
- 7:09Speaker 2: that define success.
- 7:11Speaker 1: Okay, let's pivot to two specific areas that bring in
- 7:14Speaker 1: some really unique risks in any modern environment. Containers and
- 7:19Speaker 1: web apps. Start with containers. They give you a ton
- 7:21Speaker 1: of flexibility, but what are the security traps we need
- 7:24Speaker 1: to avoid?
- 7:25Speaker 2: Containers bring a few big risks. You can have unrestricted
- 7:29Speaker 2: traffic flowing between them, and they often share the same
- 7:31Speaker 2: kernel with the host system. But the single biggest, most
- 7:35Speaker 2: terrifying risks go on is that a container, by default
- 7:39Speaker 2: can run with root privileges for the entire host system,
- 7:43Speaker 2: not just inside its own little box.
- 7:44Speaker 1: Wait, hang on, so you're saying a compromise inside one
- 7:47Speaker 1: container could immediately give an attacker root access to the
- 7:50Speaker 1: machine running all my other containers.
- 7:52Speaker 2: That is exactly the risk. If a malicious actor compromises
- 7:56Speaker 2: a container that has elevated privileges, they could potentially get
- 8:00Speaker 2: unlimited access to the host.
- 8:01Speaker 1: Wow.
- 8:02Speaker 2: So defense here has to be a shared responsibility. We
- 8:05Speaker 2: recommend a few approaches. You should be scanning the container
- 8:08Speaker 2: code with static analysis during the build phase. And you
- 8:11Speaker 2: should be using something called image admission control.
- 8:14Speaker 1: And what's that.
- 8:14Speaker 2: It's a mechanism that just prevents high risk images from
- 8:17Speaker 2: ever running. For example, an image that has exposed passwords
- 8:21Speaker 2: baked into it, or one that demands excessive privileges, the
- 8:24Speaker 2: controller just blocks it.
- 8:26Speaker 1: And what about that critical privilege issue you mentioned? That
- 8:29Speaker 1: sounds like a massive failure point everyone should know.
- 8:32Speaker 2: You have to have to prioritize restricting container privileges. Always
- 8:36Speaker 2: use the user command in the docker file to make
- 8:38Speaker 2: sure the container doesn't run as root. And here is
- 8:41Speaker 2: the non negotiable rule. Never run a container with the
- 8:45Speaker 2: privileged flag.
- 8:46Speaker 1: Why is it so bad?
- 8:47Speaker 2: Think of it this way. That flag doesn't just grant
- 8:50Speaker 2: access inside the container. It's like giving the attacker the
- 8:53Speaker 2: master keys to the entire building, the host system itself.
- 8:56Speaker 2: It bypasses. Almost every sandbox protection.
- 8:59Speaker 1: There is is a massive simple configuration mistake with a
- 9:04Speaker 1: nuclear outcome.
- 9:05Speaker 2: Precisely now switching gears a bit. Let's talk about protecting
- 9:08Speaker 2: the front door the web application. This is where a
- 9:12Speaker 2: web application firewall or away is just essential. O. Wait,
- 9:16Speaker 2: a WAIF is a specialized defense at layer seven. So
- 9:19Speaker 2: unlike a regular firewall that's just looking at IP addresses
- 9:23Speaker 2: and ports, right, a WAF actually inspects the content of
- 9:26Speaker 2: the HTTP traffic itself. It's looking for things like SEQL
- 9:30Speaker 2: injection attacks, cross site scripting, all those application specific flaws, and.
- 9:34Speaker 1: It sits between the user and the application, acting as
- 9:38Speaker 1: a reverse proxy. So how does it decide what's good
- 9:42Speaker 1: traffic and what's bad.
- 9:43Speaker 2: It typically uses one of two models, or sometimes a hybrid.
- 9:47Speaker 2: The first is the blacklist model or negative security. This
- 9:51Speaker 2: blocks known bad traffic, so signatures of known attacks. Okay,
- 9:55Speaker 2: think of it like a bouncer at a club who
- 9:57Speaker 2: has a list of people who have caused trouble forour
- 10:00Speaker 2: and denies them entry.
- 10:01Speaker 1: And the other more restrictive approach.
- 10:03Speaker 2: That would be the whitelist model or positive security. This
- 10:06Speaker 2: only admits traffic that is preapproved. It's much much tighter.
- 10:09Speaker 2: It's like a banster at a super exclusive party who
- 10:12Speaker 2: only lets people in if their name is explicitly on
- 10:14Speaker 2: the guest list.
- 10:15Speaker 1: Doesn't matter if they look suspicious or not. If they're
- 10:17Speaker 1: not on the list, they're.
- 10:18Speaker 2: Not coming in exactly now, most modern systems use a
- 10:21Speaker 2: hybrid because a pure whitelist can sometimes block legitimate new
- 10:24Speaker 2: features of your app. The key is you have to
- 10:27Speaker 2: test your WAFT rigorously and make sure it integrates with
- 10:30Speaker 2: your other defense tools.
- 10:31Speaker 1: So we've built it, we've automated the release, We've set
- 10:34Speaker 1: up our defenses. Now it's time for the final sign off.
- 10:37Speaker 1: What key practices confirm we've actually done our homework before
- 10:40Speaker 1: we certify a release.
- 10:41Speaker 2: There are about five key practices for a robust secure review.
- 10:46Speaker 2: First is a gap analysis against the NIST Cybersecurity Framework GIST. Yeah,
- 10:52Speaker 2: you evaluate your policies against their five core functions identify, protect, detect, respond,
- 10:57Speaker 2: and recover. It just makes sure you haven't missed huge
- 11:00Speaker 2: crucial step.
- 11:01Speaker 1: And since you know no software is built in a vacuum,
- 11:04Speaker 1: what about all the dependencies we pull in from the
- 11:06Speaker 1: outside world.
- 11:07Speaker 2: That leads to one of the most critical steps. The
- 11:10Speaker 2: open source licensing review, you have to assess the risk
- 11:13Speaker 2: categories of all your dependencies.
- 11:15Speaker 1: So some licenses are riskier than others.
- 11:17Speaker 2: Much riskier. Licenses like apatche are low risk, very permissive.
- 11:21Speaker 2: But then you have restrictive licenses like GPL three point
- 11:24Speaker 2: zero which fall squarely in the high risk category.
- 11:28Speaker 1: Just to really hammer this point home, Yeah, a restrictive
- 11:30Speaker 1: license like GPL three point zero, that could mean that
- 11:33Speaker 1: if I use that open source library, I might be
- 11:35Speaker 1: legally required to release my own company's secret proprietary source code. Yes,
- 11:41Speaker 1: that's not a security risk. That's that's a legal atom
- 11:44Speaker 1: bomb for your company.
- 11:46Speaker 2: It is precisely that legal exposure understanding that is a
- 11:49Speaker 2: mandatory part of the secure review. Then the final steps
- 11:52Speaker 2: are privacy review to mitigate any privacy impacts, a final
- 11:55Speaker 2: security test results review.
- 11:57Speaker 1: To make sure everything's fixed.
- 11:58Speaker 2: To make sure all high risk vulnerables from your sas
- 12:01Speaker 2: IAST and WAFT tests are remediated before deployment. And then
- 12:05Speaker 2: finally you formally certify the release with clear documentation.
- 12:08Speaker 1: And once that software is out there in production, the
- 12:11Speaker 1: real fight begins. This is where continuous vulnerability management or
- 12:15Speaker 1: CVM comes in.
- 12:16Speaker 2: CVM is the continuous process of assessing and acting on
- 12:19Speaker 2: new information to well to minimize the window of opportunity
- 12:23Speaker 2: for attackers. It's a race. You can't opt out of
- 12:26Speaker 2: attackers explain new findings, and defenders have to deploy patches fast, so.
- 12:30Speaker 1: You can't just wait for a quarterly audit anymore.
- 12:32Speaker 2: Oh No, you have to be scanning constantly.
- 12:34Speaker 1: What's the industry standard for how often you should be scanning?
- 12:37Speaker 2: The CIS recommendations suggest using an up to date SKP
- 12:41Speaker 2: compliant vulnerability scanner to automatically scan all your systems weekly
- 12:46Speaker 2: or even more frequently if the asset is really critical,
- 12:49Speaker 2: and that has to be paired with automated software update
- 12:52Speaker 2: tools to make sure your OS and all your third
- 12:54Speaker 2: party apps are always patched.
- 12:56Speaker 1: We hear about tools like NESSUS for CVM. How does
- 12:59Speaker 1: that efficiency piece play into managing this just constant stream
- 13:04Speaker 1: of new vulnerabilities efficiencies everything.
- 13:07Speaker 2: Tools like Nessa's let you define very targeted scans, So
- 13:11Speaker 2: instead of running every single vulnerability rule against every single system.
- 13:15Speaker 1: Which would take forever forever.
- 13:17Speaker 2: You can specify a target IP and apply very specific
- 13:19Speaker 2: policies and plugins, for example, only running Windows related checks.
- 13:24Speaker 2: If you know it's a window server. This tailoring limits
- 13:27Speaker 2: the rules that run it massively reduces scan time, and
- 13:31Speaker 2: it gives you actionable reports fast CVM demands at efficiency
- 13:35Speaker 2: to win the race.
- 13:37Speaker 1: What a dense deep dive. We started with establishing that
- 13:40Speaker 1: secure deployment checklist, focusing on least privilege and hardening your infrastructure.
- 13:45Speaker 1: Then we showed how dayseekops integrates automation and security through
- 13:49Speaker 1: the entire pipeline so you don't create those crippling bottlenecks.
- 13:52Speaker 1: We hit the massive risks and fixes for modern infrastructure
- 13:56Speaker 1: like containers, especially avoiding that terrifying privileged flag and the
- 14:00Speaker 1: role of WEFs. And finally this secure review process and
- 14:03Speaker 1: keeping it all going with continuous vulnerability management.
- 14:07Speaker 2: And you know, this raises a really important question for
- 14:09Speaker 2: you to think about in a world where CVM is
- 14:12Speaker 2: just constantly reporting new flaws. Let's say you get a
- 14:14Speaker 2: report it shows fifty new vulnerabilities across your system. You
- 14:17Speaker 2: have to prioritize. You can't fix them.
- 14:19Speaker 1: All at once, you have to prioritize.
- 14:20Speaker 2: Yeah, right, So we talked about measuring things like vulnerability
- 14:23Speaker 2: patch time and the risk level of an application. When
- 14:27Speaker 2: that report with fifty new flaws lands on your desk?
- 14:31Speaker 2: How do you decide where to start? Is it the
- 14:33Speaker 2: one with the huge CVSS score on a low impact
- 14:36Speaker 2: internal app, or is it the low score flaw on
- 14:38Speaker 2: your main public facing e commerce platform.
- 14:41Speaker 1: That intersection of technical severity and business criticality.
- 14:44Speaker 2: Exactly, That's the ongoing deep dive every security leader has
- 14:48Speaker 2: to face every single day. So what stands out to
- 14:50Speaker 2: you as the most critical factor