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

Policy for creating P4 Switches #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ namespace fabricTags {
clause Attributes.actionId == "create"
apply permitUnlessDeny

// Each of the following policies must explicitly say 'permit' or else the policy fails
policyset createSwitch = "urn:fabric:authz:xacml:orchestrator:tags:create:switch" {
target clause Attributes.resourceType == "sliver"
apply denyUnlessPermit

policy createSwitchPolicy = "urn:fabric:authz:xacml:orchestrator:tags:create:switch:requireP4" {
target clause Attributes.resourceType == "sliver"
apply permitUnlessDeny

rule requireSwitchP4Tag {
deny
condition not(Attributes.projectTag == "Switch.P4")
on deny {
advice reasonToDeny {
Attributes.message = "Policy Violation: Your project is lacking Switch.P4 tag to provision a P4 switch."
}
}
}
}
}

// Each of the following policies must explicitly say 'permit' or else the policy fails
policyset createVM = "urn:fabric:authz:xacml:orchestrator:tags:create:vm" {
target clause Attributes.resourceType == "sliver"
Expand Down
2 changes: 1 addition & 1 deletion src-gen/fabricTags.OrchestratorTags.xml

Large diffs are not rendered by default.