Ensemble-based access control framework.
Define your security policy like this:
class SimpleScenario(val people: Seq[Person]) {
class HelloWorld extends Ensemble {
val greeter = oneOf(people)
allow(greeter, "greet", people)
}
val policy = Policy.root(new HelloWorld)
}
Find the solution and query access rights:
val names = Seq("Roland", "Lilith", "Mordecai", "Brick")
val people = for (name <- names) yield new Person(name)
val scenario = new SimpleScenario(people)
val roland = people(0)
val lilith = people(1)
scenario.policy.resolve()
if (scenario.policy.allows(roland, "greet", lilith)) {
println("Roland says: Hello, Lilith!")
}
For generating graphs:
Graphing scripts should work with any Python later than 3.6, but the requirements are
locked to 3.6. You might need to modify Pipfile
.
To run the example program:
$ sbt run
To run the unit test suite:
$ sbt test
To run the measurement suite:
$ sbt "run scenario.MeasureAll"
Results will be saved in results/YYYY-MM-DD
directory.
To generate graphs from measurements saved in results/final
:
$ ./python/all.sh
Generate the JAR with:
$ sbt package
Then copy target/scala-2.12/tcoof-trust_2.12-1.0.jar
into a lib/
subdirectory of
your project.
To generate the API documentation:
$ sbt doc
Documentation is saved to target/scala-2.12/api
.
You can find the user guide and implementation notes in the thesis.
Install IntelliJ IDEA with Scala plugin, and open this repository as a Scala project.