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

access_monitoring_rule: Support plugin.spec.name condition variable #51816

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bernardjkim
Copy link
Contributor

@bernardjkim bernardjkim commented Feb 4, 2025

Supports #51682

This PR adds supports for using plugin.spec.name variable within the condition expression.

The plugin.spec.name will replace the spec.notification.name. This is more of a UX change. We can deprecate the spec.notification.name but continue to support it. With built-in/native auto approvals, we'd like to support auto approvals without notifications. It would be a bit confusing to continue using spec.notification.name in this scenario.

# Example AMR
kind: access_monitoring_rule
version: v1
metadata:
  name: teleport-pre-approved-roles
spec:
  condition: >
    plugin.spec.name == "teleport-slack" &&
    contains_any(access_request.spec.roles, set("prod"))
  subjects:
    - access_request
  notification:
    # Deprecated: Use 'plugin.spec.name == "teleport-native"' condition instead
    # name: teleport-slack
    recipients: ["access-requests"] 

There is one notable change in behavior with these changes. The AMR can now be configured to match all available plugins, because the spec.notification.name can be empty. If this is an undesirable change, we can add an extra validation step to ensure that a plugin.spec.name variable is used within the condition expression.

Changelog: Support plugin.spec.name AMR condition variable.

Copy link

github-actions bot commented Feb 4, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
bernard/amr-plugin-conditions HEAD 1 ✅SUCCEED bernard-amr-plugin-conditions 2025-02-04 03:56:41

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.

1 participant