Home United States USA — software Why Do We Encourage Poor Coding Patterns?

Why Do We Encourage Poor Coding Patterns?

150
0
SHARE

Secure coding isn’t necessarily high-quality code, and the same is true in reverse. See when « good code » can become a security problem.
Join the DZone community and get the full member experience. For what feels like an eternity at this point, we’ve discussed “shifting left” in the SDLC, taking into account security best practices from the start of software development. DevSecOps was a great leap forward, in no small part because of the emphasis on shared responsibility for security, and the power of a security-aware developer to thwart common vulnerabilities as they write code. We have also known — again, for eons — that the type of secure code training chosen to engage and upskill developers makes all the difference. Low-effort solutions motivated solely by regulatory compliance do not build up the bright security minds of the future, and most security awareness professionals have worked that out. Dynamic, contextually relevant learning is best, but it’s critical that the nuances within are understood. If we’re going to have a fighting chance against threat actors — and they always have a head start on an organization — developers need a holistic training environment, with layered learning that continually builds skills steeped in best practices. Our ethos revolves around the developer being central to a preventative security strategy, right there at the code level upwards. That’s a given, and security-skilled developers provide the easiest path to thwarting the types of common security bugs that are apparent in poor coding patterns (like those discovered as part of the Log4Shell exploit, as one recent, devastating example). However, the defensive techniques that we can engage to upskill developers do vary, even if they can rightly exist in the same training bucket. For example, imagine you were told how to bake a cake, using only directions based on what not to do. “Don’t overbake it”, and “don’t forget the eggs” leaves it open for interpretation, and a huge potential for mistakes that will have an end result fit for Nailed It!. The same is true for defensive security education; what not to do is a very limited part of the conversation and offers no practical advice to truly act with a defensive mindset. You can tell developers, “don’t misconfigure that API”, but with no understanding of what constitutes correct and secure configuration, there is a lot of room for error.

Continue reading...