Access Control Explorer is designed to facilitate the exploration and implementation of modern access control architectures. The project provides reusable libraries and practical examples to evaluate different access control mechanisms in terms of their effectiveness, performance, and adaptability to real-world scenarios.
The primary objective is to offer developers and security practitioners a comprehensive toolkit for understanding and implementing sophisticated access control patterns, with emphasis on attribute-based access control (ABAC) and its practical applications.
The abac/ directory contains a general-purpose ABAC library following XACML-style architecture:
- Decision Maker (Policy Decision Point): Policy decision maker with configurable policy resolvers
- Policy Provider (Policy Retrieval Point): Policy provider with file-based storage support
- Enforcer (Policy Enforcement Point): Enforcement interfaces and implementations
- Request Orchestrator (Context Handler): Request orchestrator for enriching access requests with contextual attributes
- Info Provider (Policy Information Point): Information provider for enriching requests with additional contextual data
- Policy Evaluator: Policy evaluation engine with OPA/Rego implementation for policy execution
- Extensions: Support for obligations, advices, and custom information providers
The library provides clean interfaces that can be extended with custom implementations for different deployment scenarios and policy requirements.
The examples/abac/ directory demonstrates a complete implementation of ABAC enforcement in a REST
API context:
- E-commerce Use Case: Order management system with role-based permissions implemented through ABAC
- HTTP Middleware: Enforcer (Policy Enforcement Point) as HTTP middleware
- JWT Authentication: Token-based authentication with RS256 signing and automatic user context enrichment
- Policy Implementation: Rego policies implementing RBAC patterns within ABAC framework
- Obligations and Advices: Practical examples of audit logging and caching hints
For detailed setup and usage instructions, see the ABAC Example README.
This project uses Docker and Docker Compose for local development environment setup.
- Docker and Docker Compose
- Make
Create and start the development environment:
make upThis command:
- Generates RSA key pairs for JWT signing/verification if not present
- Creates the necessary
.envfile from.env.example - Starts all required services via Docker Compose
Stop the development environment:
make downRun the complete test suite:
make testThis includes:
- GitHub Actions linting
- Go code linting and formatting
- Go unit tests with race detection and coverage analysis
For Go-specific tests only:
make test-goTest all examples in the project:
make test-examplesThis command iterates through all example directories and runs their individual test suites, ensuring that all practical implementations work correctly with the core ABAC library.
Test artifacts are generated in _dist/tests/ including coverage reports.
Lint Go code:
make lint-goLint GitHub Actions workflows:
make lint-actions- Ensure Docker and Make are installed
- Run
make upto set up the development environment - Make your changes
- Run
make testto verify all tests pass - Submit your pull request