<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pi-manage &#8211; privacyID3A</title>
	<atom:link href="https://www.privacyidea.org/tag/pi-manage/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.privacyidea.org</link>
	<description>flexible, Open Source Multi Factor Authentication (2FA)</description>
	<lastBuildDate>Sun, 02 Dec 2018 12:51:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.privacyidea.org/wp-content/uploads/2016/06/cropped-only-logo-white-background-32x32.png</url>
	<title>pi-manage &#8211; privacyID3A</title>
	<link>https://www.privacyidea.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Setting policies via command line</title>
		<link>https://www.privacyidea.org/setting-policies-via-command-line/</link>
		
		<dc:creator><![CDATA[Cornelius Kölbel]]></dc:creator>
		<pubDate>Sun, 02 Dec 2018 12:51:40 +0000</pubDate>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[pi-manage]]></category>
		<category><![CDATA[Policy]]></category>
		<guid isPermaLink="false">https://www.privacyidea.org/?p=1446</guid>

					<description><![CDATA[privacyIDEA comes with a central tool &#8220;pi-manage&#8221;. pi-manage runs on the local privacyIDEA machine. The interesting thing is, that it operates directly on the database level. So you can use pi-manage, even if your webserver is not running. One important thing is, that you can use pi-manage to manage policies! This way the root user [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>privacyIDEA comes with a central tool &#8220;pi-manage&#8221;. pi-manage runs on the local privacyIDEA machine. The interesting thing is, that it operates directly on the database level. So you can use pi-manage, even if your webserver is not running.</p>
<p>One important thing is, that you can use <a href="https://privacyidea.readthedocs.io/en/latest/installation/system/pimanage/index.html" target="_blank" rel="noopener">pi-manage</a> to manage <a href="https://privacyidea.readthedocs.io/en/latest/policies/index.html" target="_blank" rel="noopener">policies</a>! This way the root user can for example deactivate policies, if the token admin misconfigured something in the Web UI.</p>
<p>But you can even use pi-manage to setup poliies.</p>
<h2>Setting up simple policies</h2>
<p>To view all configured policies run</p>
<pre>pi-manage policy list</pre>
<p>This will give you a list of the policies with their names, and whether they are active or not.</p>
<p>To create a new policy use</p>
<pre>pi-manage policy create &lt;parameters&gt;</pre>
<p>The &#8220;create&#8221; command accepts the positional arguments &#8220;name&#8221;, &#8220;scope&#8221; and &#8220;action&#8221;.</p>
<p>So to create a policy, that sets otppin=userstore, so that users should authenticate with their LDAP password, you need to run</p>
<pre>pi-manage policy create policyname1 authentication otppin=userstore</pre>
<p>This quickly creates a policy with the name &#8220;policyname1&#8221;. Please note, that this does not allow for more complex policies, like with several actions or with user or IP restrictions.</p>
<p>Anyway, this is a quick and easy way to bootstrap your privacyIDEA installation.</p>
<p>If you need more complex setups, you can use the parameter &#8220;filename&#8221;.</p>
<h2>Setting up more complex policies</h2>
<p>Maybe you want to create a policy, that requires users to present their LDAP password, but you also want to pass authentication if the user has no tokens or the user does not exist.</p>
<p>But only for a specific realm! Then you can create a JSON config file, that describes this policy and use this file to bootstrap the privacyIDEA configuration.</p>
<p>The file contains a dictionary with the following content:</p>
<pre>{ 'action': { 
       u'otppin': u'userstore', 
      'passOnNoUser':True, 
      'passOnNoToken':True },
   'active': False,
   'adminrealm': [],
   'check_all_resolvers': False,
   'client': [],
   'condition': 0,
   'name': u'policyname2',
   'priority': 17,
   'realm': ['userrealm'],
   'resolver': [],
   'scope': u'authentication',
   'time': u'',
   'user': []
}</pre>
<p>This way you can set all parameters of a policy. In this case we bound the policy to the userrealm &#8220;userrealm&#8221; and initially deactivated the policy.</p>
<p>You see that using the policy subcommands of the pi-manage tool gives you a lot of possibilities to setup your privacyIDEA system automatically or reconfigure it to a previously defined state.</p>
<p>There are a lot more subcommands of the pi-manage tool, check out the <a href="https://privacyidea.readthedocs.io/en/latest/installation/system/pimanage/index.html" target="_blank" rel="noopener">manpage</a> and stop by at the <a href="https://community.privacyidea.org" target="_blank" rel="noopener">community forum</a>, if you want to discuss any aspects of policies.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
