Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI | Add Vorpal Engine Logic (AST-38523) #767

Merged
merged 60 commits into from
Jun 24, 2024

Conversation

AlvoBen
Copy link
Collaborator

@AlvoBen AlvoBen commented Jun 13, 2024

By submitting a PR to this repository, you agree to the terms within the Checkmarx Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Added vorpal engine logic

References

https://checkmarx.atlassian.net/browse/AST-38523

Testing

Added unit tests
Added integration tests

Checklist

  • I have added documentation for new/changed functionality in this PR (if applicable).
  • I have updated the CLI help for new/changed functionality in this PR (if applicable).
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used

@AlvoBen AlvoBen marked this pull request as draft June 13, 2024 06:48
@pedrompflopes pedrompflopes requested a review from a team June 13, 2024 06:48
Copy link

github-actions bot commented Jun 13, 2024

Logo
Checkmarx One – Scan Summary & Details27397322-5c1f-4a30-b0aa-c6f2976f434c

Policy Management Violations

Policy Name Rule(s) Break Build
[SAST-ML0] Not allowed NEW Sast vulnerabilities true

No New Or Fixed Issues Found

Copy link

gitguardian bot commented Jun 13, 2024

⚠️ GitGuardian has uncovered 16 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
11482443 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482443 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482444 Triggered Username Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482444 Triggered Username Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482445 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482445 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482446 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482446 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482448 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482448 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482449 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482449 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482450 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
11482450 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482451 Triggered Generic Password 4ac7ddd test/integration/data/python-vul-file.py View secret
11482451 Triggered Generic Password 4ac7ddd internal/commands/data/python-vul-file.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

}

err, _ := executeCommand(t, args...)
assert.NilError(t, err, "Sending empty source file should not fail")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you return an error? if so - check the response

vorpalWrapper := grpcs.NewVorpalGrpcWrapper(viper.GetInt(commonParams.VorpalPortKey))
if healthCheckErr := vorpalWrapper.HealthCheck(); healthCheckErr != nil {
fmt.Println("Health check failed with error: ", healthCheckErr)
t.Failed()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.Failed()
assert.Assert(t, true, "log")

asserts.NotNil(t, err)
}

func TestExecuteVorpalScan_EngineNotRunningWithLicense_Success(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you have a license for our tenant, and change it to happy flow?

…l-engine-functionality

# Conflicts:
#	internal/wrappers/jwt-helper.go
#	internal/wrappers/mock/jwt-helper-mock.go
}

func TestExecuteVorpalScan_InitializeAndRunUpdateVersion_Success(t *testing.T) {
configuration.LoadConfiguration()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but you don't run it

@AlvoBen AlvoBen merged commit 0d97f43 into main Jun 24, 2024
8 checks passed
@AlvoBen AlvoBen deleted the feature/benalvo/vorapl-engine-functionality branch June 24, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants