Tech With Htunn
  • Blog Content
  • ๐Ÿค–Artificial Intelligence
    • ๐Ÿง Building an Intelligent Agent with Local LLMs and Azure OpenAI
    • ๐Ÿ“ŠRevolutionizing IoT Monitoring: My Personal Journey with LLM-Powered Observability
  • ๐Ÿ“˜Core Concepts
    • ๐Ÿ”„Understanding DevSecOps
    • โฌ…๏ธShifting Left in DevSecOps
    • ๐Ÿ“ฆUnderstanding Containerization
    • โš™๏ธWhat is Site Reliability Engineering?
    • โฑ๏ธUnderstanding Toil in SRE
    • ๐Ÿ”What is Identity and Access Management?
    • ๐Ÿ“ŠMicrosoft Graph API: An Overview
    • ๐Ÿ”„Understanding Identity Brokers
  • ๐Ÿ”ŽSecurity Testing
    • ๐Ÿ”SAST vs DAST: Understanding the Differences
    • ๐ŸงฉSoftware Composition Analysis (SCA)
    • ๐Ÿ“‹Software Bill of Materials (SBOM)
    • ๐ŸงชDependency Scanning in DevSecOps
    • ๐ŸณContainer Scanning in DevSecOps
  • ๐Ÿ”„CI/CD Pipeline
    • ๐Ÿ”My Journey with Continuous Integration in DevOps
    • ๐Ÿš€My Journey with Continuous Delivery and Deployment in DevOps
  • ๐ŸงฎFundamentals
    • ๐Ÿ’พWhat is Data Engineering?
    • ๐Ÿ”„Understanding DataOps
    • ๐Ÿ‘ทThe Role of a Cloud Architect
    • ๐Ÿ›๏ธCloud Native Architecture
    • ๐Ÿ’ปCloud Native Applications
  • ๐Ÿ›๏ธArchitecture & Patterns
    • ๐Ÿ…Medallion Architecture in Data Engineering
    • ๐Ÿ”„ETL vs ELT Pipeline: Understanding the Differences
  • ๐Ÿ”’Authentication & Authorization
    • ๐Ÿ”‘OAuth 2.0 vs OIDC: Key Differences
    • ๐Ÿ”Understanding PKCE in OAuth 2.0
    • ๐Ÿ”„Service Provider vs Identity Provider Initiated SAML Flows
  • ๐Ÿ“‹Provisioning Standards
    • ๐Ÿ“ŠSCIM in Identity and Access Management
    • ๐Ÿ“กUnderstanding SCIM Streaming
  • ๐Ÿ—๏ธDesign Patterns
    • โšกEvent-Driven Architecture
    • ๐Ÿ”’Web Application Firewalls
  • ๐Ÿ“ŠReliability Metrics
    • ๐Ÿ’ฐError Budgets in SRE
    • ๐Ÿ“SLA vs SLO vs SLI: Understanding the Differences
    • โฑ๏ธMean Time to Recovery (MTTR)
Powered by GitBook
On this page
  • What Does "Shift Left" Really Mean?
  • Why My Team Embraced Shifting Left
  • The Challenges We Faced
  • How We Implemented Shift Left with GitLab
  • 1. Code Analysis from Day One with SAST
  • 2. Runtime Testing with DAST
  • 3. Supply Chain Security with Dependency Scanning
  • 4. Securing Our Infrastructure with Container Scanning
  • The Real-World Impact
  • My Advice for Your Shift-Left Journey
  1. Core Concepts

Shifting Left in DevSecOps

When I first started working as a DevOps engineer five years ago, security was always that last-minute scramble before deployment. We'd build features for weeks, and then suddenly our security team would swoop in with a long list of vulnerabilities that delayed our release. It was frustrating for everyone involved!

That all changed when my team adopted the "Shift Left" approach in our DevSecOps journey. In this post, I'll share my personal experiences implementing this practice and the transformative impact it had on our development process.

What Does "Shift Left" Really Mean?

The term "Shift Left" refers to moving security considerations earlier in the software development lifecycle. Rather than treating security as an afterthought, we integrate security practices from the very beginning of development.

