Skip to content

[Refactor]— Security & Policy Separation #10

@egumaru

Description

@egumaru

Refactor — Security & Policy Separation

Summary / 概要

This RFC proposes separating security, policy decision, rule evaluation, and audit responsibilities before ABI stabilization.

The goal is to avoid mixing authority, evaluation, registry, persistence, and failure handling into the same contracts.

本 RFC は、ABI 固定前に Security、Policy Decision、Rule Evaluation、Audit の責務を分離する提案です。

目的は、権限・判定・Registry・永続化・Failure Handling が同じ Contract に混在することを避けることです。


Motivation / 背景

Security boundaries are ABI-sensitive.

If Guard / PDP / RulesEngine contracts are too broad, later implementation will likely require breaking changes.

Security 境界は ABI 影響が大きい領域です。

Guard / PDP / RulesEngine の契約が広すぎると、実装時に破壊的変更が必要になる可能性が高くなります。


Primary Targets / 主対象

IGuard.cs

Current concern:

  • decision
  • read/write behavior
  • policy registry access
  • failure handling

懸念点:

  • 判定
  • read/write behavior
  • policy registry access
  • failure handling

IPdp.cs

Current concern / 懸念点:

  • policy decision
  • policy source
  • result interpretation
  • enforcement boundary

IRulesEngine.cs

Current concern / 懸念点:

  • rule registry
  • rule evaluation
  • pre-validation
  • post-validation

IAuditLogger.cs

P1 target.

Current concern / 懸念点:

  • multiple event categories may be forced into one logger surface.
  • 複数 event category が単一 logger surface に強制される可能性があります。

Proposed Direction / 提案方針

Guard separation

Candidate interfaces:

  • IGuardEvaluator
  • IGuardEnforcer
  • IGuardFailureHandler

候補:

  • IGuardEvaluator
  • IGuardEnforcer
  • IGuardFailureHandler

PDP separation

Candidate interfaces:

  • IPolicyDecisionPoint
  • IPolicyDecisionEvaluator
  • IPolicySource
  • IPolicyDecisionResult

候補:

  • IPolicyDecisionPoint
  • IPolicyDecisionEvaluator
  • IPolicySource
  • IPolicyDecisionResult

RulesEngine separation

Candidate interfaces:

  • IRuleRegistry
  • IRuleEvaluator
  • IPreExecutionRuleValidator
  • IPostExecutionRuleValidator

候補:

  • IRuleRegistry
  • IRuleEvaluator
  • IPreExecutionRuleValidator
  • IPostExecutionRuleValidator

Audit separation

Candidate interfaces:

  • IAuditSink
  • IAuditEventWriter
  • IAuditCategorySink
  • IExecutionAuditLogger

候補:

  • IAuditSink
  • IAuditEventWriter
  • IAuditCategorySink
  • IExecutionAuditLogger

Design Principle / 設計原則

Security contracts must define who decides, who enforces, who records, and who fails closed.

These must not be collapsed into one broad interface.

Security Contract は、誰が判定し、誰が強制し、誰が記録し、誰が fail-closed するのかを明確に分ける必要があります。

これらを 1 つの巨大な Interface に押し込めてはいけません。


Acceptance Criteria / 完了条件

  • Guard decision and enforcement responsibilities are separated.
  • PDP evaluation and policy source responsibilities are separated.
  • Rules registry and rule evaluation responsibilities are separated.
  • Pre-validation and post-validation contracts are clearly separated.
  • Audit logging is reviewed for category-based separation.
  • Fail-Closed behavior is documented at the interface boundary.
  • Tests are updated or added for decision / enforcement separation.
  • Guard の判定責務と強制責務が分離されている。
  • PDP の評価責務と policy source 責務が分離されている。
  • Rules registry と rule evaluation の責務が分離されている。
  • Pre-validation と post-validation の契約が明確に分離されている。
  • Audit logging が category-based separation の観点で見直されている。
  • Fail-Closed behavior が interface 境界で文書化されている。
  • decision / enforcement 分離に関するテストが更新または追加されている。

Out of Scope / 対象外

  • Implementing full Governance Plane
  • Implementing enterprise policy store
  • Implementing SIEM integration
  • Implementing runtime enforcement pipeline
  • 完全な Governance Plane 実装
  • Enterprise policy store 実装
  • SIEM integration 実装
  • Runtime enforcement pipeline 実装

Notes / 補足

This RFC does not implement full security.

It prepares the ABI so that full security can be implemented later without contract breakage.

本 RFC は完全な Security 実装を行うものではありません。

将来の完全な Security 実装時に Contract 破壊を起こさないよう、ABI を準備するためのものです。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions