icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading CLI Auto for Splunk
SHA256 checksum (cli-auto-for-splunk_305.tgz) bb5077ea9f6973b7bff63a5b2523fcbc03ca19d6d995622f19aa6b37d76a1124 SHA256 checksum (cli-auto-for-splunk_304.tgz) a21b6135bfb2d38f31a910d785f07fadde4aecbe2456756922fa0f4ef1fee671 SHA256 checksum (cli-auto-for-splunk_303.tgz) 5d6e1744d2cd7e4b29ff241312949cf6964225d5abf401bafe391adf68dbfeba SHA256 checksum (cli-auto-for-splunk_207.tgz) 9bcb2780fc7f281341ef4eaa551e6017eb7b48a26715589367b892be49d0c86e SHA256 checksum (cli-auto-for-splunk_205.tgz) 75be28fdfb9807c2c98d7d64bc0d5d9a83e8e61a37935a02850cad89c95f8e06 SHA256 checksum (cli-auto-for-splunk_204.tgz) f88b6ff22d2fa099007af9f371125309938b97d92f611640841db11636aa10af SHA256 checksum (cli-auto-for-splunk_203.tgz) ebec2eb26461af6bf276b44ee44767c9cedca0846ab4a914640b28421ac74282 SHA256 checksum (cli-auto-for-splunk_119.tgz) 4c3eb91811b30372a37749bf36f2672391f78fb2c9a371ac84386c9f7ae3d8cd SHA256 checksum (cli-auto-for-splunk_115.tgz) 9980b1ee4bf6544bd298fd60f1d18d73306d240f473faae2d7accd99b1f64e46 SHA256 checksum (cli-auto-for-splunk_110.tgz) 3e0891b51369e7974c636ae3370a124e595ded24e37382d469437b0daf1dbf79 SHA256 checksum (cli-auto-for-splunk_1011.tgz) f84062addf86b5cc6fd8dec10ca431a5249829ee90bcd95ca231f6612027c765 SHA256 checksum (cli-auto-for-splunk_109.tgz) dc7f66271cea3292ad9196739e7ffe8541022e09b02b02048bf158ba7e7b8211
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

CLI Auto for Splunk

This app has been archived. Learn more about app archiving.
This app is NOT supported by Splunk. Please read about what that means for you here.
Overview
Details
**For CLI Auto versions 2.0.8 or greater, CLI Auto was split into 2 apps (i.e. the CLI Auto and CLI Auto Add-on apps) to add Splunk distributed/cluster environment features. So, it is required that both apps be installed for versions 2.0.8 or greater. Versions 2.0.8 or greater are not backwards compatible with versions 2.0.7 or older.**

For the less technically informed, CLI stands for "Command Line Interface" while "Auto" is a reference to automation.

If you answer "Yes" to any of the following questions, you may want to consider downloading/installing this app with the assistance of your local friendly Splunk administrator/power user.

- Do you manage/support several (10+, 100+, 1000+, etc.) network devices that have a CLI (Command Line Interface)?
- Has your team been requested to meet a compliance mandate (e.g. periodic password change) for your numerous CLI compatible network devices ?
- Does your team spend numerous man hours performing management/support tasks on network devices that might be solved by automation via CLI?

For those folks that have had the good fortune to work/study within the IT networking and/or cyber security fields, you probably are aware that several brands/models of networking devices have a CLI (Command Line Interface). Examples of network devices are firewalls, routers, switches, gateways, servers, wireless access points, workstations/laptops, etc. Also you may be aware, the more modern network devices typically use the ssh (Secure Shell) protocol to secure a CLI network session. It should be noted that this app only supports the ssh CLI protocol. In other words, this app does not support other CLI protocols like Telnet.

For the more technically minded, the CLI Auto app provides a job engine (via a custom REST API endpoint) and an user interface to connect to several nodes (hosts) via ssh to execute and index (i.e. log to Splunk) the output of a Command Type (i.e. a set of CLI commands).

CLI Auto

About

