Code Monkey home page Code Monkey logo

sumocli's People

Contributors

actions-user avatar jburger avatar wizedkyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sumocli's Issues

Support apt, brew and choco for installation

Is your feature request related to a problem? Please describe.
Currently the only way to install sumocli is by download a release from GitHub. This isn't the easiest way to use sumocli as it requires some configuration of path variables etc.

Describe the solution you'd like
Support for apt, brew and choco should be added to allow people using Debain based Linux distros, macOS and Windows to easily install, upgrade and remove sumocli.

Describe alternatives you've considered
The alternative is to use binaries in GitHub to install sumocli however, this isn't effective long term.

Add support for listing all collectors and their sources

Is your feature request related to a problem? Please describe.
When listing all collectors in a sumo logic tenant it would be good to be able to list all the sources that are associated to that collector or a subset of properties.

Describe the solution you'd like
Ideally another command or an argument on the sumocli collectors list command that allows you to retrieve all the sources for that collector.

Describe alternatives you've considered
You can currently use a combination of commands with for loops in bash/powershell to get this data but it would be nice to have a single command.

Support for live tail in console

Is your feature request related to a problem? Please describe.
Sumocli should have the ability to support live tail in the CLI.

Describe the solution you'd like
There should be a command in Sumocli that allows you to start a live tail session.

Describe alternatives you've considered
There is a live tail script provided by Sumo Logic: https://help.sumologic.com/05Search/Live-Tail/Live-Tail-CLI. This is good however, it would be better if this could be imbedded in a single tool.

Export details of a created user

Is your feature request related to a problem? Please describe.
When using the command sumocli users create there is no option to output specific values from the user creation response.

Describe the solution you'd like
Sumo Logic responds with the following JSON payload then a user is created:
{ "firstName": "John", "lastName": "Doe", "email": "[email protected]", "roleIds": [ "00000000000001DF", "00000000000002D2" ], "createdAt": "2020-11-15T22:42:28Z", "createdBy": "0000000006743FDD", "modifiedAt": "2020-11-15T22:42:28Z", "modifiedBy": "0000000006743FE8", "id": "000000000FE20FE2", "isActive": true, "isLocked": false, "isMfaEnabled": false, "lastLoginTimestamp": "2020-11-15T22:42:28Z" }

There should be support added to export fields like id or roleids for use in other commands.

Describe alternatives you've considered
The alternate is the end user would have to use either sumocli users list / get however, this would add extra steps.

Additional context
Further information on the API can be found here: https://api.au.sumologic.com/docs/#operation/createUser

Update build/release process to use Goreleaser

Is your feature request related to a problem? Please describe.
The current build/release process is clunky and requires some manual intervention (not a fun experience!).

Describe the solution you'd like
Goreleaser should replace the current build/release process as it is a lot more efficient and stable: https://goreleaser.com/quick-start/

Describe alternatives you've considered
Goreleaser is nirvana!

Add the ability to set credentials via environment variables

The updated sumocli login is an interactive process that asks for access id and access key and saves them in a creds.json file. This can't be used in a CI/CD pipeline, to provide support for use in CI/CD pipelines the ReadCredentials() func needs to check for environment variables set first then fall back to the interactive process.

Environment variable names:

SUMO_ACCESS_ID
SUMO_ACCESS_KEY
SUMO_ENDPOINT

Viper can be used to read the above environment variables.

Add the ability to have multiple credential profiles

Is your feature request related to a problem? Please describe.
When using Sumocli in an environment with multiple accounts you would need to reconfigure Sumocli everytime you want to jump between an environment.

Describe the solution you'd like
Implement a "profile" ability for the commands to pick which credentials to use when authenticating. This will only affect the creds.json use not ENV variables.

Incorrectly formatted message when credentials are not valid

Describe the bug
When running a command the credentials are not correct the error message is incorrectly formatted

Unauthorized access please check the user exists, are valid.

To Reproduce
Steps to reproduce the behavior:

  1. Add incorrect credentials to the creds file or environment variables
  2. Run any command

Expected behavior
The message should say:

Unauthorized access please check the user exists and the credentials are valid.

Create a logging function

The application needs to output a log file to a OS specific temp path and output logs through the execution of the application.

Basic Functionality

  • Needs to create a new log file or append to one if it already exists
  • Log key application processes
  • Log verbose API responses

Current Logging

Screen Shot 2020-09-19 at 11 51 08 am

Encrypt Sumo Logic API credentials

Is your feature request related to a problem? Please describe.
To authenticate with Sumo Logic credentials need to be written to disk however, currently the credentials are written in plaintext meaning it wouldn't be hard for a bad actor to steal those credentials from the machine and access the Sumo Logic tenancy.

Describe the solution you'd like
Implement some sort of encryption so that the credentials are encrypted on disk and decrypted by Sumocli when required. There will need to be some research on the best way to do this so that the highest level of security is maintained.

Notify if there are no credentials set when running commands

Is your feature request related to a problem? Please describe.
When running commands and there are no environment variable credentials set the application doesn't output a nice response stating there are no creds it just fails on the request and you need to decipher why it failed.

Describe the solution you'd like
If there are no creds it should output something like "There are no credentials set please do xyz"

The command sumocli collectors create doesn't return the JSON response

Describe the bug
When running the sumocli collectors create command it print the JSON response to the stdout. This is because this is tied to the old Azure command which is going to be deprecated.

To Reproduce
Steps to reproduce the behavior:

  1. run sumocli collectors create --name "test"
  2. note there is no output

Expected behavior
The sumocli collectors create command should print a json response to stdout.

Sources API Support

Sources API support is currently limited to Create and List.

Full API support needs to be created.

Add the ability to output the response to JSON, YAML or save to file

Is your feature request related to a problem? Please describe.
Currently the CLI only supports outputting formatted JSON however, people may require outputting to JSON, YAML or saving to file.

Describe the solution you'd like
Update the cmdutils.Output function to support outputting as JSON, YAML or saving to a file in one of the formats.

Remove region selection and replace with automatic selection

Is your feature request related to a problem? Please describe.
sumocli configure currently requires you to select to a region endpoint for the API requests to go to however, sometimes this may not be known or could be entered wrong leading to failures.

Describe the solution you'd like
Remove the code base that hard codes region selection and add code to check which region an access key is related to.

Describe alternatives you've considered
You can hard code the region values in the code base however, this isn't easily maintainable.

Show access id snippet when running sumocli configure

Is your feature request related to a problem? Please describe.
When running sumocli configure you don't know if there is already an existing access id and key or what id and key are being used for authentication.

Describe the solution you'd like
When running sumocli configure it should show the first 2-4 characters of the access id and key so you can identity which credentials are being used for authentication.

Describe alternatives you've considered
Not showing anything is a poor user experience and showing all of the information could lead to security issues.

Add API coverage for library management

Is your feature request related to a problem? Please describe.
Sumocli needs functionality to be able to interact with library elements of Sumo Logic.

Additional context
The following API sections need to be covered:

Support creating Azure infrastructure for log and metric collection

Is your feature request related to a problem? Please describe.
There is no easy way to deploy Sumo Logic collection to Azure without having manually deploy the ARM templates or re-write them in Terraform. This should create collection ability for:

  • logs
  • metrics

Describe the solution you'd like
There should be a command such as sumocli azure create --logs / --metrics

Describe alternatives you've considered
There are other features such as ARM templates and Terraform however, there are problems here as well.

No support for pagination

Is your feature request related to a problem? Please describe.
When running sumocli roles list and it returns more than 100 results there is no way for the cli to obtain the extra results.

Describe the solution you'd like
Pagination support needs to be added to any API calls that support it.

Describe alternatives you've considered
There is the assumption that people may not work with over 100 results but I can see a use case if their reports being run etc.

Additional context
It currently only affects the roles list command.

Add live-tail error handling

Is your feature request related to a problem? Please describe.
The live-tail command works as expected however, it is lacking some error handling based on the response from the API.

Describe the solution you'd like
There needs to be error handling added to the live-tail command to make sure any errors are caught and handled appropriately.

Additional context
Reached out to Sumo Logic to get some clarification around an api spec for the live-tail endpoint.

When outputting list values the output is not formtted correctly

Describe the bug
When an --output is specified for a value that is a list (capabilities, users) the output is not formatted properly.

To Reproduce
To reproduce you need to run a command like: sumocli roles get --filter Administrator --output users

Expected behavior
The output should be formatted to the left and there shouldn't be any JSON syntax left.

Screenshots
image

No name validation for sumocli azure create command

Describe the bug
When using the sumocli azure create command with the --name argument there is no actual restriction on what can be inputted and certain Azure API calls will fail.

To Reproduce
./sumocli.exe azure create --metrics -prefix "IcanPutWhatEverIW@ntHere?"

Expected behavior
There should be an error returned to the user that the name does not conform to restrictions

Add support for new Azure Event Hub collection

Is your feature request related to a problem? Please describe.
Sumo Logic have released a cloud to cloud integration for Azure Event Hubs. The current Azure command deploys an Azure Function to collect data, this should be replaced with the new cloud to cloud integration setup.

Additional context
The Azure source should be restructured under the sources command.

Remove output code from API requests

Is your feature request related to a problem? Please describe.
To simplify code the output code should be removed so a command returns a JSON response which can the be filtered by the user using something like jq.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.