{"id":15591,"date":"2016-07-19T11:00:03","date_gmt":"2016-07-19T11:00:03","guid":{"rendered":"https:\/\/www.whizlabs.com\/?p=15591"},"modified":"2020-08-31T12:17:41","modified_gmt":"2020-08-31T12:17:41","slug":"what-is-web-application-security-part-3","status":"publish","type":"post","link":"https:\/\/www.whizlabs.com\/blog\/what-is-web-application-security-part-3\/","title":{"rendered":"What is Web application Security &#8211;  Part 3"},"content":{"rendered":"<p><span lang=\"EN-US\">\u2018Web application security\u2019 is part of the \u2018Web component developer\u2019 exam and we have already seen two posts relating to it. Recall, that we have already discussed the four authentication methods and the web resource collection element which is part of the authorization. We conclude the discussion of \u2018Web application security\u2019 by talking about the authorization constraint and user data constraint in this post.<\/span><\/p>\n<h2><span lang=\"EN-US\">The different authorization constraints:<\/span><\/h2>\n<p><span lang=\"EN-US\">Authorization is giving authenticated or unauthenticated roles access to restricted resources. Let us consider the first type of authorization constraint. <\/span><\/p>\n<ol>\n<li><span lang=\"EN-US\"> <\/span><span lang=\"EN-US\"><span lang=\"EN-US\">Here, roles such as \u2018Super user\u2019 and \u2018Normal user\u2019 are allowed to access the resources at \u2018NewServlet\u2019 protected by the \u2018GET\u2019 method. For example, consider the code snippet given below:<br \/>\n<\/span><\/span><i><span lang=\"EN-US\">&lt;servlet&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;servlet-name&gt;NewServlet&lt;\/servlet-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;servlet-class&gt;NewServlet&lt;\/servlet-class&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 &lt;\/servlet&gt;<\/span><\/i><i><span lang=\"EN-US\">&lt;servlet-mapping&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;servlet-name&gt;NewServlet&lt;\/servlet-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;url-pattern&gt;\/NewServlet&lt;\/url-pattern&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 &lt;\/servlet-mapping&gt;<\/span><\/i><\/p>\n<p><i><span lang=\"EN-US\">\u00a0\u00a0\u00a0 &lt;security-constraint&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;web-resource-collection&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;web-resource-name&gt; Application &lt;\/web-resource-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;url-pattern&gt; \/NewServlet &lt;\/url-pattern&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;http-method&gt; GET &lt;\/http-method&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;\/web-resource-collection&gt;<\/span><\/i><\/p>\n<p><span style=\"color: #ff0000\"><i><span lang=\"EN-US\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;auth-constraint&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;role-name&gt; Super User &lt;\/role-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;role-name&gt; Normal\u00a0 User &lt;\/role-name&gt;<br \/>\n<\/span><\/i><\/span><i><span lang=\"EN-US\"><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;\/auth-constraint&gt;<\/span><br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0&lt;\/security-constraint&gt;<\/span><\/i><\/li>\n<li><span lang=\"EN-US\"><span lang=\"EN-US\">The second type of authorization constraint is stated as follows:<br \/>\n<\/span><\/span><span lang=\"EN-US\">&lt;auth-constraint&gt;<br \/>\n<\/span><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0<strong> &lt;role-name&gt; * &lt;\/role-name&gt;<br \/>\n<\/strong><\/span>\u00a0 &lt;\/auth-constraint&gt;<span lang=\"EN-US\">Specifying <\/span><span lang=\"EN-US\" style=\"color: #ff0000\">&lt;<b>role-name&gt; * &lt;\/role-name&gt;<\/b><\/span><span lang=\"EN-US\"> involves giving all roles access to specified resources. It is important to note here that \u2018all roles\u2019 means users who have been <b>authenticated. <\/b>It is specified in the deployment descriptor in the above way.<\/span><\/li>\n<li><span lang=\"EN-US\"><span lang=\"EN-US\">The third type of authorization constraint where an authorization constraint is specified, but no roles are specified, indicates that none of the roles are allowed access to constrained resources. This is stated as follows:<br \/>\n<\/span><\/span><span lang=\"EN-US\">&lt;security-constraint&gt;<br \/>\n<\/span><b><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #ff0000\">&lt;auth-constraint\/&gt;<\/span><br \/>\n<\/span><\/b>\u00a0 \u00a0 &lt;\/security-constraint&gt;<\/li>\n<li><span lang=\"EN-US\">Not specifying a \u2018&lt;auth-constraint&gt;\u2019 element is the fourth type of authorization constraint.\u00a0 This states that all users in all roles are given access to resources whether they are authenticated or not.<br \/>\n<\/span>Having seen the different authorization constraints, let us see what will happen if two different security constraints are specified in a program.<span lang=\"EN-US\">\u00a0\u00a0 <i>&lt;security-constraint&gt;<\/i><\/span><i><\/i><\/p>\n<p><i><span lang=\"EN-US\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;web-resource-collection&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;web-resource-name&gt; Listener &lt;\/\u00a0 &lt;web-resource-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&lt;url-pattern&gt; \/chapter01\/Listener\/* &lt;\/url-pattern&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&lt;http-method&gt; GET &lt;\/http-method&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 &lt;\/web-resource-collection&gt;<\/span><\/i><\/p>\n<p><span style=\"color: #ff0000\"><i><span lang=\"EN-US\">&lt;auth-constraint&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 &lt;role-name&gt; Super User &lt;\/role-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 &lt;role-name&gt; Normal\u00a0 User &lt;\/role-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">&lt;\/auth-constraint&gt;<\/span><\/i><\/span><\/p>\n<p><i><span lang=\"EN-US\">&lt;\/security-constraint&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">&lt;security-constraint&gt;<\/span><\/i><\/p>\n<p><i><span lang=\"EN-US\">\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;web-resource-collection&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;web-resource-name&gt; Listener &lt;\/\u00a0 &lt;web-resource-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;url-pattern&gt; \/chapter01\/Listener\/* &lt;\/url-pattern&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&lt;http-method&gt; GET &lt;\/http-method&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0&lt;\/web-resource-collection&gt;<\/span><\/i><\/p>\n<p><span style=\"color: #ff0000\"><i><span lang=\"EN-US\">&lt;auth-constraint&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">\u00a0 \u00a0 &lt;role-name&gt; * &lt;\/role-name&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">&lt;\/auth-constraint&gt;<\/span><\/i><\/span><\/p>\n<p><i><span lang=\"EN-US\">&lt;\/security-constraint&gt;<br \/>\n<\/span><\/i><i><span lang=\"EN-US\">&lt;\/web-app&gt;<\/span><\/i><\/p>\n<p>The first &lt;auth-constraint&gt; specifies <b>two roles<\/b> to access the \u2018\/chapter01\/Listener\u2019 resource and the second &lt;auth-constraint&gt; specifies that <b>all roles are given access to the same resource<\/b>. In such a case, it is the amalgamation of roles that are given access.<\/li>\n<\/ol>\n<h2>User data constraint:<\/h2>\n<p>We have seen how authentication and authorization are implemented to manage web security. Next we see the user data constraint element that is used to implement the security mechanisms of \u2018confidentiality\u2019 and \u2018data integrity\u2019.<\/p>\n<p>\u2018Confidentiality\u2019 is making sure that the information that is sent from the sender to the receiver is only received by the receiver and not by other external parties. \u2019Data integrity\u2019 is making sure that the information is not tampered in transit.<\/p>\n<p>The user data constraint is specified as follows:<\/p>\n<p><span style=\"color: #ff0000\"><i>&lt;user-data-constraint&gt;<br \/>\n<\/i><i>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&lt;transport-guarantee&gt; INTEGRAL &lt;\/transport-guarantee&gt;<br \/>\n<\/i><i>\u00a0 &lt;\/user-data-constraint&gt;<\/i><\/span><\/p>\n<p>The transport guarantee element takes the values of \u2018INTEGRAL\u2019, \u2018NONE\u2019 OR \u2018CONFIDENTIAL\u2019. \u00a0\u2018CONFIDENTIAL\u2019 makes sure that encryption is enabled on the channel. \u2018INTEGRAL\u2019 makes sure that the integrity of the data is preserved.<\/p>\n<p>We have seen the four security mechanisms and their implementations. Enforcing these security mechanisms will make sure that the web applications are more secure.<\/p>\n<p><span lang=\"EN-US\">\u00a0<\/span><\/p>\n<p><span lang=\"EN-US\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2018Web application security\u2019 is part of the \u2018Web component developer\u2019 exam and we have already seen two posts relating to it. Recall, that we have already discussed the four authentication methods and the web resource collection element which is part of the authorization. We conclude the discussion of \u2018Web application security\u2019 by talking about the authorization constraint and user data constraint in this post. The different authorization constraints: Authorization is giving authenticated or unauthenticated roles access to restricted resources. Let us consider the first type of authorization constraint. Here, roles such as \u2018Super user\u2019 and \u2018Normal user\u2019 are allowed to [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17],"tags":[1594],"class_list":["post-15591","post","type-post","status-publish","format-standard","hentry","category-news-updates","tag-web-application-security"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"profile_24":false,"profile_48":false,"profile_96":false,"profile_150":false,"profile_300":false,"tptn_thumbnail":false,"web-stories-poster-portrait":false,"web-stories-publisher-logo":false,"web-stories-thumbnail":false},"uagb_author_info":{"display_name":"Pavan Gumaste","author_link":"https:\/\/www.whizlabs.com\/blog\/author\/pavan\/"},"uagb_comment_info":0,"uagb_excerpt":"\u2018Web application security\u2019 is part of the \u2018Web component developer\u2019 exam and we have already seen two posts relating to it. Recall, that we have already discussed the four authentication methods and the web resource collection element which is part of the authorization. We conclude the discussion of \u2018Web application security\u2019 by talking about the&hellip;","_links":{"self":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/15591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/comments?post=15591"}],"version-history":[{"count":1,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/15591\/revisions"}],"predecessor-version":[{"id":75858,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/15591\/revisions\/75858"}],"wp:attachment":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media?parent=15591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/categories?post=15591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/tags?post=15591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}