The CLI Auto and CLI Auto Add-on apps provide a job engine (via a custom REST API endpoint) and an user interface to connect to several nodes (hosts) via ssh to execute and index (i.e. log to Splunk) the output of a Command Type (i.e. a set of CLI commands). Each Command Type configuration defines the set of CLI command(s), user input variables, data validation, success/failure regular expressions, and other configuration settings for the associated Command Type. Only a few Command Types were included in the initial version of the app; however, the app allows an user to develop and add more Command Types. With the wide support of CLI (ssh), the possible Command Types are numerous. It should be noted that the initial development of this app was geared toward user management CLI commands for Checkpoint, Palo Alto, and Sonicwall firewalls. The intent of this app is not to be a replacement for any management tools for these firewall brands or any other network device that supports CLI.
For CLI Auto versions 2.0.8 or greater, CLI Auto was split into 2 apps (i.e. the CLI Auto and CLI Auto Add-on apps) to add Splunk distributed/cluster environment features. So, it is required that both apps be installed for versions 2.0.8 or greater. Versions 2.0.8 or greater are not backwards compatible with versions 2.0.7 or older. For a single Splunk server environment, both the CLI Auto and CLI Auto Add-on apps are installed on the same server. For a distributed Splunk environment, it is recommended that the CLI Auto app is installed on a Search Head (SH) and/or a Deployer is used to deploy the CLI Auto app to the members of a Search Head cluster. In addition, the CLI Auto Add-on app is recommended to be installed on a Heavy Forwarder (HF) referred to as a Remote Addon Server in the CLI Auto app. As an example use case, the add features allow the CLI Auto Add-on app be installed on multiple HFs to run CLI commands on network nodes in multiple segmented networks which have the same subnets with the CLIAuto app being the common UI.

Dependencies

  • The CLI Auto and CLI Auto Add-on applications were developed on a Linux OS VM (CentOS) with a Splunk Dev environment. Due to limited resources, no development/testing at all was done against the Splunk Windows OS environment.

  • The Pexpect (pxssh) libraries (i.e. provide the ssh connection) were built for the CentOS hosting the Splunk dev environment and copied to the $SPLUNK_HOME/etc/apps/cliauto_addon/bin folder. The Openssh app (included with several Linux OS distros) is a dependency of the Pexpect (pxssh) libraries. And as of this writing, the ptyprocess libraries are a dependency for the Pexpect (pxssh) libraries; so the ptyprocess libraries were built for the OS hosting the Splunk dev environment and copied to the $SPLUNK_HOME/etc/apps/cliauto_addon/bin folder also. For most Linux OS Splunk installations, the /opt/splunk folder is the default value for the $SPLUNK_HOME environment variable.

  • The Splunk Python SDK libraries provide intergration to the Splunk environment for the job engine (reference the $SPLUNK_HOME/etc/apps/app_name/bin/splunklib and $SPLUNK_HOME/etc/apps/app_name/bin/utils folders - app_name is cliauto and cliauto_addon).

  • The Bootstrap (JS and CSS files) and Splunk Javascript SDK libraries help to provide front-end (UI) components (reference the $SPLUNK_HOME/etc/apps/cliauto/appserver/static folder).

  • The CLI Auto app was developed using the Chrome web browser. No testing/development was done with other web browsers.

Usage

The CLI Auto dashboard provides an user interface (UI) to start and monitor submitted jobs. To get the help notes for the UI, hover your cursor over the input fields and job record table headers to display the associated tooltip. Enter a Script User, enter a Script Password, select a Node List KVStore CSV Lookup file (see the instructions below to create the Node List file), and select a Command Type.

Alt text

Addon Server

Select the Addon Server that will execute your job. For a single server environment, select the local Addon server. The Config dashboard can be used to configure a remote Addon Server(s) for the CLI Auto app. A remote Addon server is a Splunk Heavy Forwarder with the CLI Auto Add-on app installed. This input is available for CLI Auto app versions 2.0.8 or greater.

Alt text

Script Username

Enter the username that has permissions to login via to all of the nodes in the Node List. The tooltips are defined in the cliauto.conf (CLI Auto app) and cliauto_cmds.conf (CLI Auto Add-on app) files.

Alt text

Script Password

Enter the password for the Script username.

Alt text

Command Type

