-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data-driven authorisation #94
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # src/engine/dataset/DatasetEngine.ts # src/engine/journal/index.ts
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/m-ld/m-ld-js/JAaZGY9x8dPyrY3yagCnthaA1X2d |
Experimental Object-RDF mapping (ORM) for apps SHACL shapes (minimal) Docs/tests WIP
Docs/tests WIP
gsvarovsky
force-pushed
the
security-prototype
branch
from
March 25, 2022 11:18
5b9e1d6
to
28b352d
Compare
5 tasks
This was referenced Mar 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Data-driven authorisation
This feature has been developed as a partial implementation of the Symmetric Unilateral Access Control (SUAC) specification.
The concept of agreements has been wired into the core m-ld protocol, representing coordinated changes to state (I explained why such changes are important in my presentation at the NGI webinar on conflict-free replicated data types). Agreements have the property that any concurrent changes are voided – undone and removed from history; however, the intention is that the requisite coordination is conducted prior to submitting an agreement, so that voiding is actually only a fallback to guarantee consistency.
Agreements are normally intended to be triggered automatically in registered extensions to m-ld. In this work we have provided for such extensions (and generally, any extensions) to be declared in the domain data itself. This has been a long-standing goal for m-ld as a whole.
Suitable extensions have then been created to implement access control: defining assignment of permissions to security principals (users) as statutes (sets of data that require agreement to change); introducing the concept of authority as a condition for agreement; and checking both permissions and authority during local and remote operations.
Specification
The changes to the m-ld core, and the extensions, implement and demonstrate most significant features of the proposed SUAC ontology and protocol, with some simplifications and modifications as follows. (Where these modifications are likely to persist beyond this project, we will update the SUAC document to match.)
Module Structure
The following list items introduce the major moving parts of this prototype; details can be found in the Files changed tab.
@agree
keyword (seesrc/jrql-support.ts
), which marks a json-rql Update as an agreement; plus the newAgreementCondition
interface and its inclusion inMeldExtensions
(seesrc/api.ts
).EncodedOperation
type (describing the 'operations' exchanged between clones, seesrc/engine/index.ts
). Operations can now also be signed by a transport security extension (see below), to ensure provenance (also to be explored further in the Traceability milestones).SuSetDataset.apply
algorithm and the journal classes (src/engine/journal
), to support application of agreement conditions, and the ignoring or voiding of operations concurrent with an agreement (see §Major Challenges).src/engine/CloneExtensions.ts
, including its ability to listen to changes in the domain data.src/security/MeldAclTransportSecurity.ts
, renamed from "MeldAccessControlList") is largely unchanged but the API has been updated to allow for signatures on operations.src/constraints/Statutory.ts
).src/constraints/WritePermitted.ts
).Major Challenges
In realising the proposed SUAC design, a number of significant challenges were either overcome, or characterised and deferred to future research. An overall impression of the complexity can be seen from the number of new considerations added to the security design mindmap!
src/orm.ts
).Verification
Changes in the source code are thoroughly covered by unit tests, in the
test
folder. Unit tests are currently run as part of the vercel build (see passed checks, below).The overall behaviour of the implementation is animated and documented in a new local compliance test,
compliance/test/2-agreements.spec.js
. This test covers the same set of cases elaborated in the SUAC protocol design. Reading this test gives a good overview of the data-driven gestures used to declare extensions, statutes, agreement conditions and permissions.Note that the ontology of statutes has been demonstrated using a statute over the
hasPermission
property of a principal; the full vocabulary would be completed in a future production version.Next Steps
The next step in prototyping is to demonstrate the use of an external protocol to drive authorisation behaviour. In particular, we would like to require that some changes require consensus: a form of coordination that is does not rely on authority – either of a principal (as in this milestone) or of a node in the network (as with centralised databases & services).