Skip to content

fix(query): fp for operation without successful http status code when valid codes are present#7604

Merged
cx-andre-pereira merged 5 commits into
masterfrom
fix-openapi-operation-without-successful-http-status-code
Sep 25, 2025
Merged

fix(query): fp for operation without successful http status code when valid codes are present#7604
cx-andre-pereira merged 5 commits into
masterfrom
fix-openapi-operation-without-successful-http-status-code

Conversation

@cx-artur-ribeiro

Copy link
Copy Markdown
Contributor

Closes #7600

Reason for Proposed Changes

  • The query Operation Without Successful HTTP Status Code was reporting a false positive when a 204 response was defined;
  • This was due to the use of the content_allowed helper function, which excluded 204 unless the method was HEAD, even though the query explicitly allows 204 via regex;

Proposed Changes

  • Removed the use of content_allowed from the query to avoid unintentionally filtering out valid success codes;
  • Updated the query logic to directly check for status codes 200, 201, 202, and 204, while still excluding HEAD operations and status 304 inline;

I submit this contribution under the Apache-2.0 license.

@cx-artur-ribeiro cx-artur-ribeiro self-assigned this Jul 30, 2025
@github-actions github-actions Bot added the query New query feature label Jul 30, 2025
@github-actions

github-actions Bot commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.13

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 fix(query): FP for Operation Without Successful HTTP Status Code when 204 is present fix(query): fp for Operation Without Successful HTTP Status Code when 204 is present Jul 30, 2025
@cx-artur-ribeiro cx-artur-ribeiro changed the title fix(query): fp for Operation Without Successful HTTP Status Code when 204 is present fix(query): fp for operation without successful http status code when valid codes are present Jul 30, 2025
@cx-artur-ribeiro cx-artur-ribeiro marked this pull request as ready for review September 24, 2025 10:57
@cx-artur-ribeiro cx-artur-ribeiro requested a review from a team as a code owner September 24, 2025 10:58
@gitguardian

gitguardian Bot commented Sep 25, 2025

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret 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 secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
20838717 Triggered Generic Password d34ebef assets/queries/azureResourceManager/sql_server_database_with_alerts_disabled/test/negative8.json 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 secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  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.

@cx-andre-pereira cx-andre-pereira merged commit 6621b87 into master Sep 25, 2025
28 checks passed
@cx-andre-pereira cx-andre-pereira deleted the fix-openapi-operation-without-successful-http-status-code branch September 25, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

query New query feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(scan): false positive: "Operation Object should have at least one successful HTTP status code defined" on 204

3 participants