Skip to content

Commit

Permalink
Renaming AST to ONE (#484)
Browse files Browse the repository at this point in the history
* Renaming Cx AST to ONE

* Renaming AST to ONE - CI

* Renaming AST to One

* Renaming AST to Checkmarx One

* Renaming Checkmarx One
  • Loading branch information
igorlombacx authored Jan 16, 2023
1 parent d606375 commit 4b8cf9d
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AST CLI
name: Checkmarx One CLI

on:
pull_request:
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/ast-scan.yml → .github/workflows/one-scan.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Checkmarx AST Scan

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
cx-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkmarx AST CLI Action
uses: checkmarx/ast-github-action@main
with:
base_uri: ${{ secrets.AST_RND_SCANS_BASE_URI }}
cx_tenant: ${{ secrets.AST_RND_SCANS_TENANT }}
cx_client_id: ${{ secrets.AST_RND_SCANS_CLIENT_ID }}
cx_client_secret: ${{ secrets.AST_RND_SCANS_CLIENT_SECRET }}
additional_params: --tags galactica-team --threshold "sast-high=1"
name: Checkmarx One Scan

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
cx-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkmarx One CLI Action
uses: checkmarx/ast-github-action@main
with:
base_uri: ${{ secrets.AST_RND_SCANS_BASE_URI }}
cx_tenant: ${{ secrets.AST_RND_SCANS_TENANT }}
cx_client_id: ${{ secrets.AST_RND_SCANS_CLIENT_ID }}
cx_client_secret: ${{ secrets.AST_RND_SCANS_CLIENT_SECRET }}
additional_params: --tags galactica-team --threshold "sast-high=1"
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project_name: ast-cli

release:
name_template: "AST CLI {{.Version}}"
name_template: "Checkmarx One CLI {{.Version}}"

builds:
- main: ./cmd/main.go
Expand Down Expand Up @@ -84,7 +84,7 @@ brews:
token: "{{ .Env.GO_BOT_TOKEN }}"
folder: Formula
homepage: https://github.com/Checkmarx/ast-cli
description: CLI for AST
description: CLI for Checkmarx One
license: Apache
test: |
system "#{bin}/cx version"
Expand Down
55 changes: 37 additions & 18 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Contributing to AST CLI
# Contributing to Checkmarx One CLI

Welcome and thank you for considering contributing to the AST CLI

Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing these open source projects. In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull requests.
Welcome and thank you for considering contributing to the Checkmarx One CLI

Reading and following these guidelines will help us make the contribution process easy and effective for everyone
involved. It also communicates that you agree to respect the time of the developers managing and developing these open
source projects. In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping
you finalize your pull requests.

## Quicklinks

- [Contributing to AST CLI](#contributing-to-ast-cli)
- [Contributing to Checkmarx One CLI](#contributing-to-checkmarx-one-cli)
- [Quicklinks](#quicklinks)
- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
Expand All @@ -19,55 +21,72 @@ Reading and following these guidelines will help us make the contribution proces

## Code of Conduct

By participating and contributing to any Checkmarx projects, you agree to uphold our [Code of Conduct](code_of_conduct.md).
By participating and contributing to any Checkmarx projects, you agree to uphold
our [Code of Conduct](code_of_conduct.md).

## Getting Started

If you have suggestions for how this project could be improved, or want to report a bug, open an issue. We appreciate all contributions. If you have questions, we'd love to hear them.
If you have suggestions for how this project could be improved, or want to report a bug, open an issue. We appreciate
all contributions. If you have questions, we'd love to hear them.

We also appreciate PRs. If you're thinking of submitting any PR, pleae open an issue first to spark a discussion around it.
We also appreciate PRs. If you're thinking of submitting any PR, pleae open an issue first to spark a discussion around
it.

Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both:
Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both:

- Search for existing Issues and PRs before creating your own to avoid duplicates.
- PRs will only be accepted if associated with an issue (enhancement or bug) that has been submitted and reviewed/labeld as *accepted* by a Checkmarx team member.
- PRs will only be accepted if associated with an issue (enhancement or bug) that has been submitted and reviewed/labeld
as *accepted* by a Checkmarx team member.
- We will work hard to makes sure issues that are raised are handled in a timely manner.

## Issues

Issues should be used to report problems with the solution / source code, request a new feature, or to discuss potential changes before a PR is created. When you create a new Issue, a template will be loaded that will guide you through collecting and providing the information we need to investigate.
Issues should be used to report problems with the solution / source code, request a new feature, or to discuss potential
changes before a PR is created. When you create a new Issue, a template will be loaded that will guide you through
collecting and providing the information we need to investigate.

If you find an Issue that addresses the problem you're having, please add your own reproduction information to the existing issue rather than creating a new one. Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help by indicating to our maintainers that a particular problem is affecting more than just the reporter.
If you find an Issue that addresses the problem you're having, please add your own reproduction information to the
existing issue rather than creating a new one. Adding
a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help by
indicating to our maintainers that a particular problem is affecting more than just the reporter.

### Templates

The following templates will be used within Checkmarx github repositories

- [Enhancement/Feature Request Template](../.github/ISSUE_TEMPLATE/enhancement-request.md)
- [Bug Report Template](../.github/ISSUE_TEMPLATE/bug_report.md)

## Pull Requests

PRs to our source are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should:
PRs to our source are always welcome and can be a quick way to get your fix or improvement slated for the next release.
In general, PRs should:

- Only fix/add the functionality in question **or** address code style issues, not both.
- Ensure all necessary details are provided and adhered to
- Add unit or integration tests for fixed or changed functionality (if a test suite already exists) or specify steps taken to ensure changes were tested and functionality works as expected.
- Add unit or integration tests for fixed or changed functionality (if a test suite already exists) or specify steps
taken to ensure changes were tested and functionality works as expected.
- Address a single concern in the least number of changed lines as possible.
- Include documentation in the repo or Provide additional comments in Markdown comments that should be pulled/reflected in GitHub Wiki for the given project.
- Include documentation in the repo or Provide additional comments in Markdown comments that should be pulled/reflected
in GitHub Wiki for the given project.
- Be accompanied by a complete Pull Request template (loaded automatically when a PR is created).

For changes that address core functionality or would require breaking changes (e.g. a major release), please open an Issue to discuss your proposal first.
For changes that address core functionality or would require breaking changes (e.g. a major release), please open an
Issue to discuss your proposal first.

In general, we follow the _fork-and-pull_ Git workflow

1. Fork the repository to your own Github account
2. Clone the project to your machine
3. Create a branch locally with a succinct but descriptive name (prefix with feature/<issue#>-descriptive-name> or hotfix/<issue#>-descriptive-name)
3. Create a branch locally with a succinct but descriptive name (prefix with feature/<issue#>-descriptive-name> or
hotfix/<issue#>-descriptive-name)
4. Commit changes to the branch
5. Push changes to your fork
6. Open a PR in our repository and follow the PR template so that we can efficiently review and asses the changes. *Ensure an associated Issue has been accepted by the Checkmarx team.*
6. Open a PR in our repository and follow the PR template so that we can efficiently review and asses the changes. *
Ensure an associated Issue has been accepted by the Checkmarx team.*

### Templates

The following template will be used within Checkmarx github repositories

[Pull Request Template](../.github/PULL_REQUEST_TEMPLATE.md)
Expand Down
12 changes: 6 additions & 6 deletions internal/commands/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
const (
failedCreatingClient = "failed creating client"
pleaseProvideFlag = "%s: Please provide %s flag"
SuccessAuthValidate = "Successfully authenticated to AST server!"
SuccessAuthValidate = "Successfully authenticated to Checkmarx One server!"
adminClientID = "ast-app"
adminClientSecret = "1d71c35c-818e-4ee8-8fb1-d6cbf8fe2e2a"
FailedAuthError = "Failed to authenticate - please provide client-id, client-secret and base-uri or apikey"
Expand Down Expand Up @@ -46,7 +46,7 @@ func NewAuthCommand(authWrapper wrappers.AuthWrapper) *cobra.Command {
Example: heredoc.Doc(
`
$ cx auth validate
Successfully authenticated to AST server!
Successfully authenticated to Checkmarx One server!
$ cx auth register -u <Username> -p <Password> --base-uri https://<Keycloak server URI>
CX_CLIENT_ID=XX
CX_CLIENT_SECRET=XX
Expand All @@ -67,7 +67,7 @@ func NewAuthCommand(authWrapper wrappers.AuthWrapper) *cobra.Command {
}
createClientCmd := &cobra.Command{
Use: "register",
Short: "Register new OAuth2 client for ast",
Short: "Register new OAuth2 client for Checkmarx One",
Long: "Register new OAuth2 client and outputs its generated credentials in the format <key>=<value>",
Example: "$ cx auth register -u <Username> -p <Password> -r ast-admin,ast-scanner",
Annotations: map[string]string{
Expand All @@ -80,11 +80,11 @@ func NewAuthCommand(authWrapper wrappers.AuthWrapper) *cobra.Command {
RunE: runRegister(authWrapper),
}
createClientCmd.PersistentFlags().StringP(
params.UsernameFlag, params.UsernameSh, "", "Username for Ast user that privileges to "+
params.UsernameFlag, params.UsernameSh, "", "Username for Checkmarx One user that privileges to "+
"create clients",
)
createClientCmd.PersistentFlags().StringP(
params.PasswordFlag, params.PasswordSh, "", "Password for Ast user that privileges to "+
params.PasswordFlag, params.PasswordSh, "", "Password for Checkmarx One user that privileges to "+
"create clients",
)
createClientCmd.PersistentFlags().StringP(
Expand All @@ -102,7 +102,7 @@ func NewAuthCommand(authWrapper wrappers.AuthWrapper) *cobra.Command {
validLoginCmd := &cobra.Command{
Use: "validate",
Short: "Validates authentication",
Long: "Validates if CLI is able to communicate with AST",
Long: "Validates if CLI is able to communicate with Checkmarx One",
Annotations: map[string]string{
"command:doc": heredoc.Doc(
`
Expand Down
4 changes: 2 additions & 2 deletions internal/commands/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewResultsPredicatesCommand(resultsPredicatesWrapper wrappers.ResultsPredic
triageCmd := &cobra.Command{
Use: "triage",
Short: "Manage results",
Long: "The 'triage' command enables the ability to manage results in CxAST.",
Long: "The 'triage' command enables the ability to manage results in Checkmarx One.",
}
triageShowCmd := triageShowSubCommand(resultsPredicatesWrapper)
triageUpdateCmd := triageUpdateSubCommand(resultsPredicatesWrapper)
Expand Down Expand Up @@ -59,7 +59,7 @@ func triageUpdateSubCommand(resultsPredicatesWrapper wrappers.ResultsPredicatesW
triageUpdateCmd := &cobra.Command{
Use: "update",
Short: "Update the state, severity or comment for the given issue",
Long: "The update command enables the ability to triage the results in CxAST.",
Long: "The update command enables the ability to triage the results in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx triage update
Expand Down
4 changes: 2 additions & 2 deletions internal/commands/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewProjectCommand(projectsWrapper wrappers.ProjectsWrapper, groupsWrapper w
projCmd := &cobra.Command{
Use: "project",
Short: "Manage projects",
Long: "The project command enables the ability to manage projects in CxAST.",
Long: "The project command enables the ability to manage projects in Checkmarx One.",
Annotations: map[string]string{
"command:doc": heredoc.Doc(
`
Expand All @@ -76,7 +76,7 @@ func NewProjectCommand(projectsWrapper wrappers.ProjectsWrapper, groupsWrapper w
createProjCmd := &cobra.Command{
Use: "create",
Short: "Creates a new project",
Long: "The project create command enables the ability to create a new project in CxAST.",
Long: "The project create command enables the ability to create a new project in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx project create --project-name <Project Name>
Expand Down
4 changes: 2 additions & 2 deletions internal/commands/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func resultShowSubCommand(
resultShowCmd := &cobra.Command{
Use: "show",
Short: "Show results of a scan",
Long: "The show command enables the ability to show results about a requested scan in CxAST.",
Long: "The show command enables the ability to show results about a requested scan in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx results show --scan-id <scan Id>
Expand Down Expand Up @@ -439,7 +439,7 @@ func writeConsoleSummary(summary *wrappers.ResultSummary) error {
fmt.Printf(" | SCA: %*d| \n", defaultPaddingSize, summary.ScaIssues)
}
fmt.Printf(" ----------------------------------- \n")
fmt.Printf(" Checkmarx AST - Scan Summary & Details: %s\n", generateScanSummaryURL(summary))
fmt.Printf(" Checkmarx One - Scan Summary & Details: %s\n", generateScanSummaryURL(summary))
} else {
fmt.Printf("Scan executed in asynchronous mode or still running. Hence, no results generated.\n")
fmt.Printf("For more information: %s", summary.BaseURI)
Expand Down
6 changes: 3 additions & 3 deletions internal/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

const ErrorCodeFormat = "%s: CODE: %d, %s\n"

// NewAstCLI Return an AST CLI root command to execute
// NewAstCLI Return a Checkmarx One CLI root command to execute
func NewAstCLI(
scansWrapper wrappers.ScansWrapper,
resultsPredicatesWrapper wrappers.ResultsPredicatesWrapper,
Expand All @@ -46,8 +46,8 @@ func NewAstCLI(
// Create the root
rootCmd := &cobra.Command{
Use: "cx <command> <subcommand> [flags]",
Short: "Checkmarx AST CLI",
Long: "The AST CLI is a fully functional Command Line Interface (CLI) that interacts with the Checkmarx CxAST server.",
Short: "Checkmarx One CLI",
Long: "The Checkmarx One CLI is a fully functional Command Line Interface (CLI) that interacts with the Checkmarx One server.",
Example: heredoc.Doc(
`
$ cx configure
Expand Down
16 changes: 8 additions & 8 deletions internal/commands/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func NewScanCommand(
scanCmd := &cobra.Command{
Use: "scan",
Short: "Manage scans",
Long: "The scan command enables the ability to manage scans in CxAST.",
Long: "The scan command enables the ability to manage scans in Checkmarx One.",
Annotations: map[string]string{
"command:doc": heredoc.Doc(
`
Expand Down Expand Up @@ -239,7 +239,7 @@ func scanTagsSubCommand(scansWrapper wrappers.ScansWrapper) *cobra.Command {
tagsCmd := &cobra.Command{
Use: "tags",
Short: "Get a list of all available tags to filter by",
Long: "The tags command enables the ability to provide a list of all the available tags in CxAST.",
Long: "The tags command enables the ability to provide a list of all the available tags in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx scan tags
Expand All @@ -261,7 +261,7 @@ func scanCancelSubCommand(scansWrapper wrappers.ScansWrapper) *cobra.Command {
cancelScanCmd := &cobra.Command{
Use: "cancel",
Short: "Cancel one or more scans from running",
Long: "The cancel command enables the ability to cancel one or more running scans in CxAST.",
Long: "The cancel command enables the ability to cancel one or more running scans in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx scan cancel --scan-id <scan ID>
Expand Down Expand Up @@ -306,7 +306,7 @@ func scanWorkflowSubCommand(scansWrapper wrappers.ScansWrapper) *cobra.Command {
workflowScanCmd := &cobra.Command{
Use: "workflow <scan id>",
Short: "Show information about a scan workflow",
Long: "The workflow command enables the ability to provide information about a requested scan workflow in CxAST.",
Long: "The workflow command enables the ability to provide information about a requested scan workflow in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx scan workflow --scan-id <scan Id>
Expand All @@ -329,7 +329,7 @@ func scanShowSubCommand(scansWrapper wrappers.ScansWrapper) *cobra.Command {
showScanCmd := &cobra.Command{
Use: "show",
Short: "Show information about a scan",
Long: "The show command enables the ability to show information about a requested scan in CxAST.",
Long: "The show command enables the ability to show information about a requested scan in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx scan show --scan-id <scan Id>
Expand All @@ -351,8 +351,8 @@ func scanShowSubCommand(scansWrapper wrappers.ScansWrapper) *cobra.Command {
func scanListSubCommand(scansWrapper wrappers.ScansWrapper) *cobra.Command {
listScansCmd := &cobra.Command{
Use: "list",
Short: "List all scans in CxAST",
Long: "The list command provides a list of all the scans in CxAST.",
Short: "List all scans in Checkmarx One",
Long: "The list command provides a list of all the scans in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx scan list
Expand Down Expand Up @@ -382,7 +382,7 @@ func scanCreateSubCommand(
createScanCmd := &cobra.Command{
Use: "create",
Short: "Create and run a new scan",
Long: "The create command enables the ability to create and run a new scan in CxAST.",
Long: "The create command enables the ability to create and run a new scan in Checkmarx One.",
Example: heredoc.Doc(
`
$ cx scan create --project-name <Project Name> -s <path or repository url>
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewUtilsCommand(
utilsCmd := &cobra.Command{
Use: "utils",
Short: "Utility functions",
Long: "The utils command enables the ability to perform CxAST utility functions.",
Long: "The utils command enables the ability to perform Checkmarx One utility functions.",
Example: heredoc.Doc(
`
$ cx utils env
Expand Down
4 changes: 2 additions & 2 deletions internal/params/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const (
DebugUsage = "Debug mode with detailed logs"
RetryFlag = "retry"
RetryDefault = 3
RetryUsage = "Retry requests to AST on connection failure"
RetryUsage = "Retry requests to Checkmarx One on connection failure"
RetryDelayFlag = "retry-delay"
RetryDelayDefault = 20
RetryDelayPollingDefault = 60
Expand Down Expand Up @@ -56,7 +56,7 @@ const (
BaseAuthURIFlag = "base-auth-uri"
BaseAuthURIFlagUsage = "The base system IAM URI"
AstAPIKeyFlag = "apikey"
AstAPIKeyUsage = "The API Key to login to AST"
AstAPIKeyUsage = "The API Key to login to Checkmarx One"
ClientRolesFlag = "roles"
ClientRolesSh = "r"
ClientDescriptionFlag = "description"
Expand Down
Loading

0 comments on commit 4b8cf9d

Please sign in to comment.