SecASC - M05 - CSPM API Integration
SecASC - M05 - CSPM API Integration
Microsoft Confidential
http://www.microsoft.com/en-us/legal/intellectualproperty/Permissions/default.aspx
Agenda
• Workflow Automation
• Logic Apps
• Security Center GitHub Community
• REST APIs for Security Center
• Automating with PowerShell
• Microsoft Security Code Analysis
Azure Security Center
Leveraging
Cloud Security Posture Management Cloud Workload Protection Platform Azure Arc
• Automating a response helps you respond quickly to alerts, or to apply specific remediation steps which would
otherwise have to be performed manually
• You can define when and if a Logic App should run automatically, which will further reduce the overhead of
manual interaction
• To work with Azure Logic Apps workflows, you must have the following Logic Apps roles/permissions:
• Logic App Operator permissions are required for Logic App read/trigger access - this role can't create or
edit Logic Apps, only run existing ones
• Logic App Contributor permissions are required for Logic App creation and modification
• If you want to use Logic App Connectors to other applications, you may need additional credentials to sign into
the respective services (for example, Outlook/Teams/Slack/ServiceNow instances)
Workflow Automation
Getting started with Workflow automation
Add workflow automation
• Select the Workflow automation blade in
Security Center
• To create a new workflow, select Add
workflow automation
• Give the workflow a name
• You can choose the data type for the trigger
condition
• Threat Detection alerts
• Security Center recommendations
• If you don’t have an existing Logic app, you
must create a new one
Workflow Automation
Creating a Logic App
Logic App
• In the Logic Apps Designer you can create a Select a Subscription and
Resource Group for the
custom Logic App from scratch, or use the built- Logic
Now you can App
add
in templates triggers and additional
automation steps to your
• Especially when designing your own custom Logic App
Provide a name
Logic App, planning and testing is needed to Once the Logic App is for the Logic App
make sure your Logic App works properly created you can choose a
template
• Using the built-in templates, you will need to add Select the region
the specific criteria specified in the template Turn on Log Analytics
• There are also many built-in Actions options that Select visit Logic Apps page
can be configured in the Logic App, such as a
When you turn on Log
remediation action step
Analytics you can push the
Logic App runtime events
to Log Analytics to help
monitor your workflows
Workflow Automation
Manually Trigger a Logic App
• When you receive an Alert in Security Center you can manually Trigger a Logic App
• While investigating security alerts you will have the option to take additional action
• You will be able to manually select a Logic App you want to Trigger
Security Center GitHub Community
GitHub
• Azure Security Center’s community is on GitHub
• GitHub is home to more than 36 million people who create and share code, manage projects, and build
software together
Why?
• Using the Azure Security Center repository on GitHub lets you explore new code samples:
programmatic remediation tools for security recommendations; PowerShell scripts; Logic App
templates; and more
Community Collaboration
• Sharing with the open source community allows easy collaboration with partners and customers
Security Center GitHub Community
Find the Community GitHub area
Security Center GitHub Community
Azure-Security-Center repository
The Azure-Security-Center repository contains:
• Download content
• File Issues
• If you want to add this type of information to your custom recommendations so that it appears in the Azure
portal (or wherever you access your recommendations), you'll need to use the REST API.
• The metadata should be added to the policy definition for a policy that is part of the custom initiative. It
should be in the ‘securityCenter’ property, as shown in JSON
"metadata": {
"securityCenter": {
"RemediationDescription": "Custom description goes here",
"Severity": "High",
},
REST APIs for Security Center
REST API Examples
Alerts - Get Subscription Level Alert
Get security alert on a subscription from security data
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/
{alertName}?api-version=2019-01-01
• Use Secure Scores API to get the score for a specific subscription
• Secure Score Controls API can be used to list the security controls and the current score of your subscriptions
This will get all the security recommendations that were discovered for resources inside a Resource Group:
Get-AzSecurityTask -ResourceGroupName "MyRG"
Assessments Metadata APIs for Security Center
Assessments Metadata is a new API that can be used to get metadata information from an assessment type.
Example: In the response from SecurityAssessmentMetadataList you could use assessmentType to determine if the
assessment was based on a built-in Azure Policy definition, CustomPolicy, Custom Azure definition or a VerifiedPartner.
Example: In the response from SecurityAssessment you could use ResourceDetails to determine if it’s an
AzureResource or OnPremises resource.
Assessments Operations:
Create Or Update - Create a security assessment on your resource. An
assessment metadata that describes this assessment must be predefined
with the same name before inserting the assessment result.
• An easy-to install extension hides the complexity of running and maintaining security scanning tools within your
own pipelines
• The Microsoft Security Code Analysis tool set consist of many tools available in the Extension:
• Anti-Malware Scanner
• BinSkim
• Credential Scanner
• Microsoft Security Risk Detection
• Roslyn Analyzers
• TSLint