Select the CLI command(s) to be executed in the Command Type field. (example: SWFW Show Version)

Alt text

Node List

The KVStore Lookup CSV file needs to contain a header record with 2 columns named host and ip_address. Please see the example in the screenshot below.

Alt text

To create the KVStore Lookup CSV file within Splunk, click Settings->Lookups.

Alt text

Click Add New for Lookup table files.

Alt text

Select cliauto for the Destination app, click the Choose File button to select your Node List CSV file, give the Destination file an appropiate name, and click Save.

Alt text

Verify that the KVStore Lookup table file was successfully saved.

Alt text

Alt text

Note: Splunk has other ways to create a KVStore Lookup file (a search command, other apps, etc.)

In the dashboard, select the KVStore CSV Lookup file that contains the nodes for the Command Type.

Submit Button

Click the Submit button to process the job.

Alt text

Submit Confirm

Please type yes to confirm and submit job.

Alt text

Permissions

If you receive a popup similar to the ones below, your username may not have the proper permissions. Please see the Security section below with info to request your Splunk administrator for the proper access to the app.

Alt text

Alt text

Wait for the job to complete (and be searchable within Splunk)

The Status at the top of the dashboard and the status column of the job history table displays status info about the job. The Status at the top of the dashboard is the overall status of the job which includes the Addon server completing the job and the job events being searchable within Splunk. The status column of the job history table is the status of the Addon server completing the job.

Alt text

Job Results

To view the results for a job, click All, Success, or Fail to open the Splunk search app and execute the search with the filters provided in the respective url link. You can also find the job's results that were indexed to Splunk by creating you own search string (SPL) in the Splunk Search app with the index, source, sourcetype, and Job Id as filters. For example in the screenshot, index=main source=cliauto sourcetype=cliauto_ssh jobid=5bce1418e1382395b6480856. The default index, source and sourcetype for the app are index=main, source=cliauto and sourcetype=cliauto_ssh; so if you changed them in the CLI Auto app's conf file $SPLUNK_HOME/etc/apps/cliauto/default/cliauto.conf, your SPL search string will need to reflect your changes.

Alt text

The "result" field

The "result" field in the job results is controlled by the success and failure regular expressions for the associated Command Type. The primary purpose of the "result" field is to provide a method to sort the job results to allow for an user to more quickly identify any possible next actions.

Alt text

Dependencies install instructions (as needed)

For ssh support, you need the ptyprocess and Pexpect (pxssh) python modules for this app, and are included in the installation files. However if needed, they can be downloaded from here and here.

Due to the limited module set installed with Splunk's Python instance, you may need to build these modules with a second installation of Python. Once you've built the modules you will need to copy the build/lib/ptyprocess and the build/lib/pexpect directories into your $SPLUNK_HOME/etc/apps/cliauto_addon/bin directory. Also, the Splunk Python SDK libraries need to exist in the $SPLUNK_HOME/etc/apps/cliauto_addon/bin directory.

Follow build instructions on the respective sites.  No need to install. Instructions should be the same
for both modules:
    cd $BUILD/pexpect-4.6.0
    python setup.py build
    cd $BUILD/ptyprocess-0.6.0
    python setup.py build

Copy the respective directories to $SPLUNK_HOME/etc/apps/cliauto_addon/bin 
    cp -Rf $BUILD/pexpect-4.6.0/build/lib/pexpect $SPLUNK_HOME/etc/apps/cliauto_addon/bin
    cp -Rf $BUILD/ptyprocess-0.6.0/build/lib/ptyprocess $SPLUNK_HOME/etc/apps/cliauto_addon/bin

Restart splunk.

Application Data Flow, Main Execution Path, and Threads

The 5 diagrams below show the data flow, main execution path, and threads for the applications.

Alt text

Alt text

Alt text

Alt text

Alt text

