Microsoft Defender for Cloud
Cloud and workloads

Technical onboarding guide for StackHawk (preview)

In brief

The page updates its date and metadata, clarifies GitHub Actions and Azure Pipelines setup headings and wording, refreshes links, and adds guidance for viewing imported findings.

What Defender admins need to know

Administrators can use clearer section names, setup instructions, and links when configuring StackHawk scans.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

Connect your DevOps environments to Microsoft Defender for Cloud

This featureStackHawk integration with Defender for Cloud requires connecting your DevOps environment to Defender for Cloud.

See Onboard GitHub organizations.

See Onboard Azure DevOps organizations.

Configure StackHawk API security testing scan

ForConfigure StackHawk scans for GitHub Actions CI/CD environments

        SARIF_ARTIFACT: true

ThisThe `stackhawk/hawkscan-action` step starts HawkScan on the runner pointed at the app.host defined in the *stackhawk.yml*. Be sure to include `with.env.SARIF_ARTIFACT: true` to get the SARIF output from the scan. The HawkScan action has documented configuration inputs, and the sample workflow at [hawkscan.yml][sample HawkScan GitHub Actions workflow (hawkscan.yml)](https://github.com/kaakaww/javaspringvulny/blob/main/.github/workflows/hawkscan.yml#L21-L32) shows itthe HawkScan action in use.

1. You can also follow these steps to add *stackhawk/hawkscan-action* to a new workflow action:

1. Select **New Workflow**.
1. Filter by searching for *StackHawk HawkScan* in the search box.
1. Select **Configure** for the *StackHawk* workflow.
1. Modify the sample workflow in the editor. Review the [GitHub[StackHawk GitHub Actions documentation](https://docs.stackhawk.com/continuous-integration/github-actions/).
1. Select **Commit changes**. You can either directly commit to the main branch or create a pull request. We recommend following GitHub best practices by creating a PR, as the default workflow launches when a PR is opened against the main branch.
1. Select **Actions** and verify the new action is running.
1. After the workflow is completed, select **Security**, then select **Code scanning** to view the results.

#### Navigate to Defender for Cloud

To view the imported StackHawk findings in Defender for Cloud, follow these steps:

1. Select **Recommendations**.
1. Filter by searching for **API security testing**.
1. Select the recommendation **GitHub repositories should have API security testing findings resolved**.

:::image type="content" source="media/onboarding-guide-stackhawk/github-recommendations-result.png" alt-text="Screenshot of GitHub repositories should have API security testing findings resolved recommendation." lightbox="media/onboarding-guide-stackhawk/github-recommendations-result.png":::

<a name="for-azure-pipelines-environments"></a>
### ForConfigure StackHawk scans for Azure Pipelines environments

1. To use the [StackHawk HawkScan extension](https://marketplace.visualstudio.com/items?itemName=StackHawk.stackhawk-extensions), make sure you're logged into Azure Pipelines (`https://dev.azure.com/{yourorganization}`), and have a [StackHawk account](http://auth.stackhawk.com/signup).
1. From Azure Pipelines, you can use a defined pipeline with a defined *azure-pipelines.yml* process already in place, or create a new workflow. We scan this Azure DevOps repository for API vulnerabilities as part of the *azure-pipelines.yml* workflow.
   SARIF_ARTIFACT: true

This installsThese tasks install HawkScan on the runner pointed atand run it against the app.host defined in stackhawk.yml. Be sure to include env.SARIF_ARTIFACT: true on the task specification to get the SARIF output from the scan. The HawkScan action has documented configuration inputs, and the sample pipeline at sample Azure Pipelines YAML file (azure-pipelines.yml) shows itthe HawkScan tasks in use.

  1. Install the HawkScan Azure DevOps extension extension on your Azure DevOps organization.

    1. Visit the StackHawk website and sign up for a free StackHawk trial.
    2. For Windows developers, reference this sample app for building software on Windows.
    3. Review the HawkScan and Azure Pipelines documentation.

FAQ

The following answers address common questions about StackHawk.

How is StackHawk licensed?

StackHawk is licensed based on the number of code contributors that are provisioned on the platform. For custom pricing, EULA, or a private contract, contact [email protected].

Next stepsteps

[!div class="nextstepaction"] Review Microsoft Defender for APIs overview