Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(arm): Fix resource ID generation to use variables #6884

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion checkov/arm/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ def add_graph_check_results(self, report: Report, runner_filter: RunnerFilter) -
start_line = entity[START_LINE] - 1
end_line = entity[END_LINE] - 1

if CustomAttributes.RESOURCE_TYPE not in entity or CustomAttributes.BLOCK_NAME not in entity:
logging.debug(f"Could not determine 'resource_id' of Entity {entity_file_path}")
continue

self.build_record(
report=report,
check=check,
Expand All @@ -273,7 +277,7 @@ def add_graph_check_results(self, report: Report, runner_filter: RunnerFilter) -
file_path=self.extract_file_path_from_abs_path(clean_file_path(Path(entity_file_path))),
file_abs_path=str(file_abs_path),
file_line_range=[start_line - 1, end_line - 1],
resource_id=entity[CustomAttributes.ID],
resource_id=f'{entity[CustomAttributes.RESOURCE_TYPE]}.{entity[CustomAttributes.BLOCK_NAME]}',
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason not to use CustomAttributes.RESOURCE_ID?

)

def build_record(
Expand Down
Loading