Skip to content

feat: improve SARIF memory usage - #386

Open
cx-diogo-rocha wants to merge 5 commits into
masterfrom
AST-140881-dhl-improve-memory-usage
Open

feat: improve SARIF memory usage#386
cx-diogo-rocha wants to merge 5 commits into
masterfrom
AST-140881-dhl-improve-memory-usage

Conversation

@cx-diogo-rocha

Copy link
Copy Markdown
Contributor

Closes #

Proposed Changes

  1. Reduced the amount of time the report was held in memory for Sarif report. Now only in memory once (this can be reduced later with a deeper refactor).
  2. Added a flag to disable console report, since this was another point in the code where the full report was duplicated in memory. We should later stream to console as well even with the flag absent.

Checklist

  • I covered my changes with tests.
  • I Updated the documentation that is affected by my changes:
    • Change in the CLI arguments
    • Change in the configuration file

I submit this contribution under the Apache-2.0 license.

@cx-diogo-rocha
cx-diogo-rocha requested a review from a team as a code owner April 23, 2026 14:40
@cx-diogo-rocha cx-diogo-rocha changed the title Ast 140881- Improve SARIF memory usage feat: improve SARIF memory usage Apr 23, 2026
@github-actions

Copy link
Copy Markdown

kics-logo

KICS version: v1.7.13

Category Results
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 16
Files parsed placeholder 16
Files failed to scan placeholder 0
Total executed queries placeholder 53
Queries failed to execute placeholder 0
Execution time placeholder 1

@github-actions

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Details8d451735-06f3-4817-a017-a1eab4e91153


New Issues (1) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 HIGH Plain_Text_Transport_Layer_in_Server main.go: 22
detailsThe application starts a server using , in /main.go at line 22. This server will listen and respond to requests made in plain text, without the u...
Attack Vector

Comment thread cmd/main.go
maxSecretSizeFlagName = "max-secret-size"
validate = "validate"
customRulesFileFlagName = "custom-rules-path"
disableConsoleReportFlagName = "disable-console-report"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should add this new flag to the Readme

Comment thread lib/reporting/sarif.go
}

// buildSarifResult converts a single Secret into a SARIF Results object.
func buildSarifResult(secret *secrets.Secret) Results {

@cx-julio-silva cx-julio-silva Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This code is mostly duplicated from the inner loop of getResults.
Can we call this function there or update this function's caller to reuse getResults to make sure we always keep the behavior consistent?

@stepsecurity-app

Copy link
Copy Markdown
Contributor

Security Policy Alert: Runner Label Policy Violation

This workflow run has been blocked by StepSecurity's runner label policy because it uses runner labels that are not allowed by your organization's policy.

Disallowed Runner Labels:

  • ubuntu-latest

To fix this issue, please modify the runs-on field in your workflow to use only allowed runner labels. Contact your organization administrator if you need further assistance.

For more information, see StepSecurity's Runner Label Policy documentation.

@stepsecurity-app

Copy link
Copy Markdown
Contributor

Security Policy Alert: Actions Policy Violation

This workflow run has been blocked by StepSecurity's actions policy.

Disallowed Actions:

  • docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0

To fix this issue, please modify the workflow to use only allowed actions. Contact your organization administrator to request changes to the allowed actions list if needed.

For more information, see StepSecurity's Actions Policy documentation.

@stepsecurity-app

Copy link
Copy Markdown
Contributor

Security Policy Alert: Secret Policy Violation

This workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch.

Secret references detected:

  • secrets.AST_RND_SCANS_BASE_URI at line 22
  • secrets.AST_RND_SCANS_TENANT at line 23
  • secrets.AST_RND_SCANS_CLIENT_ID at line 24
  • secrets.AST_RND_SCANS_CLIENT_SECRET at line 25

To approve this workflow, please add the workflows-approved label to this PR.

Note: The label must be added by someone other than the PR author (cx-diogo-rocha) or automation bots to ensure proper security review.

After the label is added, you can re-run the blocked workflow to proceed.

This workflow will be automatically approved once merged into the default branch.

For more information, see StepSecurity's Secret Exfiltration Policy documentation.

@stepsecurity-app

Copy link
Copy Markdown
Contributor

Security Policy Alert: Secret Policy Violation

This workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch.

Secret references detected:

  • secrets.CODECOV_TOKEN at line 39

To approve this workflow, please add the workflows-approved label to this PR.

Note: The label must be added by someone other than the PR author (cx-diogo-rocha) or automation bots to ensure proper security review.

After the label is added, you can re-run the blocked workflow to proceed.

This workflow will be automatically approved once merged into the default branch.

For more information, see StepSecurity's Secret Exfiltration Policy documentation.

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