{"id":601850,"date":"2021-04-12T10:30:50","date_gmt":"2021-04-12T08:30:50","guid":{"rendered":"https:\/\/www.devoteam.com\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/"},"modified":"2021-04-12T10:30:50","modified_gmt":"2021-04-12T08:30:50","slug":"field-level-security-and-data-masking-in-elasticsearch","status":"publish","type":"expert-view","link":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/","title":{"rendered":"Field level security and data masking in Elasticsearch"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><b>In a production environment, it can be difficult to limit user access to sensitive data while still allowing them to do relevant searches and aggregations. Developers shouldn&#8217;t have access to personally identifiable data: names, emails, or IP-addresses, but giving them access to anonymized data can be of great help in troubleshooting.<\/b><span style=\"font-weight: 400\">&nbsp;<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Data analysts would like access to bulk data but most likely shouldn&#8217;t access sensitive information either. Technical support contacts need to access relevant data, but again, it should be as limited as possible. How to keep your data safe while still giving access to users?<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-processing-your-data\"><span style=\"font-weight: 400\">Processing your data<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">If you are using <a href=\"https:\/\/nl.devoteam.com\/elastic-services\/\">Elastic<\/a>, you should process your data with a tool such as Logstash, an ingest pipeline or similar and split your data into easily identifiable fields. Filtering by field is one of the most useful functions in Elastic in my opinion. Use it, it is such a powerful tool. Now that we can easily identify what data we have, check with your privacy officer on who should be allowed to access which data and let&#8217;s configure some user roles.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-configuring-user-roles-and-field-level-security\"><span style=\"font-weight: 400\">Configuring user roles and Field level security<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">In your <\/span><a href=\"https:\/\/www.elastic.co\/guide\/en\/kibana\/current\/xpack-security.html\"><span style=\"font-weight: 400\">Kibana security settings<\/span><\/a><span style=\"font-weight: 400\"> you can create roles for different user groups. The good thing about these settings is that it gives you very fine grained control. You can give access to entire indexes except a specific field, give access to only specific fields, use wildcards, and mix and match all these together. So even if your index contains sensitive data, you can still give a developer access to it by limiting the fields they can see.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/Afbeelding_blog_TimKrijger.png\" alt=\"\" class=\"wp-image-81988\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><i>An example of giving access to all fields except specific ones and only granting access to a few fields.<\/i><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">Great, but this only gets us 99% of the way there, users can no longer see the sensitive data, but now they can no longer use this data as a filter either.&nbsp;<\/span><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">What if you want to count the number of unique emails, or need all data of a specific user, you can&#8217;t see either of these fields any more? The answer is data masking.<\/span><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-data-masking-using-the-logstash-fingerprint-filter\"><span style=\"font-weight: 400\">Data masking using the logstash Fingerprint filter<\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">The Logstash <\/span><a href=\"https:\/\/www.elastic.co\/guide\/en\/logstash\/current\/plugins-filters-fingerprint.html\"><span style=\"font-weight: 400\">fingerprint filter<\/span><\/a><span style=\"font-weight: 400\"> provides a way to do a one-way transform of a field. The great thing about this transformation is that the same input always results in the same output but cannot easily be reversed. In this way you can take a sensitive field like email as an input to create a new field called email_hashed.<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/Afbeelding_blog_TimKrijger2.png\" alt=\"\" class=\"wp-image-81989\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><i>An example of using the fingerprint filter to hash an email address and username. I prefer the Murmur method as it&#8217;s fast and lightweight, but make sure it suits your purposes.<\/i><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span style=\"font-weight: 400\">So now you can count the number of unique emails without actually having to know them, and see all data of a single user based on a hashed username value. Make sure to always check with your privacy officer even though a field is no longer human-readable. It is still a unique identifier that might require special consideration.<\/span><\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>In a production environment, it can be difficult to limit user access to sensitive data while still allowing them to do relevant searches and aggregations. Developers shouldn&#8217;t have access to personally identifiable data: names, emails, or IP-addresses, but giving them access to anonymized data can be of great help in troubleshooting.&nbsp; Data analysts would like [&hellip;]<\/p>\n","protected":false},"featured_media":353737,"template":"","categories":[],"tags":[3262,2717],"industry":[],"class_list":["post-601850","expert-view","type-expert-view","status-publish","has-post-thumbnail","hentry","tag-elastic-en-nl","tag-netherlands-en-nl"],"acf":[],"cards":"\n\t<div class=\"single-post-card\">\n\n\t\t<figure class=\"wp-block-post-featured-image\"><a href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/\" target=\"_self\" ><img width=\"3976\" height=\"1020\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash.png\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"Field level security and data masking in Elasticsearch\" style=\"aspect-ratio:4\/3;width:100%;object-fit:cover;\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash.png 3976w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-300x77.png 300w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-1024x263.png 1024w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-768x197.png 768w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-1536x394.png 1536w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-2048x525.png 2048w\" sizes=\"auto, (max-width: 3976px) 100vw, 3976px\" \/><\/a><\/figure>\n\n\t\t\n\t\t<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-43282307 wp-block-group-is-layout-flex\">\n\t<p style=\"font-style:normal;font-weight:700\" class=\"has-link-color wp-elements-1 wp-block-lp-post-type has-text-color has-primary-color has-small-font-size\">Expert View<\/p>\n\n\t\t\n\t\t<h3 style=\"font-style:normal;font-weight:400\" class=\"wp-block-post-title has-base-font-size\"><a href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/\" target=\"_self\" >Field level security and data masking in Elasticsearch<\/a><\/h3><\/div>\n\t\t\n\t<\/div>\n\n","yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Field level security and data masking in Elasticsearch | Devoteam<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Field level security and data masking in Elasticsearch\" \/>\n<meta property=\"og:description\" content=\"In a production environment, it can be difficult to limit user access to sensitive data while still allowing them to do relevant searches and aggregations. Developers shouldn&#8217;t have access to personally identifiable data: names, emails, or IP-addresses, but giving them access to anonymized data can be of great help in troubleshooting.&nbsp; Data analysts would like [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/\" \/>\n<meta property=\"og:site_name\" content=\"Devoteam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/\",\"name\":\"Field level security and data masking in Elasticsearch | Devoteam\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/dennis-kummer-52gEprMkp7M-unsplash.png\",\"datePublished\":\"2021-04-12T08:30:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/#breadcrumb\"},\"inLanguage\":\"en-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NL\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/dennis-kummer-52gEprMkp7M-unsplash.png\",\"contentUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/dennis-kummer-52gEprMkp7M-unsplash.png\",\"width\":3976,\"height\":1020},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/field-level-security-and-data-masking-in-elasticsearch\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Expert View\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Field level security and data masking in Elasticsearch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/#website\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/\",\"name\":\"Devoteam\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-NL\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Field level security and data masking in Elasticsearch | Devoteam","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:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/","og_locale":"en_US","og_type":"article","og_title":"Field level security and data masking in Elasticsearch","og_description":"In a production environment, it can be difficult to limit user access to sensitive data while still allowing them to do relevant searches and aggregations. Developers shouldn&#8217;t have access to personally identifiable data: names, emails, or IP-addresses, but giving them access to anonymized data can be of great help in troubleshooting.&nbsp; Data analysts would like [&hellip;]","og_url":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/","og_site_name":"Devoteam","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/","url":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/","name":"Field level security and data masking in Elasticsearch | Devoteam","isPartOf":{"@id":"https:\/\/devoteam.info\/en-nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/#primaryimage"},"image":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/#primaryimage"},"thumbnailUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash.png","datePublished":"2021-04-12T08:30:50+00:00","breadcrumb":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/#breadcrumb"},"inLanguage":"en-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/"]}]},{"@type":"ImageObject","inLanguage":"en-NL","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/#primaryimage","url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash.png","contentUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash.png","width":3976,"height":1020},{"@type":"BreadcrumbList","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/field-level-security-and-data-masking-in-elasticsearch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devoteam.info\/en-nl\/"},{"@type":"ListItem","position":2,"name":"Expert View","item":"https:\/\/devoteam.info\/en-nl\/expert-view\/"},{"@type":"ListItem","position":3,"name":"Field level security and data masking in Elasticsearch"}]},{"@type":"WebSite","@id":"https:\/\/devoteam.info\/en-nl\/#website","url":"https:\/\/devoteam.info\/en-nl\/","name":"Devoteam","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devoteam.info\/en-nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-NL"}]}},"uagb_featured_image_src":{"full":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash.png",3976,1020,false],"thumbnail":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-150x150.png",150,150,true],"medium":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-300x77.png",300,77,true],"medium_large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-768x197.png",768,197,true],"large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-1024x263.png",1024,263,true],"1536x1536":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-1536x394.png",1536,394,true],"2048x2048":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/dennis-kummer-52gEprMkp7M-unsplash-2048x525.png",2048,525,true]},"uagb_author_info":{"display_name":"lea.mitteaux","author_link":"https:\/\/devoteam.info\/en-nl\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"In a production environment, it can be difficult to limit user access to sensitive data while still allowing them to do relevant searches and aggregations. Developers shouldn&#8217;t have access to personally identifiable data: names, emails, or IP-addresses, but giving them access to anonymized data can be of great help in troubleshooting.&nbsp; Data analysts would like&hellip;","_links":{"self":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view\/601850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view"}],"about":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/types\/expert-view"}],"version-history":[{"count":0,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view\/601850\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/media\/353737"}],"wp:attachment":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/media?parent=601850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/categories?post=601850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/tags?post=601850"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/industry?post=601850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}