Security Requirements: What They Are and How to Add Them to Your Project
7 minAudio
Security problems don't generally happen because developers 'don't care' or lack skill. They happen because no one clearly defined what "secure" meant in the first place. When security expectations are left implicit, developers are forced to guess. And that's where vulnerabilities are born. In this episode of DevSec Station, Tanya Janca explains what security requirements are, why they're one of the most overlooked secure development practices, and how developers can start adding them to projects today. You'll learn how clear, testable security requirements eliminate guesswork, improve collaboration, and help teams build secure software from the start. You'll learn: what security requirements are (and what they are not) why vague security expectations lead to recurring problems how security requirements improve design, code reviews, and testing examples of effective security requirements developers can write today how to add security requirements to features without creating bureaucracy Tanya walks through a familiar scenario where a feature works exactly as intended, only to be criticized later because security expectations that were never documented are missing. She explains why this isn't a developer failure, it's a communication failure, and shows how a few clear requirements can prevent expensive misunderstandings before development even begins. If you do just one thing after listening to this episode: Add two or three security requirements to a feature you're currently working on. For example, consider requirements like: who should be allowed to access the feature what inputs must be validated (spoiler alert: all of them!) what sensitive data must never be logged how the application should behave when something goes wrong Then document those requirements somewhere your team will actually see them: the project requirements document (the best place) a ticket a pull request description or somewhere else in the project's documentation When security expectations are written down, developers don't have to guess. They can build the right thing the first time. DevSec Station is a podcast by Tanya Janca (SheHacksPurple), focused on short, practical lessons that help software developers build more secure software. Train with Tanya: Want to bring practical, hands-on secure coding, application security, or AI security training to your team? Learn more at SheHacksPurple. Follow Tanya: https://newsletter.shehackspurple.ca https://linkedin.com/in/tanya-janca https://youtube.com/@shehackspurple https://shehackspurple.ca
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_00Let me tell you why security keeps failing in otherwise good software. It's not because developers don't care. It's not because they don't know enough. It's because no one ever clearly said what security actually means. And if security isn't explicit, that means it's optional. Hi, I'm Tanya Jenka, also known as SheHacksPurple. Welcome to DevSecStation, a podcast for software developers who want to build more secure software.
SPEAKER_00In each episode, I'll share a short practical lesson about secure coding, software security, and how to build safer systems without slowing development down. You can jump in at any episode, at any time. No homework required. This episode is sponsored by MAISE. One of the biggest problems in security right now is that every vulnerability or cloud scanner says everything is critical, and honestly, no one has time for that.
SPEAKER_00MAZES uses AI agents to investigate vulnerabilities in context, so you can focus on the issues that are actually exploitable in your environment and not just theoretically scary. Their AI agents also generate and prioritize fixes that knock out multiple vulnerabilities at once, which is honestly the kind of scaling that security teams really need right now. Learn more about maze at mazehq.com slash devsec. If you've ever shipped a feature and later been told this isn't secure, without anyone quite being able to explain why this episode was made for you.
SPEAKER_00Security requirements are one of the most underrated tools in secure software development. And also one of the least understood. When most people hear requirements, they think bureaucracy. But security requirements aren't politics or policies, they aren't audits, they're not compliance checklists. What they should be is simple, clear, testable statements about how your software must behave to be considered safe and secure.
SPEAKER_00If something matters, we write it down, right? And if we don't write it down, it's just wishful thinking. Here is a scenario that I see all the time. A feature ships and it works. Tests pass. Woo! Later, someone raises a security concern. Perhaps authentication wasn't enforced consistently. There's errors leaking sensitive information, and then the sensitive information is logged. Oh no.
SPEAKER_00And the dev team says, honestly, well, we didn't know we weren't supposed to do that. They're not wrong, right? No one ever said this feature must enforce authentication at every entry point. There was nothing explicit anywhere. Or this data must never be logged, and then it explains what data it is. So developers did what developers always do, right? They filled in the gaps. And security, it got lost along the way. So how do we fix this?
SPEAKER_00Well, a bad approach is assuming everyone has the same idea of what secure means. Because they definitely don't. And if you listen to this podcast regularly, you know that. And when expectations are implied, that means security is optional. And we can't have that. So a better approach would be hoping code review or security tools will just catch this issue later. And don't get me wrong, this helps, but it's reactive, it's expensive, and it's frustrating, and it misses stuff.
SPEAKER_00The best approach we can do is writing security requirements and making them a part of the formal project requirements document. When expectations are crystal clear, developers don't have to guess. They can build the right thing the first time. So you might be thinking, what do security requirements actually look like, Tanya? Security requirements don't need to be long or complicated, but they do need to be specific and clear. So let me give you a whole bunch of examples because I love examples. Okay, example one, authentication.
SPEAKER_00This endpoint must require authentication on every request. Example authorization. Only users with the admin role may perform this action. Input validation or input handling. All user supplied input must be validated before use. Data protection. This sensitive data must never be logged or returned in error messages. And then sensitive data is defined clearly elsewhere. Example, error handling. Errors must return a generic message to the client and log details internally.
SPEAKER_00See how these aren't policies? They're clear and specific instructions. Plus, each one is testable and obviously we like that, right? If you do just one thing after this episode, please do this. Add security requirements to one feature or one ticket that you're working on. And here is how to do it without slowing things down too much. Step one, pick a feature, an endpoint, a change, something you're actively working on.
SPEAKER_00Step two, write two or three security requirements for it. Think in terms of who can access this? What inputs should it be accepting? How it handles that data, what happens when it fails. That's a really important one. Okay, now step three, put those requirements somewhere visible. In a ticket, in the README, in the PR description, or better yet, add it to the project requirements if that's an option for you, if that's something that you have the power to do.
SPEAKER_00So now the security on this feature is no longer guesswork, it's clear, it's precise, and it's testable. Security requirements aren't about control, they're about clarity, and clarity is kindness. When developers know what's expected, then they can meet those expectations. And when we don't know, then we improvise. And improvisation is where vulnerabilities are born, right? Thanks for listening to DevSecStation. If you enjoyed this episode, please subscribe, share it with a friend, or leave a review.
SPEAKER_00It helps more people discover the show. If you'd like to learn more, I'm Tanya Janka, also known as SheHacksPurple. And I teach secure coding training for software developers. You can find me online at shehackspurple.ca. Thank you for being here.
What happens when an AI agent crosses a security boundary it was supposed to respect? How do we prevent an agent from accessing unauthorized systems, exposing secrets, or finding an unexpected path into production? In...
Your AI agent can read files, execute commands, install software, connect to external services, and maybe even deploy to production. But should it have permission to do all of those things? In Season 2, Episode 3 of...
Two critical PHP vulnerabilities have been disclosed, and even applications written with secure coding practices may be affected. In this special bulletin of DevSec Station, Tanya Janca (SheHacksPurple) explains...
I asked Claude to build me a little application that would greet me every morning. Nothing complicated. Just say hello, call me a Queen, give me a compliment, and share an inspirational quote. Cute, right? Except Claude...
What happens when your AI assistant does exactly what you expect 59 times... and then does something completely bananas on the 60th? While teaching a secure coding class, I watched nearly 60 students use the same AI...