Skip to content

⭐ expose initProcessEnabled on ECS container definition#7060

Merged
tas50 merged 3 commits intomainfrom
tsmith/ecs-init-process-field
Mar 28, 2026
Merged

⭐ expose initProcessEnabled on ECS container definition#7060
tas50 merged 3 commits intomainfrom
tsmith/ecs-init-process-field

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 28, 2026

Summary

  • Adds initProcessEnabled bool field to the aws.ecs.taskDefinition.containerDefinition resource schema
  • The Go code already populated this field from LinuxParameters.InitProcessEnabled but it was missing from the .lr schema, so MQL queries couldn't reference it
  • Bumps AWS provider version to 13.5.1

Test plan

  • Verify aws.ecs.taskDefinitions { containerDefinitions { initProcessEnabled } } returns data in cnquery shell -t aws
  • Verify cnspec policy lint passes for the new mondoo-aws-security-ecs-init-process-enabled check

🤖 Generated with Claude Code

The Go code already populated this field from LinuxParameters but it was
missing from the .lr schema, preventing MQL queries from accessing it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tas50 tas50 changed the title feat: expose initProcessEnabled on ECS container definition ⭐ expose initProcessEnabled on ECS container definition Mar 28, 2026
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

New initProcessEnabled field on ECS container definitions is never populated, always returning false

Additional findings (file/line not in diff):

  • 🔴 providers/aws/resources/aws_ecs.go:963 — The initProcessEnabled field is declared as a plain property in .lr (not a computed method), so it must be set at CreateResource time. However, the CreateResource call here does not include "initProcessEnabled", so it will always default to false.

The data is already extracted for aws.ecs.container at line ~498-499 via cd.LinuxParameters.InitProcessEnabled. Apply the same logic here:

initProcessEnabled := false
if cd.LinuxParameters != nil && cd.LinuxParameters.InitProcessEnabled {
    initProcessEnabled = true
}

Then add "initProcessEnabled": llx.BoolData(initProcessEnabled) to the CreateResource map.

Extract LinuxParameters.InitProcessEnabled from the AWS SDK container
definition and pass it to the CreateResource call so the field returns
actual data instead of always defaulting to false.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

New ECS container definition field initProcessEnabled is exposed as a direct property instead of a lazy-loaded method, inconsistent with its .lr declaration.

…Enabled

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mondoo-code-review mondoo-code-review bot dismissed their stale review March 28, 2026 04:03

Superseded by new review

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

New ECS field correctly defaults to false when AWS API returns nil, matching AWS documented behavior.

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

5 741 tests  ±0   5 737 ✅ ±0   2m 28s ⏱️ +27s
  425 suites ±0       4 💤 ±0 
   33 files   ±0       0 ❌ ±0 

Results for commit 0220336. ± Comparison against base commit 4c82ae0.

@tas50 tas50 merged commit f902a01 into main Mar 28, 2026
22 checks passed
@tas50 tas50 deleted the tsmith/ecs-init-process-field branch March 28, 2026 04:21
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant