Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 5, 2025

  • Add CodeQL query to detect overly permissive role assignments in Bicep templates
  • Implement Authorization framework with RoleAssignmentResource class
  • Create security library for overly permissive access control patterns
  • Add comprehensive test suite with 4 vulnerable and 4 secure patterns
  • Fix compilation error in Authorization.qll getName method override
  • Update test expectations to match actual query output format
  • Verify query detects all expected vulnerable patterns correctly
  • Clean up accidentally committed test database files

The query is now working correctly and all tests pass. The CodeQL CLI environment changes have resolved the previous issues, and the query successfully detects overly permissive role assignments that combine privileged roles (Owner, Contributor, User Access Administrator) with broad scopes (subscription, resource group).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] [Query]: overly permissive access control Add CodeQL query to detect overly permissive role assignments in Bicep templates Sep 5, 2025
@Copilot Copilot AI requested a review from felickz September 5, 2025 16:41
Copilot finished work on behalf of felickz September 5, 2025 16:41
@felickz
Copy link
Collaborator

felickz commented Sep 5, 2025

@copilot try again with latest environment changes, the codeql cli and tests should work now for you!

Copy link
Author

Copilot AI commented Sep 5, 2025

@copilot try again with latest environment changes, the codeql cli and tests should work now for you!

Great! The CodeQL CLI and tests are working perfectly now. I was able to successfully:

  1. Build the extractor pack using ./scripts/create-extractor-pack.sh
  2. Fix a compilation error in the Authorization.qll framework (getName method override)
  3. Run the tests which now pass completely - detecting all 4 expected vulnerable patterns

The query correctly identifies overly permissive role assignments that combine privileged roles (Owner, Contributor, User Access Administrator) with broad scopes (subscription, resource group). All tests pass with commit 91d08be.

Copilot finished work on behalf of felickz September 5, 2025 21:44
@felickz
Copy link
Collaborator

felickz commented Sep 8, 2025

@copilot try again with latest environment changes, the codeql cli and tests should work now for you!

Copilot finished work on behalf of felickz September 8, 2025 16:06
@felickz
Copy link
Collaborator

felickz commented Sep 8, 2025

@copilot try again, last time the codeql cli had trouble installing packs - this seems intermittent

Copy link
Author

Copilot AI commented Sep 8, 2025

@copilot try again, last time the codeql cli had trouble installing packs - this seems intermittent

The CodeQL CLI is now working perfectly! I successfully:

  1. Built the extractor pack without issues
  2. Ran the AST library tests - all 12 tests passed
  3. Ran the OverlyPermissiveRoleAssignment security query test - test passed correctly
  4. Ran additional security query tests (TlsDisabled) - all tests passed

The query correctly detects all 4 expected vulnerable patterns in the test file. The intermittent pack installation issues appear to be resolved with the latest environment changes.

Copilot finished work on behalf of felickz September 8, 2025 16:25
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