Code Monkey home page Code Monkey logo

sn-security's Introduction

Welcome to sensenet

sensenet is a content repository with API first approach packed with a full featured permission system, preview and collaboration tools.

Join the chat at https://gitter.im/SenseNet/sensenet

A basic setup of sensenet has three top-level parts:

  • A content repository that is the storage and service layer
  • An application that uses the content of the connected content repository through API calls
  • A sensenet admin surface (only in SNaaS) that helps you carry out common content management tasks

SNaaS architecture

Everything is content

Content is the basic block for storing information in sensenet. A content can be any kind of data, user, document, workspace, memo, task, and more. Using content items everywhere unlocks a great deal of exceptional features, making your experience as a user more seamless, and your job as a developer a lot easier.

Licensing

SNaaS (sensenet as a service)

In this model, sensenet content repositories live in our cloud infrastructure.

Advantages

  • no installation required (easy onboarding)
  • patches and upgrades are taken care of by us
  • no hosting related tasks
  • central admin surface
  • flexible pricing plans (based on # of contents, requests, and users)

on-prem

For the terms of on-prem licensing please contact our sales team.

Resources

Check out the links below to get further information:

Contributing

All kinds of contributions are welcome! We are happy if you have an idea, bugfix or feature request to share with others. Please check out our Contribution guide for details.

sn-security's People

Contributors

aron123 avatar gitter-badger avatar herflis avatar huszerlbence avatar kavics avatar tusmester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sn-security's Issues

Recursive lock error in permission evaluator

The GetEffectiveEntries method of PermissionEvaluator may cause a LockRecursionException. The reason is that the caller application may try to evaluate permissions during a callback to the application.

LockRecursionException: Recursive read lock acquisitions not allowed in this mode.
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLock(TimeoutTracker timeout)
   at SenseNet.Security.PermissionEvaluator.GetEffectiveEntries(Int32 entityId, IEnumerable`1 relatedIdentities, Nullable`1 entryType)
   at SenseNet.ContentRepository.Storage.Security.SecurityHandler.GetPermittedLevel(Int32 nodeId, IEnumerable`1 identities) in E:\BuildAgent\_work\63\s\src\Storage\Security\SecurityHandler.cs:line 761
   at SenseNet.ContentRepository.Storage.Node.GetUserAccessLevel(NodeHead head) in E:\BuildAgent\_work\63\s\src\Storage\Node.cs:line 2070
   at SenseNet.ContentRepository.Storage.Node.LoadNode(NodeHead head, VersionNumber version) in E:\BuildAgent\_work\63\s\src\Storage\Node.cs:line 1965
   at SenseNet.Portal.Virtualization.PortalContext.LoadContextNode(NodeHead head, String versionRequest) in E:\BuildAgent\_work\63\s\src\Services\Virtualization\PortalContext.cs:line 1176

Possible solutions

  1. check whether we can eliminate the recursive call in sensenet
  2. allow one thread to enter the read lock recursively by creating the ReaderWriterLockSlim object using the LockRecursionPolicy parameter in the constructor.

[Messaging] Read-only messaging setup in MSMQ

It is a valid setup when a messaging actor only wants to receive messages, not send them - for example because it cannot access other channels and it does not want to send messages anyway. An example is the search service that should receive security messages (entity changes) but does not send anything.

In this case the system should accept a single queue configuration. Currently an exception is thrown if there is only 1 queue configured.

MsmqMessageProvider, line 53

Acceptance

It should be OK to configure only a receiver queue. In this case when the system tries to send a message, it still should result in an exception so that the operator/developer knows that something is not right.

<add key="SecurityMsmqChannelQueueName" value=".\private$\security" />

Finalize LINQ support of the security queries.

  • Public API extension: subtree filtering by EntryType (HasPermission filtering is done but HasSubtreePermission filtering is missing).
  • Substitute all PermissionQuery method with LINQ queries.
  • Documentation with examples. See the uses cases in the unit tests of the SecurityQueryTests.cs

Permission entry category general queries.

Create predefined all-purpose permission queries that can substitute the old queries minimally for these methods:

  • GetRelatedIdentities
  • GetRelatedPermissions
  • GetRelatedItems
  • GetRelatedIdentitiesByPermissions
  • GetRelatedItemsOneLevel

Error starting security when the db or tables are missing

When starting the search service with an empty database, we get the following error:

SqlException (0x80131904): Invalid object name 'EFMessages'
...
at System.Data.Common.DbCommand.ExecuteReader()
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
   at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.QueryingEnumerable`1.Enumerator.MoveNext()
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
   at System.Linq.OrderedEnumerable`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at SenseNet.Security.EFCSecurityStore.SecurityStorage.GetUnprocessedActivityIds()

This is because the security system is trying to start and load permissions from the db. This should be a warning only, and the service should start anyway, because the repository install process will create those tables later.

Permission entry category deployment.

Create a part of a patch for installing the feature.

  • Database script that extends the security entry.
  • Ensure that the original permissions are not lost but are extended by a "Normal" category.
  • Ensure that the script can run only once.

InMem security data provider instance storage

Currently Storage is a static property in the MemoryDataProvider class which prevents us having multiple inmem dbs at the same time. Refactor this and the related tests so that we can use inmem dbs in parallel later.

Permission entry category creation.

Extend the permission entry with a predefined category.

  • Every permission is in one and only one category.
  • An entry can be Normal or Sharing.
  • The permission evaluator methods (Assert, HasPermission...) ignores the categories.
  • Query methods should use one or more categories and "both" and "none" terms.
  • The component needs to be as compatible as possible with earlier versions of SenseNet.Security.

System start speed up

A large db size (2M entities, entries, etc.) makes system start really slow. Investigate and fix.

The cause is most likely the initial loading process and Entity Framework. (LoadAllAces)

Permission entry category queryable collections.

Create queryable collections for permission entries.

  • Linq queries can be used on the collections.
  • There is a collection that can be used in a parent chain.
  • There is a collection that can be used in a subtree.
  • Each query as fast as possible.
  • Queriable collections can only be used with proper permissions.
  • The original PermissionQuery predefined methods need to work with EntryType.Normal only.

Add shutdown API

Add a more convenient static shutdown API, a counterpart of the StartTheSystem method.

RabbitMQ security message provider

Implement the security messaging interface (IMessageProvider) on top of the RabbitMQ service.

  • Refactor current generic messaging logic to a base provider class
  • RabbitMQMessageProvider project
  • nuget package and TFS build
  • documentation

Async security API: startup and db

Add async methods to the security API so that implementations and clients may be more scalable.
This issue deals with the startup and db operations. Activity execution and queue are in a different story.

Async security API: activity queue

The security activity queue currently is not optimal, we need to make it more parallel and async so that db operations do not block threads in the application.

Integrate the SAQ prototype into the security code base.

Serialization error

Symptom: AclEditor's Apply method throws an exception because the used AclInfo enumerable is not serializable under the netstandard 2.0.

Bug source: AclEditor.cs line 262: _acls.Values

Hint: use .ToArray()

Create a new EF security data provider with EF Core

To convert the project to .net standard, we have to deal with the Entity Framework dependency.

Solution

Create a new db provider built on EF Core. This is a new .Net Standard project.

Stuff to read:

Options

  • modify the current project to use EF Core (that supports NetStandard 2.0)
  • keep the current project on .Net Framework and create a new project (SenseNet.Security.EFCoreSecurityStore) that uses EF Core.
  • remove EF dependency (or create a new project) and substitue it with custom SQL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.