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
Bandit 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:
          - master
    
    jobs:
      sample:
        name: Microsoft Security DevOps
    
        # MSDO runs on windows-latest.
        # ubuntu-latest also supported
        runs-on: windows-latest
    
        permissions:
          contents: read
          id-token: write
          actions: read
          security-events: write
    
        steps:
    
          # Checkout your code repository to scan
        - uses: actions/checkout@v3
    
          # Run analyzers
        - name: Run Microsoft Security DevOps Analysis
          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
        - name: Upload alerts to Security tab
          uses: github/codeql-action/upload-sarif@v2
          with:
            sarif_file: ${{ steps.msdo.outputs.sarifFile }}
    
          # Upload alerts file as a workflow artifact
        - 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.

    Schermopname die laat zien hoe u een nieuw bestand doorvoert.

    Het kan tot één minuut duren voordat het proces is voltooid.

  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 GitHub.

  2. Navigeer naar het hulpprogramma voor het scannen van waarschuwingen>voor beveiligingscode>.

  3. Selecteer in de vervolgkeuzelijst De optie Filteren op hulpprogramma.

Resultaten van codescans worden gefilterd op specifieke MSDO-hulpprogramma's in GitHub. Deze resultaten voor het scannen van code worden ook opgehaald in Defender voor Cloud aanbevelingen.

Meer informatie

Meer informatie over DevOps-beveiliging in Defender voor Cloud.

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