<?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>Krishna Sunuwar &#187; security</title>
	<atom:link href="http://www.krishnasunuwar.com.np/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.krishnasunuwar.com.np</link>
	<description>PHP programmer bloging programming, open soruce technologies</description>
	<lastBuildDate>Sat, 04 Sep 2010 16:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>RBAC schemas (Entities Relationship) in phpBricks</title>
		<link>http://www.krishnasunuwar.com.np/2009/07/rbac-schemas-entities-relationship-in-phpbricks/</link>
		<comments>http://www.krishnasunuwar.com.np/2009/07/rbac-schemas-entities-relationship-in-phpbricks/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 02:55:14 +0000</pubDate>
		<dc:creator>Krish</dc:creator>
				<category><![CDATA[phpBricks]]></category>
		<category><![CDATA[RBAC]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.krishnasunuwar.com.np/?p=94</guid>
		<description><![CDATA[phpBricks saves roles, resources and permissions in database which looks following (more to come later): Update: RBAC model has been changed. This one is new model.]]></description>
			<content:encoded><![CDATA[<p>phpBricks saves roles, resources and permissions in database which looks following (more to come later):</p>
<p><img title="RBAC schemas (Entities Relationship) in phpBricks" src="http://i70.photobucket.com/albums/i88/s2krish/blug_new/rbac-model-1.jpg" alt="RBAC schemas (Entities Relationship) in phpBricks" /></p>
<p>Update: RBAC model has been changed. This one is new model.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krishnasunuwar.com.np/2009/07/rbac-schemas-entities-relationship-in-phpbricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RBAC &#8211; how do I code in phpBricks</title>
		<link>http://www.krishnasunuwar.com.np/2009/06/rbac-how-do-i-code-in-phpbricks/</link>
		<comments>http://www.krishnasunuwar.com.np/2009/06/rbac-how-do-i-code-in-phpbricks/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 02:39:55 +0000</pubDate>
		<dc:creator>Krish</dc:creator>
				<category><![CDATA[phpBricks]]></category>
		<category><![CDATA[RBAC]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.krishnasunuwar.com.np/?p=74</guid>
		<description><![CDATA[Last week, I wrote blog about RBAC architecture in phpBricks (http://tinyurl.com/rbac1). Today, I am going to give little snapshots about coding implementation. As you already know, RBAC is a component, but it is special provisioned component which works with core phpBricks. There is quick option which tells whether to apply RBAC or not. If you [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I wrote blog about RBAC architecture in phpBricks (<a href="http://tinyurl.com/rbac1">http://tinyurl.com/rbac1</a>). Today, I am going to give little snapshots about coding implementation. As you already know, RBAC is a component, but it is special provisioned component which works with core phpBricks. There is quick option which tells whether to apply RBAC or not. If you decide to apply RBAC set code in configuration like:<br />
<code>define('_RBAC', 1);</code></p>
<p>When RBAC is applied, an instance of RBAC is available in controller and views, but not in model classes. RBAC is not relevant in model because models are not supposed to contain any business logic. It is very much important to understand how each function is accessed to understand how RBAC determine authenticity. Each resource (or function) is identified with set of parameters, called CMA. Suppose you want to see list of users, that means calling index method of users. For that CMA parameter looks like (&#8216;c&#8217;=&gt;&#8217;user&#8217;, &#8216;m&#8217;=&gt;&#8217;users&#8217;, &#8216;a&#8217;=&gt;&#8217;index&#8217;).</p>
<p>In RBAC, permissions are assigned to roles not to users. Users inherit permission from their roles. So checking permission is done with combination of provided CMA parameters and roles. There is function called isPermission which takes 5 parameters. First three are CMA, fourth is primary_key (for advance business rule), and fifth is roles. Last two are optional.</p>
<p>For example, if you want to check that whether current loged in user has permission to see list of users or not:</p>
<p><code><br />
if($this-&gt;Auth-&gt;isPermission('user','users','index'))<br />
{<br />
// code to list users<br />
}<br />
else<br />
{<br />
// sorry permission denied.<br />
}</code><br />
<em>This works from view and controller.</em></p>
<p>Roles of user is collected at time of login and stored in session, which is available in $_SESSION['__userroles']. So if you don&#8217;t pass roles parameter, phpBricks suppose current user. Now your turn to think how do you check permission of a users who is not loged in.</p>
<p>&#8212;&#8212;&#8212;-</p>
<p>This blog is intended to alpha users of phpBricks. Thank you guys, you are source of energy. Thanks for suggestion, exceptions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krishnasunuwar.com.np/2009/06/rbac-how-do-i-code-in-phpbricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RBAC in phpBricks</title>
		<link>http://www.krishnasunuwar.com.np/2009/06/rbac-in-phpbricks/</link>
		<comments>http://www.krishnasunuwar.com.np/2009/06/rbac-in-phpbricks/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 02:22:31 +0000</pubDate>
		<dc:creator>Krish</dc:creator>
				<category><![CDATA[phpBricks]]></category>
		<category><![CDATA[RBAC]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.krishnasunuwar.com.np/?p=65</guid>
		<description><![CDATA[Role Based Permission Control (RBAC) is widely used security module in the industry, including Oracle, Microsoft Exchange Server (some form of it). When MAC and DAC unable to address business rule, a concept of RBAC is brought into practice.  In this model, users are not assigned permission directly but acquire from their role(s). Role, which [...]]]></description>
			<content:encoded><![CDATA[<p>Role Based Permission Control (RBAC) is widely used security module in the industry, including Oracle, Microsoft Exchange Server (some form of it). When MAC and DAC unable to address business rule, a concept of RBAC is brought into practice.  In this model, users are not assigned permission directly but acquire from their role(s). Role, which is created for job function in organization and each role are designated to perform set of operations. En employee can perform operation, which is assigned to his/her role(s). So, it is pretty straight forward.</p>
<p>I have implemented lightweight form of RBAC (lightweight is my personal terminology). It&#8217;s lightweight because it exactly address need of web application. RBAC itself is very huge while implementing whole features, it&#8217;s like giant elephant. In phpBricks, RBAC is included in user component. As shown in figure bellow, it consists of Users, Roles, Permissions and Resource Registry (Operations).</p>
<ul>
<li><strong>Users</strong>: Subject which access application. A user can have multiple roles e.g. Forum editor and CMS editor.</li>
<li><strong>Roles</strong>: Job title which consists list of operations (job). Roles can be two type, black list or white list (allow list or deny list)</li>
<li><strong>Permission</strong>: Indicate approval to access resources.</li>
<li><strong>Resource Registry</strong>: List of operations (action, also called method) which is grouped into component and module. Method represent actual operation or function where component and module are packges. phpBricks is smart that it collect all components, modules and methods, then build registry automatically so programmer don&#8217;t need to worry about accounting all these.</li>
</ul>
<p><img src="http://i70.photobucket.com/albums/i88/s2krish/blug_new/rbac-model.jpg" alt="RBAC in phpBricks" /></p>
<p><strong>How to define?</strong></p>
<p>From back-end when you access RBAC, it shows matrix of roles and resources (operations). Simply you can tick on check-box to allow or deny access. One important thing to remember is that role type. By default all operations are allowed in black-list role and all operations are denied in white-list roles. So by selecting operation under black-list role, you are banning access, but in white-list you are allowing.</p>
<p><strong>How it works?</strong></p>
<p>Resource is always identified by three parameters i.e. component, module and actions knows as CMA (fourth is optional i.e. primary key for advance business rule). So, whenever user try perform certain operation, based on CMA phpBricks authenticates.</p>
<p><strong>What next?</strong></p>
<p>Checking permission on realtime basis while access request is made, can cause performance to be slow. So, I am thinking permission caching technique.</p>
<p><strong>Recommended reading:</strong></p>
<p>Role-Based Access Control by David F. Ferraiolo (can be found it in Amazon)</p>
<p><strong>Note:</strong></p>
<p><strong></strong>In above text, following terminology may be confused while used interchangeably.</p>
<p>Operation=Function=Resource=Action=Method</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krishnasunuwar.com.np/2009/06/rbac-in-phpbricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Killing Auto Run Virus from Pen Drive</title>
		<link>http://www.krishnasunuwar.com.np/2009/06/killing-auto-run-virus-from-pen-drive/</link>
		<comments>http://www.krishnasunuwar.com.np/2009/06/killing-auto-run-virus-from-pen-drive/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 00:26:22 +0000</pubDate>
		<dc:creator>Krish</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virus]]></category>

		<guid isPermaLink="false">http://www.krishnasunuwar.com.np/?p=58</guid>
		<description><![CDATA[If you are suffering from Auto Run Virus that comes with Pen Drive, that&#8217;s bad luck! Hardly a few anti-virus can scan. That&#8217;s because most of virus (Trojan) are produce in the region which is hard to detect for US/EU based anti-virus. It was same for me until a friend of mine suggested about me [...]]]></description>
			<content:encoded><![CDATA[<p>If you are suffering from Auto Run Virus that comes with Pen Drive, that&#8217;s bad luck! Hardly a few anti-virus can scan. That&#8217;s because most of virus (Trojan) are produce in the region which is hard to detect for US/EU based anti-virus. It was same for me until a friend of mine suggested about me Autorun Killer.</p>
<p>Autorun Killer is designed to clean Auto Run virus from Pen Drive. You can download it from <a href="http://tinyurl.com/maeww4">http://tinyurl.com/maeww4</a>. So far I found it excellent. It automatically scan Pen Drive once you plug into USB port. Try it and be safe.</p>
<p>Note: Remember Autorun will clean only Autorun.vbs virus. It doesn&#8217;t clean other trojan and virus that come with Pen Drive. So for other type of trojan, use Anti Virus software. I recommend NOD32. It cleans lot of South-Asian trojan.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krishnasunuwar.com.np/2009/06/killing-auto-run-virus-from-pen-drive/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I LOVE KTM website designer&#8217;s website has virus</title>
		<link>http://www.krishnasunuwar.com.np/2009/06/i-love-ktm-website-designers-website-has-virus/</link>
		<comments>http://www.krishnasunuwar.com.np/2009/06/i-love-ktm-website-designers-website-has-virus/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 15:34:26 +0000</pubDate>
		<dc:creator>Krish</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[i love ktm]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virus]]></category>

		<guid isPermaLink="false">http://www.krishnasunuwar.com.np/?p=53</guid>
		<description><![CDATA[Since few days, I see I LOVE KTM is very active and popular in Facebook. Their most awaited website is still on under-construction. Today I log into their home page and tried to see designer&#8217;s site, called anbha.com. When I browse, it&#8217;s reported as affected. Thank god I have latest browser, it alert me about [...]]]></description>
			<content:encoded><![CDATA[<p>Since few days, I see I LOVE KTM is very active and popular in Facebook. Their most awaited website is still on under-construction. Today I log into their home page and tried to see designer&#8217;s site, called anbha.com. When I browse, it&#8217;s reported as affected. Thank god I have latest browser, it alert me about possible threat. Some 4 thousands of users are fan of I LOVE KTM and half of them must have reached anbha.com. They should known the fact that every one doesn&#8217;t have latest browser and should have corrected.  I just left comment to them, let&#8217;s see how they react. I have printed screenshoot for you guys. Look below:</p>
<p><img src="http://i70.photobucket.com/albums/i88/s2krish/blug_new/i-love-ktm-virus.jpg" alt="I LOVE KTM website designer got virus" /><br />
<em><small>www.anbha.com, my intellegent browser says this site has got virus.</small></em></p>
<p>Other site which has got virus is afterslc.com</p>
<p>Be aware before you visit these sites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.krishnasunuwar.com.np/2009/06/i-love-ktm-website-designers-website-has-virus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
