Skip to content

Issen007/polaris-slack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Rubrik Polaris Slack Slash Command

Integrate Rubrik Polaris, AWS Lambda, and Slack to automate the creation of new Polaris users.

Polaris Slash Command

Slack Slash Commands require a response within 3 seconds so in order to avoid timeout errors we need to utillize two seperate Lambda functions -- a response function and a worker function.

Response Function: slack_response.py

The main purpose of the slack_response function is to send a 200 status code back to Slack as quickly as possible in order to avoid timeout errors. The function also collects all of the relevant variables and passes those to the worker_function through the Amazon Simple Notification Service (SNS).

The function will be triggered through the Amazon API Gateway that the Slash Command will initially call. The URL provided by the API Gateway will need to be populated in the Request URL field when creating the Slash Command.

Lambda Designer

You'll also need to populate the follow Envrionment variables which will be ready by the function. The kmsEncryptedToken, which corresponds to the Slash Commands Verification Token, and the polaris_password will need to be encrypted.

The sns_arn field corresponds to the Amazon Resource Name of the SNS topic that is subscribed to the worker_function.

Environmental Variables

Worker Function: worker_function.py

Once the worker_function is triggered by Amazon SNS it will parse all of the variables sent by the slack_response function and then validate the information that was provide by the user through Slack. Once those checks have completed it will connect to the Rubrik Polaris account and attempt to create a new user. From there it will send a response to Slack with either a success message or relevant error message in human readable format if possible.

Created and Maintained by the Rubrik Ranger Team

Rubrik Ranger Logo

About

Slack Slash Command to Create a New Polaris User

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%