Interview Prep/DevSecOps/Pipeline Security Scanning

Your company bans a specific unsafe internal helper function. How do you enforce it automatically?

IntermediateScenarioPipeline Security Scanning
Answer

Situation read → This is a custom SAST rule, which is cheap with Semgrep.

What I'd do →

  1. Write a rule:
rules:
  - id: no-legacy-exec-helper
    languages: [python]
    severity: ERROR
    message: "legacy_exec() is banned, use safe_run() instead"
    pattern: legacy_exec(...)
  1. Test it with semgrep --test using annotated test files.
  2. Publish it in a shared rules repo and run it in all pipelines: semgrep ci --config ./rules.
  3. Announce with a migration guide and an autofix where possible (fix:).

Why → Codifying lessons from incidents means the same bug cannot return.

Interview tip → Mention rules as code with unit tests.

All DevSecOps questions Roadmap: Security in the pipeline

More on Pipeline Security Scanning