Skip to content

Fix secgroups targeting other secgroups in projects - #352

Open
bddvlpr wants to merge 1 commit into
apache:mainfrom
bddvlpr:fix/project-sg-targeting-sg
Open

bddvlpr wants to merge 1 commit into
apache:mainfrom
bddvlpr:fix/project-sg-targeting-sg

Conversation

@bddvlpr

@bddvlpr bddvlpr commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

This PR fixes securitygroup rules that target other securitygroup within a project. Authorization requests now include the target securitygroup's ownership scope, source group lookup are restricted to the same project, and project-owned source groups use the correct project account name.

Unit tests cover project and account ownership, while the acceptance test verifies project-scoped security group targeting. Both pass locally.

Copilot AI lite review requested due to automatic review settings September 17, 2026 11:37

Copilot AI 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.

🟢 Approval recommended

Only a minor wording nit remains; no blocking issues were identified.

Pull request overview

Fixes project-scoped security group rule targeting by applying correct ownership and source-group resolution.

Changes:

  • Adds ownership scope to authorization requests.
  • Restricts source-group lookup to the target project.
  • Adds unit and acceptance test coverage.
File summaries
File Summary Review notes
cloudstack/resource_cloudstack_security_group_rule.go Implements scoped authorization and source-group resolution. Nit: change “more then one” to “more than one” at line 291.
cloudstack/resource_cloudstack_security_group_rule_test.go Adds ownership and project-scoped acceptance tests. No blocking issues.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}

if l.Count > 1 {
return nil, fmt.Errorf("There is more then one result for SecurityGroup name: %s", name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants