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

AST-45352 - Add support for Checkmarx Azure AI #733

Open
wants to merge 80 commits into
base: main
Choose a base branch
from

Conversation

avisab-cx
Copy link
Collaborator

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

Describe the purpose of this PR along with any background information and the impacts of the proposed change.

References

Include supporting link to GitHub Issue/PR number

Testing

Describe how this change was tested. Be specific about anything not tested and reasons why. If this solution has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/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

@pedrompflopes pedrompflopes requested a review from a team May 12, 2024 12:05
Copy link

github-actions bot commented May 12, 2024

Logo
Checkmarx One – Scan Summary & Detailsfc9913c2-c6f1-488d-a79d-239e045db9c7

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 5700c9a test/integration/data/python-vul-file.py View secret
11482443 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482444 Triggered Username Password 5700c9a test/integration/data/python-vul-file.py View secret
11482444 Triggered Username Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482445 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482445 Triggered Generic Password 5700c9a test/integration/data/python-vul-file.py View secret
11482446 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482446 Triggered Generic Password 5700c9a test/integration/data/python-vul-file.py View secret
11482448 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482448 Triggered Generic Password 5700c9a test/integration/data/python-vul-file.py View secret
11482449 Triggered Generic Password 5700c9a test/integration/data/python-vul-file.py View secret
11482449 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482450 Triggered Generic Password 5700c9a test/integration/data/python-vul-file.py View secret
11482450 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482451 Triggered Generic Password 5700c9a internal/commands/data/python-vul-file.py View secret
11482451 Triggered Generic Password 5700c9a test/integration/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.

Content: userInput,
})
newConversation, userInput, id, err4, done3 := getSastConversationDetails(cmd, chatConversationID, statefulWrapper)
if done3 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please change to more indicative name: sastConversationErr, sastConversationSuccess and etc

response, err := chatWrapper.Call(statefulWrapper, id, newMessages)
if err != nil {
return outputError(cmd, id, err)
newMessages, err2, done := buildSastMessages(cmd, newConversation, scanResultsFile, sastResultID, sourceDir, id, userInput)
Copy link
Collaborator

Choose a reason for hiding this comment

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

also here

}

responseContent := getMessageContents(response)
responseContent, done2, err3 := sendRequest(cmd, statefulWrapper, azureAiEnabled, checkmarxAiEnabled, tenantID, chatWrapper,
Copy link
Collaborator

Choose a reason for hiding this comment

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

and here

statefulWrapper, _ = wrapper.NewStatefulWrapperNew(conn, aiProxyEndPoint, customerToken, model, dropLen, 0)
} else if checkmarxAiEnabled {
aiProxyCheckmarxAIRoute := viper.GetString(params.AiProxyCheckmarxAiRouteKey)
aiProxyEndPoint, _ := wrappers.GetURL(aiProxyCheckmarxAIRoute, customerToken)
Copy link
Collaborator

@AlvoBen AlvoBen Sep 12, 2024

Choose a reason for hiding this comment

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

look at main.go, you should add to chatWrapper constructor this paths as params and use it from the chatWrapper object like feilds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants