kilix/abac-bundle
A Symfony bundle for attribute-based access control (ABAC). Define policies over user, resource, and environment attributes to make fine-grained, context-aware authorization decisions, integrated with Symfonyβs security system.
Framing correction (blocking): This package is a Symfony Bundle, not a Laravel package. It exists solely to wire kilix/php-abac into the Symfony DI container and security stack. Any evaluation against a Laravel codebase must be re-scoped to the underlying library (kilix/php-abac) and a custom Laravel integration layer. The bundle itself is not installable-to-purpose in Laravel.
Architecture fit
| Dimension | Assessment |
|---|---|
| Paradigm | ABAC (attribute/policy-based), policy-as-data with PolicySet β Policy β Rule, Target matching, and combining algorithms (deny-overrides, permit-overrides, first-applicable). This is a step up in expressiveness from Laravel's Gate/Policy closures and from RBAC packages. |
| Fit for Laravel | Poor as a package. The bundle's value is Symfony-specific glue (service definitions, config tree, container compilation) β all of which is dead weight or actively broken in a Laravel app. |
| Fit for the underlying library | Moderate. php-abac is framework-agnostic, autoloadable via Composer, and usable from a Laravel service provider. That is the realistic adoption path. |
| Model maturity | ABAC/XACML-style evaluation is a well-understood model, but PHP implementations of it are niche. Expect to hand-roll policy authoring, caching, and observability. |
Integration feasibility
Kernel, Bundle registration, DependencyInjection extension classes, and symfony/config definition loading. None of that resolves under Laravel's container.kilix/php-abac directly, register an AbacServiceProvider, bind a singleton evaluator, and expose a Gate::before/middleware bridge. Budget 1β2 engineer-weeks for a competent PHP dev, more if policy storage/authoring is in scope.Technical risk
kilix/abac-bundle and the CraftCamp fork both show near-zero activity. No security response capability for an authorization-critical dependency. MIT license means you can fork β assume you will.symfony/* constraint drift makes Composer resolution fragile over time, even if you only want the transitive library.Key questions for the maintainer / due diligence
kilix/php-abac (the actual dependency) actively maintained, and what is its last release date and open-issue posture?symfony/* version constraints, and do they conflict with our PHP runtime?Stack fit
kilix/abac-bundle. Use kilix/php-abac directly with a thin Laravel adapter.AbacServiceProvider registering the evaluator as a singleton.SubjectAttributes, ResourceAttributes, EnvironmentAttributes) with Eloquent-backed implementations.Gate::before or policy-decorator bridge so existing can()/authorize() call sites keep working β this preserves developer ergonomics and avoids a parallel authorization dialect.Middleware for route-level enforcement where policies are coarse-grained.AuthorizationEngine) so it is swappable for OPA/Cedar or Gate-only if the dependency dies.Migration path
Gate::define, policies, can() call sites, and role checks. This is the real cost driver.Compatibility
composer.json before anything else. This is the most likely hard stop.symfony/* transitive deps that Laravel does not use; confirm no version conflict with Laravel's own requirements or with packages that pin Symfony components (e.g., symfony/console via Artisan-adjacent tooling).Sequencing
| Phase | Work | Exit criterion |
|---|---|---|
| 0 | Spike: install kilix/php-abac, evaluate one policy end-to-end in a test app |
Evaluator works; fail-closed behavior confirmed in code |
| 1 | Adapter + interface + attribute resolvers | Gate::before bridge passes existing authz test suite unchanged |
| 2 | Policy authoring for high-value attribute cases (tenancy, ownership) | Policies peer-reviewed and version-controlled |
| 3 | Shadow mode | Disagreement rate β 0 on production traffic sample |
| 4 | Progressive cutover | Per-route rollout with kill switch |
| 5 | Decommission redundant Gate rules | Coverage report shows no orphaned checks |
Alternative to weigh: if the requirement is mainly role/permission management, spatie/laravel-permission (mature, high adoption) plus Gate policies covers 80% of cases at a fraction of the risk. If the requirement is genuinely externalized, auditable, cross-service policy, OPA or AWS Cedar is the production-grade answer; php-abac is the only in-process PHP-native option and it is a thin, unmaintained one.
Maintenance
Support
Scaling
(policySetVersion, subjectHash, resourceHash, action). Invalidate on policy version bump.Failure modes
| Failure | Observed behavior | Mitigation |
|---|---|---|
| Missing attribute | Likely "no match" β deny if deny-overrides/no-permit default; verify β could be permit |
Explicit fail-closed wrapper; assert in tests |
| Exception during evaluation | Unhandled or silently denied/permitted depending on caller | Wrap in try/catch returning deny + alert |
| Policy syntax/parse error | Depends on loader; may throw or silently skip a rule | Validate policies in CI; reject on load failure at boot |
| Stale policy cache | Old decisions after a policy change | Version-keyed cache; explicit flush in deploy |
| Dependency abandonment | No patches for PHP/CVE drift | Vendor fork, pinned SHA, internal patch branch |
| Combining-algorithm bug | Over-permit in edge cases | Differential tests vs. Gate in shadow mode |
The dominant risk pattern: silent over-permit. Unlike an outage, this generates no alert and no user complaint. Compensating controls (shadow mode, decision logging, periodic access review, differential tests) are load-bearing.
Ramp-up
Bottom line for the product decision: the bundle is a non-starter in a Laravel codebase, and the underlying library is a plausible-but-unvalidated in-process ABAC engine. Adopt only if ABAC semantics are a genuine product requirement (multi-tenant + ownership + contextual rules that Gate cannot express cleanly), and only with a thin internal adapter, shadow-mode rollout, mandatory decision logging, and an explicit plan to fork. If the requirement is role management, this package is the wrong tool and the risk is not worth the expressiveness.
How can I help you explore Laravel packages today?