Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Abac Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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

  • Not feasible as-is. Requires Symfony's Kernel, Bundle registration, DependencyInjection extension classes, and symfony/config definition loading. None of that resolves under Laravel's container.
  • Viable fallback: depend on 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.
  • Ecosystem signals are weak: 15 stars, 0 dependents, composite score 0.265. This is effectively unvalidated in production by anyone. Treat every behavior as unverified until you read the source.

Technical risk

  1. Authorization is fail-open by default in most naive integration layers. A policy-loading error, a missing attribute, or an evaluation exception that resolves to "permit" is a silent security defect. The package provides no opinionated fail-closed wrapper for a Laravel context.
  2. Maintenance abandonment. 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.
  3. Attribute sourcing is the hard part, not the library. ABAC is only as good as the subject/resource/environment attributes you feed it. In Laravel you'll be writing resolvers against Eloquent models, request context, and tenancy β€” none of which this package addresses.
  4. PHP version / symfony/* constraint drift makes Composer resolution fragile over time, even if you only want the transitive library.
  5. No test-coverage or audit signal. For a package whose entire job is access decisions, this is the highest-severity item.

Key questions for the maintainer / due diligence

  • Is kilix/php-abac (the actual dependency) actively maintained, and what is its last release date and open-issue posture?
  • What are the transitive symfony/* version constraints, and do they conflict with our PHP runtime?
  • Does policy evaluation fail closed on missing attributes and on exceptions? Show the code path.
  • Is there a policy caching layer, or is every check a full policy-set evaluation?
  • Are policies loaded from config, DB, or files β€” and is hot-reload supported?
  • What is the test suite coverage of the combining algorithms (deny-overrides correctness is where most ABAC implementations break)?
  • Is there a documented migration story to/from Laravel Gate?

Integration Approach

Stack fit

  • Recommended: do not install kilix/abac-bundle. Use kilix/php-abac directly with a thin Laravel adapter.
  • Adapter surface, minimum viable:
    • AbacServiceProvider registering the evaluator as a singleton.
    • An attribute resolver contract (SubjectAttributes, ResourceAttributes, EnvironmentAttributes) with Eloquent-backed implementations.
    • A Gate::before or policy-decorator bridge so existing can()/authorize() call sites keep working β€” this preserves developer ergonomics and avoids a parallel authorization dialect.
    • A Middleware for route-level enforcement where policies are coarse-grained.
  • Keep the ABAC engine behind an interface (AuthorizationEngine) so it is swappable for OPA/Cedar or Gate-only if the dependency dies.

Migration path

  1. Inventory current authorization: count of Gate::define, policies, can() call sites, and role checks. This is the real cost driver.
  2. Classify each existing rule as RBAC-shaped (role β†’ permission) or genuinely attribute-dependent (ownership, tenancy, time, resource state). Only the second class justifies ABAC.
  3. For the attribute-dependent subset, express as declarative policies in a versioned, reviewed directory (or DB table with audit columns).
  4. Run ABAC in shadow mode alongside Gate for 2–4 weeks; log disagreements. This is non-negotiable for an unvalidated library on an access-control path.
  5. Cut over per-route or per-resource-type, never big-bang.
  6. Retire the shadow comparator once disagreement rate is zero across representative traffic.

Compatibility

  • Verify PHP runtime compatibility against the library's composer.json before anything else. This is the most likely hard stop.
  • Expect 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).
  • No Laravel-version coupling since the library is framework-agnostic β€” that is the one compatibility advantage here.

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.


Operational Impact

Maintenance

  • Assume you own this code, not the maintainer. With 0 dependents and a 0.265 score, the practical expectation is that the community will not surface bugs or ship fixes.
  • Policy authoring becomes a new operational discipline: someone must review policy diffs with the same rigor as code. Unreviewed policy changes are privilege-escalation vectors.
  • Budget ongoing maintenance: dependency pinning, periodic fork-and-patch, and PHP upgrade remediation. Rough order: 10–15% of one engineer's time, spiking during major PHP/Symfony ecosystem shifts.

Support

  • No vendor, no SLA, no security advisory channel. For an authorization component this is the single largest operational gap.
  • Internal runbook required: who can change policies, how policies are reviewed, how to roll back a bad policy, how to audit a decision after the fact.
  • Decision logging is mandatory, not optional β€” log (subject, resource, action, decision, policy-id, timestamp) for every non-trivial evaluation. Without it, incident response on an access bug is impossible. This package gives you none of it.

Scaling

  • ABAC evaluates per-request with attribute fetching; naive implementations issue N queries per check. On a page rendering 50 resources each gated individually, this is a query storm.
  • Required mitigations: eager-load attributes, request-scoped attribute memoization, and a policy-decision cache keyed on (policySetVersion, subjectHash, resourceHash, action). Invalidate on policy version bump.
  • Policy-set loading from disk/DB on every request should be cached in the app cache with a version key.
  • Horizontal scaling is fine β€” the engine is stateless β€” provided the decision cache is shared (Redis) rather than per-process.

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

  • ABAC as a concept: low-to-moderate. Engineers familiar with XACML or OPA adapt quickly; those raised on Laravel Gate need a mental-model shift from imperative closures to declarative policy matching.
  • This library specifically: moderate-to-high, because documentation is thin and there is no community corpus. Expect source-reading rather than doc-reading.
  • Realistic ramp: 1 week for one engineer to reach productive policy authoring; 3–4 weeks before the team is confident enough to run it in production without a reviewer gate.
  • Bus factor: 1 until at least two engineers have authored and debugged non-trivial policies.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel
vish4395/laravel-translation-manager
morningtrain/economic
teksite/systeminfo-laravel
atomcms/voting
run6/weather
siokas/laravelembeddirectives
adamlien/pkuuids
gilsonsouza/lara-doc-generator