[midPoint] Midpoint Role based on AD Group
Laza, Javier
Javier.Laza at ingrammicro.com
Wed Nov 11 10:59:34 CET 2020
Hello,
* Your solution would work, BUT, i said confluence as an example, I will have hundreds of roles so hardcoding this in the code would make the XML very big and hard to maintain. But it would work I guess
* I have actually accomplished this using the association explained here https://wiki.evolveum.com/display/midPoint/Inbound+Mapping#InboundMapping-Association in the Example “Modified inbound example for associations (since 3.9)"
But this will only work for mappings of “1 midpoint role” <-> “1 ad role”
* I also tried another approach, using a Bulk Action (code below), I am able to find all the accounts in a certain resource which has a certain AD group assigned, but as the role is assigned to a user, not to an account, I don’t know to continue. I guess there will be a way to find the owner of the Shadow Account… I would appreciate someone’s help about this, as I think this is the best solution, as I could create a bulk action per role, and also map more than one AD role to one midpoint role
<s:search xmlns:s="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<s:type>ShadowType</s:type>
<s:searchFilter>
<and xmlns="http://prism.evolveum.com/xml/ns/public/query-3">
<ref>
<path>resourceRef</path>
<value xsi:type="c:ObjectReferenceType" oid="cccccccc-0000-0000-0001-000000000001"/>
</ref>
<equal>
<path>kind</path>
<value xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance/10000000-0000-0000-0000-000000000004">account</value>
</equal>
<equal>
<path>attributes/memberOf</path>
<value>CN=Confluence...</value>
</equal>
</and>
</s:searchFilter>
<-- I would change this action to the assign role action, but right now I am using the LOG action so I can see the results in the midpoint.log file -->
<s:action>
<s:type>log</s:type>
</s:action>
</s:search>
Regards,
Javier Laza
Cloud Security Operations
(o) +34 942.247.600 EXT: 2100
Plaza de Manuel Llano, Santander, Spain, 39011
[cid:image007.jpg at 01D6B817.12839460]
Twitter<http://bit.ly/IngramTwitter> | LinkedIn<http://bit.ly/IngramLinkedIN> | Facebook<http://bit.ly/IngramFacebook> | YouTube<http://bit.ly/IngramYouTube>
This email may contain material that is confidential, and proprietary to Ingram Micro and subsidiaries, for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
From: Loïc SCHAMBER <lschamber at positivethinking.tech>
Sent: martes, 10 de noviembre de 2020 14:33
To: midPoint General Discussion <midpoint at lists.evolveum.com>
Cc: Laza, Javier <Javier.Laza at ingrammicro.com>
Subject: RE: Midpoint Role based on AD Group
Hi Javier,
As you don’t use midpoint for provisioning purposes I think you could use inbound mapping in your AD resource to achieve your goal.
In your memberOf attribute you could have such mapping
<inbound>
<expression>
<assignmentTargetSearch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:AssignmentTargetSearchExpressionEvaluatorType">
<targetType>RoleType</targetType>
<oid>your-oid</oid>
</assignmentTargetSearch>
</expression>
<condition>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType">
<code>
// Check if input == CN=Confluence…
</code>
</script>
</condition>
<target>
<c:path>assignment</c:path>
</target>
</inbound>
I’m not sure about data structure inside input but you should retrieve the memberOf values. I let you check logs on script expression for it 😉
Best regards,
[logo]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.positivethinking.tech_&d=DwMGaQ&c=--1RjWWBW4Kf6aBAaj53vPItwfT0BR1YjSDV46P5EvE&r=0OeKN_TS34QS-SJXC_YJThvidGwk12Q2O3mVC4v6a-g&m=luACZ0EY0uRzPR37-IsowD1wg3JKCvPsNeFS0eLA0NA&s=BcNa4VjmQrGO_PcIPxx8wfVEqQZuy73IBhVRVNF-0-E&e=>
Loïc Schamber | IT Consultant
lschamber at positivethinking.tech<mailto:lschamber at positivethinking.tech>
Tel. +41 22 721 07 77<tel:+41%2022%20721%2007%2077> | Direct. +41 22 555 27 69<tel:+41%2022%20555%2027%2069>
[LinkedIn]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.linkedin.com_company_the-2Dpositive-2Dthinking-2Dcompany_&d=DwMGaQ&c=--1RjWWBW4Kf6aBAaj53vPItwfT0BR1YjSDV46P5EvE&r=0OeKN_TS34QS-SJXC_YJThvidGwk12Q2O3mVC4v6a-g&m=luACZ0EY0uRzPR37-IsowD1wg3JKCvPsNeFS0eLA0NA&s=Nr13knzBKQl3zEjVel2Nuv9MllJh4P3DID6vxJVnpn0&e=> [Instagram] <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.instagram.com_positivethinkingcompany_&d=DwMGaQ&c=--1RjWWBW4Kf6aBAaj53vPItwfT0BR1YjSDV46P5EvE&r=0OeKN_TS34QS-SJXC_YJThvidGwk12Q2O3mVC4v6a-g&m=luACZ0EY0uRzPR37-IsowD1wg3JKCvPsNeFS0eLA0NA&s=yJ1FfKWgIIzTXlsYz9OZsi3eyS-9ljfag8VMETjAK5M&e=> [Vimeo] <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_PTC-5FTech&d=DwMGaQ&c=--1RjWWBW4Kf6aBAaj53vPItwfT0BR1YjSDV46P5EvE&r=0OeKN_TS34QS-SJXC_YJThvidGwk12Q2O3mVC4v6a-g&m=luACZ0EY0uRzPR37-IsowD1wg3JKCvPsNeFS0eLA0NA&s=DH0eC8p3MWkvgvp2IzqJ6ZRtbCpHCAYL_blgNfH7hbI&e=> [Vimeo] <https://urldefense.proofpoint.com/v2/url?u=https-3A__youtube.com_channel_UCfaImWa6r0IoZoUYLhbiF7w&d=DwMGaQ&c=--1RjWWBW4Kf6aBAaj53vPItwfT0BR1YjSDV46P5EvE&r=0OeKN_TS34QS-SJXC_YJThvidGwk12Q2O3mVC4v6a-g&m=luACZ0EY0uRzPR37-IsowD1wg3JKCvPsNeFS0eLA0NA&s=H3Pbf-gsEwRauD7KZlJNstGXgv5F8yNYOQKa0mD4KXE&e=>
Chemin du Pré-Fleuri 5 – CH 1228 Plan-les-Ouates
[logo]<https://urldefense.proofpoint.com/v2/url?u=https-3A__positivethinking.tech_&d=DwMGaQ&c=--1RjWWBW4Kf6aBAaj53vPItwfT0BR1YjSDV46P5EvE&r=0OeKN_TS34QS-SJXC_YJThvidGwk12Q2O3mVC4v6a-g&m=luACZ0EY0uRzPR37-IsowD1wg3JKCvPsNeFS0eLA0NA&s=vgW1xBF0zZLUz1YsFw2njVxwYFoKfmv2SjcpiSdzOJc&e=>
________________________________
Help save paper, do you really need to print this email?
The content of this email and any attachments are confidential and are intended solely for the person and/or company to whom they are addressed. The information may also be legally privileged. No employee or agent is authorized to conclude any binding agreement on behalf of Positive Thinking Company with another party by email without express written confirmation. If you have received this email in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by return E-mail and delete this message, its attachments and all copies from your system. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. Thank you for your cooperation.
From: midPoint <midpoint-bounces at lists.evolveum.com<mailto:midpoint-bounces at lists.evolveum.com>> On Behalf Of Laza, Javier via midPoint
Sent: mardi, 10 novembre 2020 11:06
To: midPoint General Discussion <midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>>
Cc: Laza, Javier <Javier.Laza at ingrammicro.com<mailto:Javier.Laza at ingrammicro.com>>
Subject: [midPoint] Midpoint Role based on AD Group
Hi all,
I am not using midpoint for provisioning purposes but to have a global view of all my users and its accounts.
I want to read the accounts in the resources and map roles based on that. For example, I have the following role, which based on the user’s subtype assigns the Associate role to the user. I have another role for Contrators. This approach works, so I can go to the user’s assignments and check if he/she is a contractor or associate
<role>
<name> Associate</name>
<description> Employee</description>
<displayName> Associate</displayName>
<autoassign>
<enabled>true</enabled>
<focus>
<selector>
<type>UserType</type>
</selector>
<mapping>
<strength>strong</strength>
<source>
<path>subtype</path>
</source>
<condition>
<script>
<code>
subtype == 'Associate'
</code>
</script>
</condition>
</mapping>
</focus>
</autoassign>
</role>
Now, I have an AD group that contains the users with access to Confluence. How could I create a role for this?
How could I create a role that checks whether a user has an account in certain resource, and if so, if the account’s memberOf attribute contains ‘CN=Confluence, OU=Access Groups,DC=example,DC=com’?
Thanks!
La información contenida en este mensaje es confidencial. En caso de que reciba este mensaje por error le rogamos lo comunique a la mayor brevedad al emisor y proceda a su eliminación definitiva, absteniéndose de copiar, almacenar o difundir su contenido. De acuerdo con lo establecido en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal y en el Reglamento de Desarrollo 1720/2007, los datos personales que facilite a través de la dirección de correo indicada serán incorporados a un fichero titularidad de INGRAM MICRO, S.L.U., con domicilio en C/ Antonio Machado, 78-80 1ª y 2ª pl. Business Park ( 08840-Viladecans). Mediante el envío de sus datos, Ud. otorga su consentimiento expreso a INGRAM MICRO, S.L.U, para el tratamiento de sus datos, con la finalidad de atender a su consulta y/o mantener la relación profesional, comercial, y/o contractual que en su caso establezca con INGRAM MICRO, S.L.U. Puede ejercitar sus derechos de acceso, rectificación, cancelación y oposición notificándolo por escrito a la dirección del remitente, o a la siguiente dirección de correo nuevascuentas at ingrammicro.es<mailto:nuevascuentas at ingrammicro.es>. De acuerdo con la Ley 34/2002, de Servicios de la Sociedad de la Información y de Comercio Electrónico, Vd. podrá oponerse en cualquier momento al tratamiento de sus datos con fines promocionales notificándonoslo por escrito a la dirección de correo mencionada.
.................................................................................................................................................................................................................................................
The information contained in this message is confidential. If you receive this message by error please notify it as soon as possible to the sender and proceed to their final elimination by not copy, store or distribute its content. In accordance of what is stated in the Law 15/1999, of Data Personal Protection and Regulation Rule 1720/2007, the personal data provided through the email address you entered will be included in a file owned by INGRAM MICRO, SLU, located at C/ Antonio Machado, 78-80 1ª y 2ª pl. Business Park ( 08840-Viladecans). By submitting your data, you expressly give your consent to INGRAM MICRO, SLU, to the treatment of your data, in order to answer to your questions and / or keep the professional, commercial relationship and / or contractual set with INGRAM MICRO, SLU You can exercise your rights of access, rectification, cancellation and opposition by giving written notification to the sender address or to the following email: nuevascuentas at ingrammicro.es<mailto:nuevascuentas at ingrammicro.es>. According to Law 34/2002, of the Information Society and Electronic Commerce, you may object at any time to your data treatment for promotional purposes by notifying us in writing to the email address above.
[Ingram_2818e5de]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.jpg
Type: image/jpeg
Size: 2057 bytes
Desc: image007.jpg
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 7735 bytes
Desc: image008.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 2337 bytes
Desc: image009.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.png
Type: image/png
Size: 2756 bytes
Desc: image010.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image011.png
Type: image/png
Size: 2358 bytes
Desc: image011.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image012.png
Type: image/png
Size: 2669 bytes
Desc: image012.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image013.png
Type: image/png
Size: 23393 bytes
Desc: image013.png
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20201111/7b8149eb/attachment-0011.png>
More information about the midPoint
mailing list