Think of it this way: if you visualize your development pipeline from left (initial coding) to right (production deployment), we're shifting security activities to the left side of that timeline.

Why My Team Embraced Shifting Left

After several painful release delays due to last-minute security issues, I convinced my team to try a shift-left approach. Here's what we gained:

  • We caught bugs earlier: In our first month after implementation, we identified critical SQL injection vulnerabilities during coding rather than in pre-production testing, saving at least two weeks of rework.

  • Our costs dropped significantly: We reduced security remediation efforts by approximately 70% by catching issues when they were simpler to fix.

  • Our dev and security teams actually started talking: Instead of the traditional adversarial relationship, our security engineers became valued consultants to developers.

  • We shipped faster: Our average time-to-market decreased by nearly 40% as we eliminated the "security bottleneck" at the end of our development cycle.

  • Compliance became easier: When our financial services client requested a SOC 2 report, we were already following most required security practices.

The Challenges We Faced

The shift wasn't without its struggles:

  • Learning curve was steep: I remember spending countless late nights learning about OWASP vulnerabilities and secure coding practices.

  • We needed new tools and training: We invested in both commercial and open-source security tools, plus training sessions for all developers.

  • Initial slowdown was real: For the first two sprints, our velocity dropped by about 30% as we adjusted to the new processes.

  • Some teammates resisted: "I'm a developer, not a security engineer" was a common refrain until everyone saw the benefits.

How We Implemented Shift Left with GitLab

After evaluating several platforms, we settled on GitLab for our DevSecOps pipeline. Here's how we structured it:

1. Code Analysis from Day One with SAST

I configured GitLab's Static Application Security Testing to run on every commit. Here's a snippet from our .gitlab-ci.yml file:

sast:
  stage: test
  script:
    - gitlab-sast
  artifacts:
    reports:
      sast: gl-sast-report.json

This was a game-changer! On my first day implementing this, it caught an unintentional hard-coded API key I had left in my code. Previously, this might have made it all the way to production.

2. Runtime Testing with DAST

Once our application deployed to staging, we ran Dynamic Application Security Testing:

dast:
  stage: test
  script:
    - gitlab-dast --target-url https://staging-app.example.com
  artifacts:
    reports:
      dast: gl-dast-report.json

This helped us identify a cross-site scripting vulnerability that our SAST missed because it only manifested when the application was running.

3. Supply Chain Security with Dependency Scanning

Third-party dependencies were our blind spot until we added:

dependency_scanning:
  stage: test
  script:
    - gitlab-dependency-scan
  artifacts:
    reports:
      dependency_scanning: gl-dependency-scanning-report.json

I'll never forget when this scanner identified a critical vulnerability in a logging library we used. We were able to update it before any exploitation occurred.

4. Securing Our Infrastructure with Container Scanning

As we moved to containerization, we added:

container_scanning:
  stage: test
  image: docker:stable
  script:
    - gitlab-container-scan
  artifacts:
    reports:
      container_scanning: gl-container-scanning-report.json

This once flagged an outdated base image with multiple CVEs, prompting us to update our Dockerfile before deployment.

The Real-World Impact

Six months after implementing our shift-left approach with GitLab, we had:

  1. Reduced security-related defects in production by 82%

  2. Cut our mean time to remediate vulnerabilities from 12 days to 2 days

  3. Improved developer satisfaction as measured in our team surveys

  4. Received praise from our CISO, who previously viewed our team as "security resistant"

My Advice for Your Shift-Left Journey

If you're considering this approach, here are my hard-earned lessons:

  1. Start small - Begin with just SAST and gradually add other security scans

  2. Invest in education - Help developers understand the "why" behind security practices

  3. Celebrate wins - When security tools catch issues early, highlight the time saved

  4. Customize your tools - We adjusted GitLab's default severity thresholds to avoid alert fatigue

  5. Make it a team effort - Invite security professionals to your planning sessions

I hope my journey helps you in your own DevSecOps transformation. Remember, shifting left isn't just a technical changeโ€”it's a cultural one that brings security into the heart of development.

PreviousUnderstanding DevSecOpsNextUnderstanding Containerization

Last updated 2 days ago

๐Ÿ“˜
โฌ…๏ธ