Security

  • The CLI Auto app is secured with the cliauto_custom_endpoint capability and the cliauto_user role. It should be noted that the list_storage_passwords capability is included in the cliauto_user role to allow the app to read the password for the configured username/password credentials of a remote addon server. It is suggested in the interest of "least privilege" that the list_storage_passwords capability be disabled for the cliauto_user role if not needed. Contact your Splunk administrator to grant your Splunk user account the cliauto_user role to gain the required capabilities for the app.

  • Like any app, the level of security has a dependence on the environment used to host the app. So, it is suggested that the dependenices (see above) be updated periodically with their respective security patches/fixes.

  • For security reasons, it is recommended that the Custom (cli_custom) cmdtype be disabled in the cliauto_cmds.conf file unless needed for your use cases and proper security controls are in place. The intent of the Custom (cli_custom) cmdtype is to provide Splunk administrators/power users a tool to develop their own cmdtypes.

  • The data input validation for the app is to help guard against malicious and/or unintended uses. If your use case(s) requires data input that is blocked by the data input validation, the conf files may have a setting that can be modified to allow it. If not, you are welcome to suggest a new feature.

  • Some security related options of the ssh client (pexpect/pxssh library) are included in the cliauto.conf file, and should be reviewed/set for your environment/use cases. If more options are needed for your use case, a feature request is suggested.

  • It should be noted that the login function of the pexpect (pxssh) library was overridden for the app to account for specific use cases.

  • If you have suggestions to improve the security of the app, please contact support.

Application Performance

Using a Splunk VM on a laptop, the app has successfully executed several jobs with 300+ unique hosts and MaxThreads setting = 75 for multiple Command Types. A job with 1000 hosts (with non-active ip_addresses) was tested successfully also. Please let me know your feedback on the performance of the application.

Command Types

It should be noted that the app allows for additional Command Types to be configured by Splunk Administrators/Power Users. The configuration of each included Command Type (cmdtype) can be found in the cliauto_cmds.conf file in the $SPLUNK_HOME/etc/apps/cliauto_addon/default folder. Each cmdtype configuration defines the CLI command(s), user input variables, data validation, success/failure regular expressions, and other configuration settings for the associated cmdtype. Per the "configuration file precedence" design feature of Splunk, it is recommended that new cmdtypes (or changes) be done by creating a $SPLUNK_HOME/etc/apps/cliauto_addon/local folder and conf file with the same filename (cliauto_cmds.conf). The contents of the new conf file must contain the stanza (aka cmdtype) along with the configuration setting. Also, please reference the cliauto_cmds.conf.spec file in the $SPLUNK_HOME/etc/apps/cliauto_addon/README folder for a description of the configuration settings.

Limitations and/or Known Issues

  • The app's custom REST API endpoint (job engine) uses the user's session credentials for access to the Splunk environment. These session credentials expire based on the Splunk Session timeout setting (see Settings->Server settings->General settings->Session timeout in Splunk UI) which has a default setting of 1 hour. If a job's exectution time is longer than the Session timeout setting, the job may fail due to losing access to the Splunk environment. It is not expected that any properly configured job would last longer than the default setting of 1 hour, but please be aware of this limitation of Splunk and/or the app.
  • This issue only impacts the inspection/certification (i.e. "Splunk AppInspect Passed" badge on splunkbase website) of the "CLI Auto for Splunk" app by the online Splunk AppInspect app, but not the functionality of the "CLI Auto for Splunk" or "CLI Auto Add-on for Splunk" apps. As of this writing, the online Splunk AppInspect app contains a issue that fails an app which does not have a python.version=python3 key/value pair for ALL stanzas in the restmap.conf file even if the python.version key is not defined for the stanza. The workaround was to add the python.version=python3 key/value pair to ALL stanzas in the restmap.conf file, and add the python.version key in a restmap.conf.spec file to prevent "Invalid key" messages from the btool app.

Support/Suggestions

Contact the developer- 3tressoftware@gmail.com

Release Notes

Version 3.0.5
Aug. 5, 2021

Per Splunk (JQuery 3.5+) requirement, added version=1.1 to dashboard tag in dashboard files

Version 3.0.4
Oct. 15, 2020
  • Fixed http encoding from cliauto to cliauto_addon app bug (reqtype cli changed to encoded_cli)
Version 3.0.3
May 21, 2020
  • For CLI Auto versions 2.0.8 or greater, CLI Auto was split into 2 apps (i.e. the CLI Auto and CLI Auto Add-on apps) to add Splunk distributed/cluster environment features. So, it is required that both apps be installed for versions 2.0.8 or greater. Versions 2.0.8 or greater are not backwards compatible with versions 2.0.7 or older.
Version 2.0.7
Feb. 21, 2020
  • Improved get_stanzas method and test scripts
  • Fixed issue with status Command Type
Version 2.0.5
Feb. 6, 2020
  • Fixed issue to prevent other apps from removing permissions for the cliauto_user role to read the apps.conf key value pairs
  • Tightened security of cliauto app knowledge objects with the cliauto_user role
Version 2.0.4
Jan. 31, 2020
  • Added Show Password checkbox to the Script Password input
  • Fixed LD_LIBRARY_PATH environment variable bug impacting Ubuntu (& possibly other Debian based Linux distros)
Version 2.0.3
Oct. 30, 2019
  • Renamed branching regex key/value pair and added "select" key/value pair to allow nested branching
    Note: If your custom Command Types include branching, you will need to use the new branching key/value pairs for this version (& future versions) of CLI Auto for Splunk
  • Updates for Splunk 8.0 (Python 3) and added About dashboard
  • Added feature to enable ingestion of multiple Splunk events per host
  • Added feature to add a custom search url(s) to UI
  • Updated "SWFW Admin Password Change" Command Type to support "admin password" and "admin-password" CLI command
  • Updated "SWFW Show Version & License Status" Command Type to ingest data to multiple events per host to improve data format
  • Added "SWFW Show Version & Access-Rules Statistics" Command Type
  • Updated Checkpoint firewall Command Types to support Gaia & Expert shells (and limited legacy support of SPLAT shell)
  • Added a few more other Command Types
  • Added feature to use host/node ip address in cliauto_cmds.conf regex key/value pairs
Version 1.1.9
June 5, 2019
  • Added statistics output fields and Stats (statistics) search url link for login & CLI command timers
  • Added branch capability to execute alternate CLI commands based on output of a CLI commands
  • Added "CPFW Show Version - dmidecode" Command Type
  • Added max_output_before_truncate parameter to allow custom truncation of CLI command output
  • Increased default ssh login ConnectTimeout from 15 to 25 seconds
  • Increased default cli_cmd_delay (pexpect timeout) from 5 to 10 seconds
  • Increased default PAFW "show config diff" & "commit" cli_cmd_delay from 60 to 120 seconds
  • Various enhancements to default CPFW and PAFW Command Types
Version 1.1.5
March 19, 2019
  • Added/updated PAFW command types to handle Palo Alto HA (Active-Passive) and HA (Active-Active) firewall node pairs
  • Updated "CPFW Set Expert Password" to check current password
  • Added "CPFW Verify Expert Mode"
  • Added "Check ssh Key Exchange" - uses openssh verbose debug log; so YMMV on the output
  • Updated "Check ssh Port Open" to include retries
  • Added Tours
  • Changed default number of jobs displayed on the UI from 20 to 50
  • Changed app’s default max log file size from 25MB to 2MB
  • Added HostKeyChanged, MaxHostsExceeded, & NoCipherFound exceptions to ssh login for more detail of failure reason
Version 1.1.0
Jan. 28, 2019
  • All changes were to conf files only (i.e. no Python source code changes)
  • Added "CPFW Add User", "CPFW Delete User", "CPFW Verify Config Lock", and "CPFW Verify No Pending Changes" Command Types
  • Added "Commit all pending configuration changes?" checkbox to CPFW Command Types that execute the "save config" CLI command
  • Changed/improved fail regex variables for CPFW Command Types
  • Changed ui_job_rows variable in the cliauto.conf file from a value of 10 to 20 which configures the UI to display the history of the last 20 jobs
Version 1.0.11
Jan. 15, 2019
  • Added UI tooltips
  • Renamed the pexpect _async.py file (contains Python 3.x code) to prevent the Splunk AppInspect app from inspecting the file which causes the app to fail Splunk AppInspect inspection.
Version 1.0.9
Jan. 2, 2019
  • Bug fix for timestamp sort in UI
  • Updated info in Help dashboard

Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk LLC in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.