azure-security.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. trigger:
  2. branches:
  3. include:
  4. - '*'
  5. pool:
  6. # Additional hosted image options are available: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted#software
  7. vmImage: ubuntu-latest
  8. steps:
  9. - task: AdvancedSecurity-Codeql-Init@1
  10. inputs:
  11. languages: "csharp"
  12. # Supported languages: csharp, cpp, go, java, javascript, python, ruby, swift
  13. # You can customize the initialize task: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/advanced-security-codeql-init-v1?view=azure-pipelines
  14. # If you're using a self-hosted agent to run CodeQL, use `enableAutomaticCodeQLInstall` to automatically use the latest CodeQL bits on your agent:
  15. enableAutomaticCodeQLInstall: true
  16. # Add your custom build steps here
  17. # - Ensure that all code to be scanned is compiled (often using a `clean` command to ensure you're building from a clean state).
  18. # - Disable the use of any build caching mechanisms as this can interfere with CodeQL's ability to capture all the necessary data during the build.
  19. # - Disable the use of any distributed/multithreaded/incremental builds as CodeQL needs to monitor executions of the compiler to construct an accurate representation of the application.
  20. # - For dependency scanning, ensure you have a package restore step for more accurate results.
  21. # Restore project
  22. - task: DotNetCoreCLI@2
  23. inputs:
  24. command: 'custom'
  25. custom: 'restore'
  26. # Build project
  27. - task: DotNetCoreCLI@2
  28. inputs:
  29. command: 'custom'
  30. custom: 'build'
  31. arguments: '--no-restore'
  32. - task: AdvancedSecurity-Dependency-Scanning@1 # More details on this task: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/advanced-security-dependency-scanning-v1?view=azure-pipelines
  33. - task: AdvancedSecurity-Codeql-Analyze@1 # More details on this task: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/advanced-security-codeql-analyze-v1?view=azure-pipelines