Delen via


De GitHub-actie Microsoft Security DevOps configureren

Microsoft Security DevOps is een opdrachtregeltoepassing die statische analysehulpprogramma's integreert in de ontwikkelingslevenscyclus. Security DevOps installeert, configureert en voert de nieuwste versies van statische analysehulpprogramma's uit, zoals SDL, beveiligings- en nalevingshulpprogramma's. Security DevOps is gegevensgestuurd met draagbare configuraties die deterministische uitvoering in meerdere omgevingen mogelijk maken.

Microsoft Security DevOps maakt gebruik van de volgende opensource-hulpprogramma's:

Naam Taal Licentie
AntiMalware AntiMalwarebeveiliging in Windows tegen Microsoft Defender voor Eindpunt, die scant op malware en de build onderbreekt als er malware is gevonden. Dit hulpprogramma scant standaard op windows-nieuwste agent. Niet open source
Bandiet Python Apache License 2.0
BinSkim Binary--Windows, ELF MIT-licentie
Checkov Terraform, Terraform-plan, CloudFormation, AWS SAM, Kubernetes, Helm-grafieken, Kustomize, Dockerfile, Serverless, Bicep, OpenAPI, ARM Apache License 2.0
ESlint JavaScript MIT-licentie
Sjabloonanalyse ARM-sjabloon, Bicep MIT-licentie
Terrascan Terraform (HCL2), Kubernetes (JSON/YAML), Helm v3, Kustomize, Dockerfiles, CloudFormation Apache License 2.0
Trivy containerinstallatiekopieën, Infrastructure as Code (IaC) Apache License 2.0

Vereisten

De GitHub-actie Microsoft Security DevOps configureren

GitHub-actie instellen:

  1. Meld u aan bij GitHub.

  2. Selecteer een opslagplaats waarnaar u de GitHub-actie wilt configureren.

  3. Selecteer Acties.

    Schermopname van de locatie van de knop Acties.

  4. Selecteer Nieuwe werkstroom.

  5. Selecteer op de pagina Aan de slag met GitHub Actions zelf een werkstroom instellen

    Schermopname die laat zien waar de nieuwe werkstroomknop moet worden geselecteerd.

  6. Voer in het tekstvak een naam in voor uw werkstroombestand. Bijvoorbeeld: msdevopssec.yml.

    Schermopname waarin u ziet waar u een naam voor uw nieuwe werkstroom kunt invoeren.

  7. Kopieer en plak de volgende voorbeeldactiewerkstroom in het tabblad Nieuw bestand bewerken.

    name: MSDO
    on:
      push:
        branches:
          - main
    
    jobs:
      sample:
        name: Microsoft Security DevOps
    
        # Windows and Linux agents are supported
        runs-on: windows-latest
    
        permissions:
          contents: read
          id-token: write
          actions: read
          # Write access for security-events is only required for customers looking for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
          security-events: write
    
        steps:
    
          # Checkout your code repository to scan
        - uses: actions/checkout@v3
    
          # Run analyzers
        - name: Run Microsoft Security DevOps
          uses: microsoft/security-devops-action@latest
          id: msdo
        # with:
          # config: string. Optional. A file path to an MSDO configuration file ('*.gdnconfig').
          # policy: 'GitHub' | 'microsoft' | 'none'. Optional. The name of a well-known Microsoft policy. If no configuration file or list of tools is provided, the policy may instruct MSDO which tools to run. Default: GitHub.
          # categories: string. Optional. A comma-separated list of analyzer categories to run. Values: 'code', 'artifacts', 'IaC', 'containers'. Example: 'IaC, containers'. Defaults to all.
          # languages: string. Optional. A comma-separated list of languages to analyze. Example: 'javascript,typescript'. Defaults to all.
          # tools: string. Optional. A comma-separated list of analyzer tools to run. Values: 'bandit', 'binskim', 'checkov', 'eslint', 'templateanalyzer', 'terrascan', 'trivy'.
    
          # Upload alerts to the Security tab - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
        # - name: Upload alerts to Security tab
        #  uses: github/codeql-action/upload-sarif@v3
        #  with:
        #    sarif_file: ${{ steps.msdo.outputs.sarifFile }}
    
          # Upload alerts file as a workflow artifact - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
        # - name: Upload alerts file as a workflow artifact
        #  uses: actions/upload-artifact@v3
        #  with:  
        #    name: alerts
        #    path: ${{ steps.msdo.outputs.sarifFile }}
    
  8. Selecteer Doorvoeren starten

    Schermopname waarin u ziet waar u doorvoeren kunt selecteren.

  9. Selecteer Nieuw bestand doorvoeren. Houd er rekening mee dat het proces maximaal één minuut kan duren.

    Schermopname die laat zien hoe u een nieuw bestand doorvoert.

  10. Selecteer Acties en controleer of de nieuwe actie wordt uitgevoerd.

    Schermopname van waar u naartoe navigeert om te zien dat uw nieuwe actie wordt uitgevoerd.

Scanresultaten weergeven

Uw scanresultaten weergeven:

  1. Meld u aan bij Azure.

  2. Navigeer naar Defender voor Cloud > DevOps Security.

  3. Op de blade DevOps-beveiliging ziet u dezelfde MSDO-beveiligingsresultaten die ontwikkelaars binnen enkele minuten in hun CI-logboeken zien voor de bijbehorende opslagplaats. Klanten met GitHub Advanced Security zien ook de resultaten die zijn opgenomen in deze hulpprogramma's.

Meer informatie

Volgende stappen

Meer informatie over DevOps-beveiliging in Defender voor Cloud.

Meer informatie over het verbinden van uw GitHub-organisaties met Defender voor Cloud.