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
Een Azure-abonnement Als u geen Azure-abonnement hebt, maakt u een gratis account voordat u begint.
Open de GitHub-actie Microsoft Security DevOps in een nieuw venster.
Zorg ervoor dat werkstroommachtigingen zijn ingesteld op Lezen en Schrijven in de GitHub-opslagplaats. Dit omvat het instellen van machtigingen voor id-token: schrijven in de GitHub-werkstroom voor federatie met Defender voor Cloud.
De GitHub-actie Microsoft Security DevOps configureren
GitHub-actie instellen:
Meld u aan bij GitHub.
Selecteer een opslagplaats waarnaar u de GitHub-actie wilt configureren.
Selecteer Acties.
Selecteer Nieuwe werkstroom.
Selecteer op de pagina Aan de slag met GitHub Actions zelf een werkstroom instellen
Voer in het tekstvak een naam in voor uw werkstroombestand. Bijvoorbeeld:
msdevopssec.yml
.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 }}
Selecteer Doorvoeren starten
Selecteer Nieuw bestand doorvoeren. Houd er rekening mee dat het proces maximaal één minuut kan duren.
Selecteer Acties en controleer of de nieuwe actie wordt uitgevoerd.
Scanresultaten weergeven
Uw scanresultaten weergeven:
Meld u aan bij Azure.
Navigeer naar Defender voor Cloud > DevOps Security.
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
Meer informatie over GitHub-acties voor Azure.
Meer informatie over het implementeren van apps van GitHub naar Azure.
Volgende stappen
Meer informatie over DevOps-beveiliging in Defender voor Cloud.
Meer informatie over het verbinden van uw GitHub-organisaties met Defender voor Cloud.