Set Up to Use Bash or PowerShell
Set up your environment to use Bash (cURL) or PowerShell to send HTTP requests to Deep Security Manager using the API.
Complete this recipe before performing any other cookbook recipes.
Bash or PowerShell?
If you are new to scripting you might not be familiar with these tools, which is fine. Your operating system determines which one you'll be using:
- Windows: PowerShell
- Mac or Linux: Bash
If you're on Windows you can ignore the information about Bash (and cURL). Conversely, if you'll be using Bash you can ignore all the PowerShell information.
Check your environment
Check that you can access Deep Security Manager and that you have the required software installed. You will check the version of your software to make sure it supports TLS 1.2 which Deep Security Manager uses for securing HTTPS connections.
What to check |
Description |
---|---|
Connection to Deep Security Manager |
Use your Web browser to navigate to the URL of your instance of Deep Security
Manager (for example,
url=https://192.168.1.100:4119 or
url=https://example.com:4119 ):
|
cURL software (for Bash) |
If you want to use Bash (typically Linux or Mac users), check the version of cURL and OpenSSL or NSS or LibreSSL that are installed. Open Terminal or your preferred command line tool and enter the following command:
If any of the required software is not installed or is too old, refer to your operating system's documentation for information about installing or upgrading it. |
PowerShell software |
If you want to use PowerShell (Windows), check the version of PowerShell and .NET Framework that is installed.
If PowerShell or .NET Framework is not installed or is too old, refer to your Windows documentation for information about installing or upgrading it. |
Create an API key
Create an API key for authenticating your API calls. When you create the key, a key secret is presented that you must store for later use.
This procedure creates a key with all permissions. Use a different role to limit access to certain API capabilities.
- Log into Deep Security Manager in your Web browser and click Administration > User Management > API Keys. If you do not see the API Keys section, talk to your Deep Security administrator about obtaining the required user permissions.
- Click New and enter the following property values:
- Name: Cookbook API key
- Role: Full Access
- Click Next. The key secret is presented. This is the only time that you can obtain the secret.
- Copy the secret and securely store it.
- Click Close.
Test your setup
CLI type |
Description |
---|---|
Bash |
|
PowerShell |
Tip:
If you receive the error message |
Final comments
After you have successfully sent a request to Deep Security Manager to validate your setup, you are ready to use the other cookbook recipes.