

{"id":22919,"date":"2018-08-12T08:07:38","date_gmt":"2018-08-12T08:07:38","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=22919"},"modified":"2018-08-12T08:07:38","modified_gmt":"2018-08-12T08:07:38","slug":"avro-sasl-profile","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/","title":{"rendered":"Avro SASL Profile: For Authentication and Security"},"content":{"rendered":"<p>Today, in this article, &#8220;Avro SASL Profile: For authentication and security&#8221; we are discussing Avro SASL profile for connection-based <strong>Avro<\/strong> RPC.<\/p>\n<p>Moreover, we will see negotiation and\u00a0<span style=\"font-weight: 400\">Anonymous Mechanism in SASL Profile in Avro. Along with this, we will discuss Process and Data Session in Avro SASL Profile.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Basically, for authentication and security of network protocols, SASL (RFC 2222) offers a framework. However, each protocol which uses SASL must define a SASL profile.\u00a0 <\/span><\/p>\n<p><span style=\"font-weight: 400\">So, let\u2019s begin with Apache Avro SASL Profile brief introduction.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">What is the Avro SASL Profile?<\/span><\/h2>\n<p><span style=\"font-weight: 400\">By using a selected <em>SASL mechanism<\/em>, SASL negotiation proceeds as a series of message interactions over a connection between a client and server. Moreover, by sending the client&#8217;s chosen mechanism name with an initial (possibly empty) message, the client starts this negotiation. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Basically, with the exchange of messages until either side indicates success or failure, Negotiation proceeds. Although the content of the messages is mechanism-specific. Although the session can proceed over the connection only if the negotiation succeeds, else it must abandon.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In addition, even after negotiation, some of the mechanisms continue to process session data but some of the mechanisms does specify that further session data is transmitted unmodified. <\/span><\/p>\n<h2><span style=\"font-weight: 400\">Negotiation in Avro SASL Profile<\/span><\/h2>\n<p>Below, we are discussing Negotiation in Apache Avro SASL Profile:<\/p>\n<h3><span style=\"font-weight: 400\">a. Commands<\/span><\/h3>\n<p><span style=\"font-weight: 400\">There are four <em>one-byte commands<\/em>, which Avro SASL negotiation uses:<\/span><\/p>\n<h4><span style=\"font-weight: 400\">i. 0: START <\/span><\/h4>\n<p><span style=\"font-weight: 400\">We use it in a client&#8217;s initial message.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">ii. 1: CONTINUE <\/span><\/h4>\n<p><span style=\"font-weight: 400\">At the time when negotiation is ongoing, we use it.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">iii. 2: FAIL <\/span><\/h4>\n<p><span style=\"font-weight: 400\">This command terminates negotiation unsuccessfully.<\/span><\/p>\n<h4><span style=\"font-weight: 400\">iv. 3: COMPLETE <\/span><\/h4>\n<p><span style=\"font-weight: 400\">Whereas, this command terminates negotiation successfully.<\/span><br \/>\n<span style=\"font-weight: 400\">Format: START message<\/span><\/p>\n<p><b>| 0 | 4-byte mechanism name length | mechanism name | 4-byte payload length | payload data |<\/b><\/p>\n<p><span style=\"font-weight: 400\">Format: CONTINUE message<\/span><\/p>\n<p><b>| 1 | 4-byte payload length | payload data |<\/b><\/p>\n<p><span style=\"font-weight: 400\">Format: FAIL message <\/span><br \/>\n<b><\/b><\/p>\n<p><b>| 2 | 4-byte message length | UTF-8 message |<\/b><\/p>\n<p><span style=\"font-weight: 400\">Format: \u00a0COMPLETE message<\/span><\/p>\n<p><b>| 3 | 4-byte payload length | payload data |<\/b><\/p>\n<h3><span style=\"font-weight: 400\">b. Process<\/span><\/h3>\n<p><span style=\"font-weight: 400\">At very first client sends a START command containing the client&#8217;s chosen mechanism name and any mechanism-specific payload data, in this way the Negotiation initiates.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Afterward, the server and the client exchange some number (possibly zero) of CONTINUE messages. Basically, to generate the next message, each message consists of a payload data which\u00a0get processed by the security mechanism. There are two cases possible:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">If the client or server sends a FAIL message, then as a result, negotiation fails. In the failure message, the UTF-8-encoded text is present. So, communication on this connection gets cease, if a FAIL message has been sent or received, or any other error occurs in the negotiation.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Or if the client or the server sends a COMPLETE message, then as a result negotiation completes successfully. So, as a result, until the connection\u00a0gets close by either side, Session data may now be transmitted over the connection.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400\">Session Data in Avro SASL Profile<\/span><\/h2>\n<p><span style=\"font-weight: 400\">All subsequent writes to\/reads over the connection are written\/read unmodified if no SASL QOP (quality of protection) is negotiated. Specifically, messages are of the following form and also uses Avro framing:<\/span><\/p>\n<p><b>| 4-byte frame length | frame data | &#8230; | 4 zero bytes |<\/b><\/p>\n<p><span style=\"font-weight: 400\">Further, for all subsequent messages, the connection must use a SASL QOP if it is negotiated. It is possible by only one way, that is by using the security mechanism, wrapping of each non-empty frame written and also by unwrapping of each non-empty frame read. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Basically, in each non-empty frame, the length written is the length of the wrapped data. Though, for unwrapping, complete frames must be passed to the security mechanism. Further, all the Unwrapped data is passed to the application as the content of the frame.<\/span><\/p>\n<p><span style=\"font-weight: 400\">However, all further communication on this connection must cease, if at any point processing fails due to wrapping, unwrapping or framing errors.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Anonymous Mechanism<\/span><\/h2>\n<p><span style=\"font-weight: 400\">However, it is very simple to implement SASL anonymous mechanism (RFC 2245). Though, by the following static sequence, an initial anonymous request may be prefixed, in particular:<\/span><\/p>\n<p><b>| 0 | 0009 | ANONYMOUS | 0000 |<\/b><\/p>\n<p><span style=\"font-weight: 400\">A server should check that the mechanism name in the start message, prefixing the first request received is &#8216;ANONYMOUS&#8217;, if a server uses the anonymous mechanism, then simply prefix its initial response with a COMPLETE message of:<\/span><\/p>\n<p><b>| 3 | 0000 |<\/b><\/p>\n<p><span style=\"font-weight: 400\">An anonymous server may respond with a FAIL message if an anonymous server receives some other mechanism name, as simple as:<\/span><\/p>\n<p><b>| 2 | 0000 |<\/b><\/p>\n<p><span style=\"font-weight: 400\">Make sure that the anonymous mechanism need add no additional round-trip messages between client and server. However, on the initial request or response, the START message and the COMPLETE or FAIL message can be piggybacked.<\/span><\/p>\n<p>So, this was all in Avro SASL Profile. Hope you like our explanation.<\/p>\n<h2><span style=\"font-weight: 400\">Conclusion: Avro SASL Profile<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Hence, we have learned all about Apache Avro SASL Profile for authentication and security purpose. Hope it helps!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, in this article, &#8220;Avro SASL Profile: For authentication and security&#8221; we are discussing Avro SASL profile for connection-based Avro RPC. Moreover, we will see negotiation and\u00a0Anonymous Mechanism in SASL Profile in Avro. Along&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":23193,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[717,1302,12374,12375,12759,15169,16286],"class_list":["post-22919","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-avro","tag-anonymous-mechanism","tag-avro-sasl-profile","tag-sasl-profile-in-apache-avro","tag-sasl-profile-in-avro","tag-session-data-in-avro-sasl-profile","tag-unwrapped-data","tag-wrapped-data"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Avro SASL Profile: For Authentication and Security - DataFlair<\/title>\n<meta name=\"description\" content=\"In this article, &quot;Avro SASL Profile: For authentication and security&quot; we are discussing SASL profile for connection-based Avro RPC.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Avro SASL Profile: For Authentication and Security - DataFlair\" \/>\n<meta property=\"og:description\" content=\"In this article, &quot;Avro SASL Profile: For authentication and security&quot; we are discussing SASL profile for connection-based Avro RPC.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-12T08:07:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Avro-SASL-Profile-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Avro SASL Profile: For Authentication and Security - DataFlair","description":"In this article, \"Avro SASL Profile: For authentication and security\" we are discussing SASL profile for connection-based Avro RPC.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/","og_locale":"en_US","og_type":"article","og_title":"Avro SASL Profile: For Authentication and Security - DataFlair","og_description":"In this article, \"Avro SASL Profile: For authentication and security\" we are discussing SASL profile for connection-based Avro RPC.","og_url":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-08-12T08:07:38+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Avro-SASL-Profile-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Avro SASL Profile: For Authentication and Security","datePublished":"2018-08-12T08:07:38+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/"},"wordCount":778,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Avro-SASL-Profile-01.jpg","keywords":["Anonymous Mechanism","Avro SASL Profile","SASL Profile in Apache Avro","Sasl Profile in AVRo","Session Data in Avro SASL Profile","Unwrapped data","wrapped data"],"articleSection":["AVRO Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/","url":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/","name":"Avro SASL Profile: For Authentication and Security - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Avro-SASL-Profile-01.jpg","datePublished":"2018-08-12T08:07:38+00:00","description":"In this article, \"Avro SASL Profile: For authentication and security\" we are discussing SASL profile for connection-based Avro RPC.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Avro-SASL-Profile-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Avro-SASL-Profile-01.jpg","width":1200,"height":628,"caption":"Avro SASL Profile: For Authentication and Security"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/avro-sasl-profile\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"AVRO Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/avro\/"},{"@type":"ListItem","position":3,"name":"Avro SASL Profile: For Authentication and Security"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/22919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=22919"}],"version-history":[{"count":0,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/22919\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/23193"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=22919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=22919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=22919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}