Camunda Identity Service for an embedded installation - camunda

I’m using Camunda embedded in my web application (springboot). I successfully created my custom identityProvider (implementing ReadOnlyIdentityProvider) and my users and groups are being read from my database.
The thing is, I thought Camunda would check, for example, that certain user can only claim a task if he/she belongs to the candidate group, but I don’t see that happening. For example, I logged to cockpit with a user with group A, and was able to claim a task assigned to candidate group B.
So my question is, why would I need to create an IdentityProvider? Camunda webapps will be accessed by admins only, so I don’t need to setup resource security there. Is there a use case or something that I’m missing?
PD: Also asked in https://forum.camunda.org/t/do-i-need-an-identity-service-for-an-embedded-installation/10378

Claiming a task is not forbidden by camunda if you are not member of the candidate group of the task.
So I guess setting the tasklist filters in a way where a user that is not member of a group is not able to see the task will be your solution.

Related

Power Platform Security Roles Details

I would like to know the exact details and impact of the specific security roles, that can be assigned in the Power Platform. I am not able to find such documentation. Does anyone know where to find it?
Also, I am especially interested in this on called "Solution", located under "Customizations".
Actually, there is no official doc mentioned about these details (Each privilege listed under customizations).
For any user who wants to run powerapps app (canvas app or model-driven app), he/she must own minimum privilege of the environment resource. You could find more details from following link:
Minimum privilege to run an app
BR
Kris

How to send parameters to "Open in Cloud Shell" URL?

