Skip to content

fix(query): fixed results to mention correct resource type in secret without expiration date query#7954

Merged
cx-ricardo-jesus merged 18 commits into
masterfrom
AST-131338
Feb 11, 2026
Merged

fix(query): fixed results to mention correct resource type in secret without expiration date query#7954
cx-ricardo-jesus merged 18 commits into
masterfrom
AST-131338

Conversation

@cx-ricardo-jesus

@cx-ricardo-jesus cx-ricardo-jesus commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Reason for Proposed Changes

  • Currently, the query Secret Without Expiration Date returns a misleading result, stating that a resource of type Microsoft.Security/securityContacts should have attributes.exp property id defined, but the resource that this query is tackling is actually Microsoft.KeyVault/vaults/secrets

Proposed Changes

  • Changed the keyActualValue and keyExpectedValue to mention resources of type Microsoft.KeuVault/vaults/secrets.
  • Simplified the query to have only one policy. The query does the same verifications as before.
  • After changing the go version, the gosec linter returns a warning G602: slice index out of range.
  • To fix this warning, a guard condition was added inside the getKeyWithCurlyBrackets method, by adding a condition len(parts) >= valuePartsLength before accessing parts[len(parts)-2] and parts[len(parts)-1] to prevent potential index out of bounds errors

I submit this contribution under the Apache-2.0 license.

@cx-ricardo-jesus cx-ricardo-jesus requested a review from a team as a code owner January 26, 2026 10:07
@github-actions github-actions Bot added the query New query feature label Jan 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.18

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 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 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-ricardo-jesus cx-ricardo-jesus merged commit e56c51a into master Feb 11, 2026
27 checks passed
@cx-ricardo-jesus cx-ricardo-jesus deleted the AST-131338 branch February 11, 2026 18:52
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.

2 participants