Repository navigation
Support default egress policies in ActorTemplates - #1558
Eitan Yarmush (EItanya) wants to merge 4 commits into
Conversation
Allow actor templates to supply metadata-free initial egress rules, validated like actor egress policies. Copy them into a default policy in the actor creation transaction so policy write failures cannot leave an actor without its configured policy. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Use one CreateActor store operation for actors with or without an initial policy, preserving transactional writes when a policy is supplied. Update callers to pass nil when no policy is needed and remove redundant service wiring. Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
|
hmmm - plus one on having support for actor default egress policies. But I think our controller / egress policy implementation should just be deny-by-default regardless if the api has the policy within the actor. Its kinda orthogonal but wanted to make sure we are on the same page that we dont want to couple having that default empty egress policy in order to trigger deny by default |
|
|
||
| // Initial egress policy, copied atomically when an Actor is created from | ||
| // this template. The policy is named "default" in the Actor's atespace. | ||
| // Later template changes do not affect existing Actors' policies, which |
There was a problem hiding this comment.
Later template changes do not affect existing Actors' policies: should we make this configurable?
I imagine there are cases where users would like existing actors to pick up a EgressPolicyTemplate change automatically.
| if diff := cmp.Diff(tt.policy.Rules, policy.Rules, protocmp.Transform()); diff != "" { | ||
| t.Errorf("copied rules mismatch (-want +got):\n%s", diff) | ||
| } | ||
|
|
There was a problem hiding this comment.
The tests below this line does not seem to be related to the test table defined above. Please move them to a separate test.
100%, this doesn't change that. The implementation will always be deny by default, this is just a way to add default policy for all actors in a template. |
…changes Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
… note the rootfs root dependency of kagent-upstream#125 (agent-substrate#1918)
… root dependency of kagent-upstream#125 (#94) docs(fork): the egress default's upstream exit is agent-substrate#1558; note the rootfs root dependency of kagent-upstream#125 (agent-substrate#1918)
…ress policy as its default ActorTemplateForRevision sets default_egress_policy from the revision's egress destinations and credentials, the same allowlist the session workflow creates for each Actor. Substrate copies it onto every Actor it creates from the template, including the golden Actor the template reconciler creates, which no client call could give a policy before it boots: without one the golden boot is denied all egress (403) and a workload that fetches git skills before readyz never gets its snapshot. The workflow's EnsureActorEgressPolicy stays as the idempotent check. The revision digest carries an actorTemplateFormat marker so templates compiled before this change are re-created instead of conflicting. Field names follow agent-substrate/substrate#1558 (ActorTemplate.default_egress_policy, EgressPolicyTemplate.rules). Refs kagent-dev#2604, agent-substrate/substrate#1324
…ress policy as its default ActorTemplateForRevision sets default_egress_policy from the revision's egress destinations and credentials, the same allowlist the session workflow creates for each Actor. Substrate copies it onto every Actor it creates from the template, including the golden Actor the template reconciler creates, which no client call could give a policy before it boots: without one the golden boot is denied all egress (403) and a workload that fetches git skills before readyz never gets its snapshot. The workflow's EnsureActorEgressPolicy stays as the idempotent check. The revision digest carries an actorTemplateFormat marker so templates compiled before this change are re-created instead of conflicting. Field names follow agent-substrate/substrate#1558 (ActorTemplate.default_egress_policy, EgressPolicyTemplate.rules). Refs kagent-dev#2604, agent-substrate/substrate#1324
|
Closing this in favor of #2159 |
Allow ActorTemplates to define a default egress policy, validated like an EgressPolicy and copied atomically when an Actor is created. Actors without a configured default retain the current behavior; copied policies can be updated or deleted independently.
Validation:
make verifypassed, including rollback and policy lifecycle tests.Fixes #1324