I want to create a button that will open GCP cloud shell and run code that create some resources in the account.
I am trying to use "Open in Cloud Shell" (https://cloud.google.com/shell/docs/open-in-cloud-shell) URL and adding my GIT repo to the URL, but the problem is that my code should get different arguments in every run. There is a way to send arguments with this URL? Or maybe there is another solution for running code with arguments in GCP cloud shell via URL?
This is NOT a direct answer to your original question however it might be useful for an overall answer. If we don't like this answer, simply let me know and we'll delete it.
From you clarification in the comments, what I now sense is that you want to create GCP resources that the user can work with. For example, a PubSub topic. We'll use that as an illustration. The first thing I want to do is disavow us of the notion that there is anything "special" about a resource and the identity that it used to create that resource other than the identity must have authority to create it. For example, if user "john" creates a topic, that doesn't mean that the topic is "owned" by john. A GCP resource "just exists" after it is created. In order for a user to "use" a resource, it (the resource) must authorize the sets of users to work with it. This is where GCP IAM comes into play. Separate your goal into two parts.
Upon request, a new GCP topic is created
Once the GCP topic is created, you grant permissions on the topic to be worked with by named identities (users/groups)
Don't think "The user who creates the topic is immediately the one who can work with it".
For example, you may wish to grant your users the ability to subscribe to a topic but may not want those users to be able to "manipulate" topics such as creation/update/delete.
I am assuming that the solution you are working against is for end users rather than internal developers?
Off the top of my head, I'm tempted to suggest that you review the following very short video:
How to authenticate calls to your Google Cloud Run service
This is just a teaser but it does give us a clue. It alludes to the notion that a request from an authenticated (to Google) user can be received by a Cloud Run instance and Cloud Run can then know who the user is. With that in mind, in the code of your Cloud Run, you can then make a "yes/no" decision as to whether to proceed. If yes to proceed, then Cloud Run (which is indeed running as a single user and we won't change that) creates the topic and then assigns subscription (or publication or other) permissions to the topic on behalf of the identity that came in with the request.

Persistance behaviour of Camunda on user tasks

at our company we are going to use Camunda workflow engine for process automation. At the moment we are trying to define a reasonable workflow which mirrors our business process. We don't really know how to model (and then implement) the following scenario:
Start -> Service Task 1 -> User Task -> Gateway -> Service Task 2 (based on user choice in the User Task)
The Service Task 1 creates an object, which can be used by a user in the User Task. A user chooses (based on the state of the object created in Service Task 1 and on his rights) the next action to be executed on the object.
E.q. we have user A and user B. User A may edit the object, create a report, review it, forward it to another user, or complete the processing of the object. User B may ask for a review, forward the object to another user, or complete the processing, but only if the object was already reviewed by user A.
In order to offer to the user only the actions (gateway outcomming sequence flows / service tasks) he could choose from, we have to decide it (to filter the possible actions) after the Service Task 1 was already completed and the user logs in and chooses the process instance to go on.
How could this situation be propely modeled by bpmn?
How would you implement it using camunda? Using some sort of Listeners, JavaDelegate implementations, something else?
Regards,
Iryna.
I don't know if they are a lot of BPMN specialists on Stackoverflow but for modeling questions I would have a look at the camunda network.
There you can upload your BPMN files and ask for review (and comments can be added on the BPMN elements, neat feature)

django: give some users less permissions

The app is installed at several customers and each installation has several groups and a lot of users.
In the past every user was allowed to use the basic feature BasicFeature.
A small new group ("RestrictedUsage") of users should not have the permission to have this BasicFeature.
Our current automated update idea looks like this:
Create new permission UseBasicFeature
Give all existing groups the new permission.
Create the new group "RestrictedUsage"
Since we have several customers, we need an automated way to handle this.
The above solution does should work, but I don't like it.
I don't like it because installations which don't have a "RestrictedUsage" group need to be modified. Otherwise the users would not be allowed to use BasicFeature (which they use since ages).
Has anybody see better way?

Multiple services from the same executable

I've written a small service (plain Win32) and I'd like to know if it's possible to run multiple instances of it when multiple users are logged on.
Basically, let's say we've got UserA and UserB for UserA the service would log on as "domain\UserA" and for UserB the service would log on as "domain\UserB" - this is from the same executable of course. I can change the logon dynamically using the ChangeServiceConfig() function, but it changes it system-wide it seems, while I'd like each user to have his own copy of the service running only for him.
Thank you in advance for any pointers.
Win32 services are designed to be system-wide, and start running before any user is logged in. If you want something to run on a per-user basis, it's probably better to design it as a regular application and run it from the user's Startup group.
Is it possible to perhaps have the service create child processes which then adopt the user credentials (or be started with them)? This way you're still limited to a single instance of the service, but it is able to do its per-user jobs all the same. IIRC the Windows Task Scheduler service does this.
The whole concept of a service is that it is started before any user is even logged on. so even if this was possible, you wouldn't be able to choose between userA and userB when the service starts because none of them is logged on yet.
A possible direction would be for the service to run as SYSTEM And every few minutes check if there is a user logged in, if there is- impersonate that user and do this stuff.
Yes, that sounds close (I'm answering comment from Greg, but comments are too short to fit my reply).
I don't know the list of users beforehand, but there's a GUI control application that would be used to enter username/password pairs for each user. So, userA would log on, run the application, enter his credentials and service would use that. At the same time (after userA has logged off, but the service is still running with userA's credentials) userB logs on, uses the app, and another copy of the service starts running as logged on userB. Thus, at the same time userA and userB services are running.
Is that possible?
You are probably looking to Impersonate the users. Check out some references I found with a quick Google search here:
MSDN Article on WindowsIdentity.Impersonate
.Net Security Blog Article
It sounds as if you actually have two different, conflicting requirements, as to timing and identity.
Run as each logged in user
Run automatically even if no user is logged in.
No way to do this trivially, instead consider wrapping your program in a service; the program will run normally on startup for each user (either thru the startup folder or taskscheduler), and in addition create a service to run your app as a system user (or any other user you define).
Since you also need (you mention this in the comments) the app to keep running as the enduser even after he logs out, you can have the service manage this process for you.
HOWEVER this might not be the best idea, since the user is still effectively logged in. This can have numerous side effects, including security, performance (too many users logged in at once...), etc.
You could create an service application and a non-service(normal) application and make them communicate through IPC (Mapped File, Pipes, MailSolts ... you name it).
This way you solve all the troubles.
NOTE: The same application can behave differently - when started as a process and when started by a user, but in the end it is the same thing, you still have 2 applications (no matter if you got only one executable).
Running with different accounts is possible. In fact, this is common. See svchost.exe, which implements a bunch of OS services.
I just don't get how you determine which accounts. In a big company, many PCs are set up so all 100.000+ employees could use it. You don't want to run your service as the logged-in users, nor can you want to run it for all 100.000 users. So for which accounts, I have to ask?
A Windows process can only execute with the privileges of one single user at a time. This applies to services and other processes. With enough privileges it is possible to "switch" between different users by using impersonation. The most common pattern for what you are trying to do is to have one instance of a privileged service which registers to log in/log out events and creates children processes accordingly, each one of them impersonating the logged in user. The pattern will also simplify UI as each process runs on each separate user's Desktop, as if it were a regular application.
If you keep the privileged service's code as simple as possible this pattern has the added benefit that you are minimizing the attack surface of your code. If a user finds a security problem on the "running as user" side of your service it is a non-issue, while security problems in the privileged services could lead to privilege escalation. In fact, before Vista privileged services implementing a Windows message processing loop are vulnerable to a type of attack called Shatter attacks, which you should be aware of given what you are trying to do.
You want this running all the time, so you want a service.
You want something tracking each user, so you want an application which runs in the user session and communicates with the service (using named pipes or DCOM or whatever fits your requirements).
You don't need multiple instances of your service. From the description of your problem it looks like what you need is one service that can impersonate users and execute jobs on their behalf.
You can do this by implementing a COM object hosted in a service. Your client application (that the end user runs) will call CoCreateInstanceEx on your CLSID. This would cause new instance of your COM object to be created in your service. Then the application can use a method on one of your interfaces to pass the collected user credentials to the COM object (though I'd be wary of collecting credentials and instead see if I can pass the user token instead). The COM object which is running in the context of the service can then call LogonUser() to log on the user and impersonate it, so it can do whatever on her behalf (like finding the user local appdata folder :-)). Other answers havve good links to impersonating users using credentials or token.
If you feel comfortable with COM, I'd suggest you create your objects as multithreaded (living in the MTA), so that their execution is not serialized by COM. If not, the default single threaded model would be good enough for you.
The Visual Studio ATL wizard can generate the skeleton of a COM object living in a service. You can also read about implementing Windows Service with ATL here: http://msdn.microsoft.com/en-us/library/74y2334x(VS.80).aspx
If you don't know COM at all, you can use other communication channels to pass the credentials to your service.
In any case, once your service gets the credentials, all the work on behalf of the user will have to be executed on a background thread, so as to not block the application running as the user.