Checkmarx/ast-cli

[BUG] 'cx configure' utility broken in Mac

yangsec888 opened this issue · 2 comments

Describe the bug

The mac cli configure utility is broken

Expected behavior

$ cx configure <---enter user params here
$ cx configure show --> show save user params here

Actual behavior

$ cx configure show --> return empty line

Steps to reproduce

  1. git clone the project in a Macbook (amd64)
  2. follow go build procedure
  3. add the compiled binary path into the shell $PATH
  4. execute the command '$ cx configure' per quickstart document: https://checkmarx.atlassian.net/wiki/spaces/AST/pages/3080487576/CxAST+CLI+Quick+Start+Guide
  5. execute the command '$ cx configure show' per document: https://checkmarx.atlassian.net/wiki/spaces/AST/pages/6046941983/configure+show

Environment

  • CLI version: $ cx version --> 'dev' as of Jan 18 2021
  • Platform (e.g. Windows 10 x64): MacOX amd64

Additional comments

Add any other context about the problem here.

Logs

Paste the output from your CLI. Redact if needed.

MAC-sli:bin sli2$ cx configure
Setup guide: https://checkmarx.atlassian.net/wiki/x/mIKctw

AST Base URI []: https://ast.checkmarx.net/
AST Base Auth URI (IAM) []: https://iam.checkmarx.net/
AST Tenant [organization]: insulet
Do you want to use API Key authentication? (Y/N): Y
AST API Key []: xxxmasked-for-safety-xxx
MAC-sli:bin sli2$ cx configure show
Current Effective Configuration
BaseURI:
BaseAuthURIKey:
AST Tenant: organization
Client ID:
Client Secret:
APIKey:
Proxy:
MAC-sli:bin sli2$ ls -l ~/.checkmarx/
MAC-sli:bin sli2$ cx --version
2022/01/18 11:01:51 unknown flag: --version
MAC-sli:bin sli2$ cx --v
2022/01/18 11:01:56 unknown flag: --v
MAC-sli:bin sli2$ cx --help
The AST CLI is a fully functional Command Line Interface (CLI) that interacts with the Checkmarx CxAST server.

USAGE
cx [flags]

COMMANDS
auth: Validate authentication and create OAuth2 credentials
configure: Configure authentication and global properties
help: Help about any command
project: Manage projects
result: Retrieve results
scan: Manage scans
triage: Manage results
utils: Utility functions
version: Prints the version number

FLAGS
--agent string Scan origin name (default "ASTCLI")
--apikey string The API Key to login to AST
--base-auth-uri string The base system IAM URI
--base-uri string The base system URI
--client-id string The OAuth2 client ID
--client-secret string The OAuth2 client secret
--debug Debug mode with detailed logs
-h, --help help for cx
--insecure Ignore TLS certificate validations
--profile string The default configuration profile (default "default")
--proxy string Proxy server to send communication through
--proxy-auth-type string Proxy authentication type, (basic or ntlm)
--proxy-ntlm-domain string Window domain when using NTLM proxy
--retry uint Retry requests to AST on connection failure (default 3)
--retry-delay uint Time between retries in seconds, use with --retry (default 3)
--tenant string Checkmarx tenant
--timeout string Timeout for network activity, (default 5 seconds)

EXAMPLES
$ cx configure
$ cx scan create -s . --project-name my_project_name
$ cx scan list

DOCUMENTATION
https://checkmarx.atlassian.net/wiki/x/MYDCkQ

QUICK START GUIDE
https://checkmarx.atlassian.net/wiki/x/mIKctw

ENVIRONMENT VARIABLES
See 'cx utils env' for the list of supported environment variables.

LEARN MORE
Use 'cx --help' for more information about a command.
Read the manual at https://checkmarx.atlassian.net/wiki/x/MYDCkQ

MAC-sli:bin sli2$ cx version
dev

@yangsec888 Thanks for pointing this out. The folder permissions were not correct. We fixed it in #333.