Skip to content

fix(validator): update queries validator for cwe and risk score fields - #8028

Merged
cx-artur-ribeiro merged 9 commits into
masterfrom
AST-145263-improve-queries-validator-script
Sep 11, 2026
Merged

cx-artur-ribeiro merged 9 commits into
masterfrom
AST-145263-improve-queries-validator-script

Conversation

@cx-artur-ribeiro

@cx-artur-ribeiro cx-artur-ribeiro commented Apr 6, 2026 •

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • cwe field is not just a string, it's a numbered string, which was not being validated correctly.
  • riskScore is a float number with only one decimal case;

Proposed Changes

  • Improve queries validator script to validate cwe as a numbered string instead of just a string and float with one decimal place for riskScore;
  • Fix bug in url pagination;
  • Update relevant documentation with proper syntax and more information about the fields;

I submit this contribution under the Apache-2.0 license.

@cx-artur-ribeiro cx-artur-ribeiro self-assigned this Apr 6, 2026
@cx-artur-ribeiro
cx-artur-ribeiro requested a review from a team as a code owner April 6, 2026 13:38
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.20

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

@cx-artur-ribeiro cx-artur-ribeiro changed the title update: queries validator for cwe field to be a numbered string fix(validator): update queries validator for cwe and risk score fields Apr 6, 2026
Comment thread docs/creating-queries.md Resolved
@cx-artur-ribeiro
cx-artur-ribeiro requested a review from a team as a code owner September 11, 2026 08:55

@cx-andre-pereira cx-andre-pereira left a comment

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.

LGTM !

@cx-rui-araujo cx-rui-araujo left a comment

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.

LGTM

@cx-bruno-silva cx-bruno-silva left a comment

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.

LGTM

@cx-artur-ribeiro
cx-artur-ribeiro force-pushed the AST-145263-improve-queries-validator-script branch from 0c75d6e to e665727 Compare September 11, 2026 10:21
@cx-artur-ribeiro
cx-artur-ribeiro merged commit cd467d1 into master Sep 11, 2026
34 of 36 checks passed
@cx-artur-ribeiro
cx-artur-ribeiro deleted the AST-145263-improve-queries-validator-script branch September 11, 2026 11:03
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
kics 2.2.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* docs(release): update queries catalog, index and dockerfile for upcoming release by @cx-artur-ribeiro in Checkmarx/kics#8094
* fix(query): added missing case to "Last User is Root" Dockerfile query. by @cx-andre-pereira in Checkmarx/kics#8095
* feat(queries): new queries to check if synapse workspace managed virtual network is enabled by @cx-ricardo-jesus in Checkmarx/kics#8097
* refactor(descriptions): remove pkg/descriptions and related CLI flag by @cx-ricardo-jesus in Checkmarx/kics#8092
* CISO-1264 - Update GitHub Actions runner labels by @cx-jonathan-hartman in Checkmarx/kics#8093
* fix(query): Fix for Missing Backslash Support on Copy_With_More_Than_Two_Arguments_Not_Ending_With_Slash query by @cx-andre-pereira in Checkmarx/kics#8099
* fix(actions): refactor gh actions to fix CI by @cx-artur-ribeiro in Checkmarx/kics#8098
* fix(query): change to keyExpectedValue on ARM 'default_azure_storage_account_network_access_is_too_permissive' query by @cx-andre-pereira in Checkmarx/kics#8101
* update(version): rename VERSION build-arg to ENGINE_VERSION by @cx-artur-ribeiro in Checkmarx/kics#8102
* fix(query): correct keyExpectedValue and keyActualValue in redshift_not_encrypted by @cx-ricardo-jesus in Checkmarx/kics#8105
* fix(analyzer): bound file analysis workers by @omribz156 in Checkmarx/kics#8058
* fix(actions): remove outdated actions and update documentation accordingly by @cx-artur-ribeiro in Checkmarx/kics#8110
* fix(action): remove concurrent group from run projects github action by @cx-artur-ribeiro in Checkmarx/kics#8111
* fix(test): normalize timestamp comparison in TestInitCycloneDxReport by @cx-artur-ribeiro in Checkmarx/kics#8113
* fix(actions): fix security vulnerabilities and update ci with new enforced rules by @cx-artur-ribeiro in Checkmarx/kics#8118
* fix(release): gate kics release workflows behind release environment by @cx-lior-poterman in Checkmarx/kics#8108
* fix(validator): update queries validator for cwe and risk score fields by @cx-artur-ribeiro in Checkmarx/kics#8028
* fix(version): new available version with additional v prefix by @cx-artur-ribeiro in Checkmarx/kics#8119
* fix(analyzer): improvement to dockerfile scanning by @cx-andre-pereira in Checkmarx/kics#8114
* chore(release): removed unused goreleaser configuration files by @cx-ricardo-jesus in Checkmarx/kics#8122
* fix(filesystem): skip cache files by extension by @cx-laura-rodrigues in Checkmarx/kics#8112
* fix(query): changed all dockerfile queries for case insensitive support of dockerfile commands by @cx-andre-pereira in Checkmarx/kics#8115
* docs(release): update queries catalog, index and dockerfile for 2.2.0 by @cx-artur-ribeiro in Checkmarx/kics#8126

## New Contributors
* @cx-jonathan-hartman made their first contribution in Checkmarx/kics#8093
* @omribz156 made their first contribution in Checkmarx/kics#8058
* @cx-lior-poterman made their first contribution in Checkmarx/kics#8108

**Full Changelog**: https://github.com/Checkmarx/kics/compare/v2.1.21...v2.2.0</pre>
  <p>View the full release notes at <a href="https://github.com/Checkmarx/kics/releases/tag/v2.2.0">https://github.com/Checkmarx/kics/releases/tag/v2.2.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!20473
cx-andre-pereira pushed a commit that referenced this pull request Sep 29, 2026
#8028)

* update: queries validator for cwe field to be a numbered string

* test: failure cwe field and normal cwe field to test changes

* revert: action is good

* update: add risk score field validation

* update: creating-queries documentation notes with more information about cwe and risk score fields

* fix: constrain riskScore to a positive value between 0.0 and 10.0

---------

Co-authored-by: Miguel da Silva <100352574+cx-miguel-dasilva@users.noreply.github.com>
cx-andre-pereira pushed a commit that referenced this pull request Sep 29, 2026
#8028)

* update: queries validator for cwe field to be a numbered string

* test: failure cwe field and normal cwe field to test changes

* revert: action is good

* update: add risk score field validation

* update: creating-queries documentation notes with more information about cwe and risk score fields

* fix: constrain riskScore to a positive value between 0.0 and 10.0

---------

Co-authored-by: Miguel da Silva <100352574+cx-miguel-dasilva@users.noreply.github.com>
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.

6 participants