Splunk® Machine Learning Toolkit

User Guide

Managing algorithm permissions in the Splunk Machine Learning Toolkit

In the Splunk Machine Learning Toolkit, you can define the read permissions for each algorithm. Read permissions dictate whether a user can access the algorithms. Administrators have write permissions by default. To change permission settings, either modify the REST API ACL endpoint in the algos.conf file, or modify the manual configuration of local.meta file.

Manage permissions in REST API

The following example uses the KMeans algorithm. This process works the same way with any algorithm in the Splunk Machine Learning Toolkit.

  1. To change the algorithm settings, modify the API ACL endpoint in the algos.conf file.
    1. To assign read permissions to all roles:
      $ curl -k -u admin:<admin password> \
             https://localhost:8089/servicesNS/nobody/Splunk_ML_Toolkit/configs/conf-algos/KMeans/acl \
             -d owner=nobody \
             -d sharing=app \
             -d perms.read=*
      
    2. To assign read permissions to the user and power role:
      $ curl -k -u admin:<admin password> \
             https://localhost:8089/servicesNS/nobody/Splunk_ML_Toolkit/configs/conf-algos/KMeans/acl \
             -d owner=nobody \
             -d sharing=app \
             -d perms.read=user,power
      
  2. You do not need to restart splunkd after you change the permission settings in the REST API.

The read permission in the REST API also controls the GET method. If you are unfamiliar with the REST method subset, see HTTP Status Codes in the Rest API User Manual. For more information on ACL REST API endpoint, see Access Control list in the REST API User Manual.

Manage permissions manually in the configuration file

You cannot modify the default.meta file directly. Instead, you can make changes in the local.meta file, and the new content will override the default.meta file. For further information on the structure of the default.meta file, see default.meta.conf in the Admin Manual.

The following example uses the KMeans algorithm. This process works the same way with any algorithm in the Splunk Machine Learning Toolkit.

  1. If you do not have a local.meta file, create one.
  2. Open the local.meta file.
    $SPLUNK_HOME/etc/apps/Splunk_ML_Toolkit/metadata/local.meta
    
    1. To assign read permissions to all roles:
      [algos/KMeans]
      access = read : [ * ]
      
    2. To assign read permissions to the user and power roles:
      [algos/KMeans]
      access = read : [ user,power ] 
      
  3. Restart splunkd.

The process to change permissions in the REST API endpoint also changes the content of a local.meta file in the directory.

$SPLUNK_HOME/etc/apps/Splunk_ML_Toolkit/metadata
Last modified on 14 November, 2023
Import a machine learning algorithm from Splunkbase   Algorithm support of key ML-SPL commands quick reference

This documentation applies to the following versions of Splunk® Machine Learning Toolkit: 4.4.0, 4.4.1, 4.4.2, 4.5.0, 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.2.2, 5.3.0, 5.3.1, 5.3.3, 5.4.0, 5.4.1, 5.4.2, 5.5.0


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters