sumologic-labs / sumocli Goto Github PK
View Code? Open in Web Editor NEWSumocli is a CLI application written in Go that allows you to manage your Sumo Logic tenancy from the command line.
License: Apache License 2.0
Sumocli is a CLI application written in Go that allows you to manage your Sumo Logic tenancy from the command line.
License: Apache License 2.0
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:
Expected behavior
The message should say:
Unauthorized access please check the user exists and the credentials are valid.
Support for the entire roles api needs to be added, API documentation for roles is here: https://api.au.sumologic.com/docs/#tag/roleManagement
Looks like many of the SL API have rate limiting. https://help.sumologic.com/APIs/Collector-Management-API/Collector-API-Methods-and-Examples#response-fields
While it is early in the project, it might be worth considering baking in support for throttling requests sent by the CLI to assist in rate limit avoidance.
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.
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.
Support for Dynamic Parsing API needs to be added.
As title.
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.
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
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.
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:
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.
A lookup-tables upload command needs to be added to support uploading CSV files to a lookup table.
Support for SAML Configuration API needs to be added.
The build pipeline needs to be reworked using GoReleaser: https://goreleaser.com/quick-start/
Support for the entire users api needs to be added, API documentation for users is here: https://api.au.sumologic.com/docs/#tag/userManagement
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.
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.
https://sumodojo.slack.com/archives/C1KQDCEHE/p1620010613477700
Request came through Sumo Dojo to allow the option to output JSON as a single message not formatted.
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:
sumocli collectors create --name "test"
Expected behavior
The sumocli collectors create
command should print a json response to stdout.
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!
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.
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.
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:
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.
Support for Field Management API needs to be added.
Support for Partitions API needs to be added.
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
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"
Support for Archive Ingestion Management API needs to be added.
Support for Scheduled Views API needs to be added.
Support for Transformation Rules API needs to be added.
Support for the entire collectors and source apis needs to be added, documentation for the APIs can be found here:
Collectors: https://help.sumologic.com/APIs/Collector-Management-API/Collector-API-Methods-and-Examples
Sources: https://help.sumologic.com/APIs/Collector-Management-API/Source-API
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.
Describe the bug
When deploy Azure infrastructure to collect Azure metrics the infrastructure is tagged with the logs tags.
Support for Log Search Estimated Usage API needs to be added.
Sources API support is currently limited to Create and List.
Full API support needs to be created.
Support for Metrics Searches API needs to be added.
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.
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.
Support for Field Extraction Rules API needs to be added.
Support for Health Events API needs to be added.
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.
The region key in creds.json is not used therefor it can be dropped from the code.
Support for Account API needs to be added.
Support for Password Policy API needs to be added.
Support for Monitor API needs to be added.
Support for Connections (Beta) API needs to be added.
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 Ingest Budgets and Ingest Budgets v2 API needs to be added.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.