This commit is contained in:
William Blum 2018-11-19 16:19:44 -08:00 коммит произвёл William Blum
Родитель c72ca549e6
Коммит 64b3caf9be
2 изменённых файлов: 43 добавлений и 33 удалений

28
Powershell/readme.md Normal file
Просмотреть файл

@ -0,0 +1,28 @@
### MSRD REST API - Powershell Sample
The Powershell script `PowerShellSample.ps1` below demonstrates how to access MSRD REST API:
- Create a job
- Waits for preparation machine associated with the job to be ready
- Injects test application to be fuzzed and associated seed files
- Monitors the job progress until it starts fuzzing
- Waits until at least one result is reported
- Deletes the job
> NOTE: Although this sample includes Azure Subscription ID and Storage Account parameters,
it is not a MSRD requirement to have an Azure subscription or an Azure storage account
if the test files are already publicly available from an http address.
You can instead upload your binaries and seed files to any internet location accessible from an HTTP URL.
### Usage:
```powershell
. PowershellSample.ps1 `
-springfieldUri "https://www.microsoftsecurityriskdetection.com" `
-accountId <The GUID for your account goes here> `
-apiToken <Your Api token goes here> `
-subscriptionId <You Azure subscription ID goes here> `
-storageAccountName <Name of the storage account used to upload the test driver> `
-storageAccountKey <Your Azure storage account key> `
-testFileFolder <Path to the local files on disk to be uploaded to the storage account and eventually the VM> `
```

Просмотреть файл

@ -1,50 +1,32 @@
# Springfield-sdk-samples
# MSRD REST API Samples
This repository contains samples of how to programmatically access the Springfield service SDK.
This repository contains samples showing how to programmatically access the MSRD service REST API.
**Prerequisite:**
- Must have a Springfield account enabled for SDK use.
- Must have generated an API Token
- Must have the Azure SDK installed
- Must have an Microsoft Security Risk Detection (MSRD) account enabled for API access;
- Must have generated an API Token;
- Must have the Azure SDK installed.
*For detailed instructions [click here](https://github.com/Microsoft/springfield-sdk-samples/wiki/Prerequisites)*
*For detailed instructions [click here](https://github.com/Microsoft/msrd-rest-samples/wiki/Prerequisites)*
---
## Samples
### PowershellSample.ps1
### Powershell
The Powershell script <PowerShellSample.ps1> below accesses the Springfield SDK using its REST API.
It demonstrates how to:
- Create a job
- Waits for preparation machine associated with the job to be ready
- Injects test application to be fuzzed and associated seed files
- Monitors the job progress until it starts fuzzing
- Waits until at least one result is reported
- Deletes the job
See [Powershell sample](https://github.com/Microsoft/msrd-rest-samples/tree/master/Powershell)
The sample below includes parameters of an Azure SubscriptionID and Storage Account. *Note: It is not a Springfield requirement to have an Azure subscription or an Azure storage account if the test files are already publicly available from an http address. You can instead upload your binaries and seed files to any internet location accessible from an HTTP URL.*
### Python sample
Calling the Powershell sample:
See [Python sample](https://github.com/Microsoft/msrd-rest-samples/tree/master/Python)
. PowershellSample.ps1 `
-springfieldUri "https://www.microsoftsecurityriskdetection.com" `
-accountId <The GUID for your account goes here> `
-apiToken <Your Api token goes here> `
-subscriptionId <You Azure subscription ID goes here> `
-storageAccountName <Name of the storage account used to upload the test driver> `
-storageAccountKey <Your Azure storage account key> `
-testFileFolder <Path to the local files on disk to be uploaded to the storage account and eventually the VM> `
---
### Bash sample
See [Bash sample](https://github.com/Microsoft/msrd-rest-samples/tree/master/bash)
## Swagger interface
Springfield SDK exposes its API through a documented Swagger interface. The URL for the Springfield swagger documentation is
MSRD exposes its API through a documented Swagger interface. The Swagger documentation is published at:
https://www.microsoftsecurityriskdetection.com/swagger
Once navigated to the URL, expand the link 'ServiceApi' found at the top left of the page. The complete list of REST API operations are included there. The Swagger UI lets you interact with the Springfield service and call the APIs dynamically.
---
*TODO:* Generating proxy class for your favorite languages using the swagger
The complete list of REST API operations is found under the `ServiceApi` node. The Swagger UI lets you interact with the service and dynamically call the APIs.