Rename _kics_* AST keys to _dd_* with backward-compatible shim#176
Merged
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: f8f0b22 | Docs | Datadog PR Page | Give us feedback! |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
whitemerch
marked this pull request as ready for review
June 3, 2026 12:04
jacobotb
reviewed
Jun 3, 2026
whitemerch
force-pushed
the
chakib.hamie/rename_kics_ast_keys
branch
3 times, most recently
from
June 3, 2026 12:52
de60e79 to
dd82617
Compare
whitemerch
force-pushed
the
chakib.hamie/rename_kics_ast_keys
branch
from
June 3, 2026 13:14
dd82617 to
f8f0b22
Compare
jacobotb
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The parsed document AST uses
_kics_line,_kics_lines,_kics_filter_expretc. as field names, inherited from KICS. Nine rules indatadog-iac-scanner-default-rulesreference these keys directly in Rego. This renames them to_dd_*while keeping both old and new fields emitted during migration so the two repos can be deployed independently.Changes
Parsers (retrocompat — both keys emitted)
docker.Commandandbuildah.Commandnow emit both_kics_line(legacy) and_dd_line.jsonfilter.AWSJSONFilteremits both_kics_filter_expr(legacy) and_dd_filter_expr. Old rules using the legacy keys continue to produce findings.Parsers (direct rename — internal keys, no rego visibility)
_kics_lines→_dd_lines,_kics__default→_dd__default,_kics_arr→_dd_arracross all converters (Terraform, gRPC, JSON, YAML, Bicep) andmodel.LineObjectJSON tags.Detector
All
_kics_*path strings inpkg/detector/search_line_detector.goupdated to_dd_*.Tests
Test fixtures and inline assertions updated to reflect both old and new keys where retrocompat applies; struct and marshal tests updated to compare only the canonical new field.
QA Instruction
go test ./pkg/parser/... ./pkg/detector/... ./pkg/model/... ./pkg/kics/..._kics_lineand confirm findings still appear.Impact
Affects every parser's document output. No change in scan findings — both field names are present in the document during migration. The companion rules PR updates the 9 rego rules that reference these keys directly.