Using the Template

Download the Template

In the BrazenCloud portal, navigate to the Actions section using the left navigation bar.

In the Actions list find template:python and click it the download button on the right:

template:python download button

All Actions are packaged as zip file, and the template is no different. Make sure and save the Action.zip file that the portal requests to download. Then go ahead and extract it.

Inside of the Action folder you will see several files as well as folders for both linux and windows. For informiation about all of the components of an action, see the Components page. You can complete this tutorial before doing so.

You can refer to the README.txt for detailed instructions on how the Action is structured and how to modify it.

The README file may refer to an Action as an 'applet', this was the old nomenclature.

Modify the Template

With the template in hand, the easiest way to create another Action is to simply update the existing script.

Inside of the linux folder, you'll see a sample script called: netstat.py and another called run.sh.

If you also look inside of the manifest.txt, you'll see the following commands:

COPY . .
RUN_WIN windows\run.bat
RUN_LIN linux/run.sh

Notice that for Linux, it runs the run.sh file. If we take a look there, we'll see that ultimately it calls the netstat.py script after checking for an installed version of Python.

...
$pythonCMD netstat.py >> ../results/results.json

So if you rename the sample script, make sure to also update the run.sh file.

For instance, if you write a Python script and name it: your_script.py, you'll want to do two things:

  1. Copy your script file and paste it into the linux folder

  2. Change run.sh to reference your script, as shown below

...
$pythonCMD your_script.py >> ../results/results.json

Next Steps

Now that you have your Action written, it is time to publish it:

Build and Publish

For a more advanced and in depth take on Actions:

Overview

Last updated