{"id":7951,"date":"2024-09-12T19:32:32","date_gmt":"2024-09-12T17:32:32","guid":{"rendered":"https:\/\/www.sigalou-domotique.fr\/?p=7951"},"modified":"2026-04-04T15:17:33","modified_gmt":"2026-04-04T13:17:33","slug":"je-verifie-les-fuites-de-mes-courriels","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels","title":{"rendered":"I check the leaks of my emails"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-6ae450c2bd044\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6ae450c2bd044\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels\/#Objectif\" >Objective<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels\/#Principe\" >Principle<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels\/#Je_cree_des_requetes_REST_dans_sensorsyaml\" >I create REST queries in sensors.yaml<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels\/#Je_renomme_le_sensor_cree\" >I rename the created sensor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels\/#Je_vais_creer_la_carte\" >I'll create the map<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.sigalou-domotique.fr\/en\/je-verifie-les-fuites-de-mes-courriels\/#Et_la_carte_terminee_apparait\" >And the finished card appears<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Objectif\"><\/span>Objective<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>Right now, it\u2019s cata, cyberattacks and data exfiltration are almost daily, I need to be reassured about leaks of my email addresses.<\/p>\r\n<p>So I created this HA card:<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7952\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/Fuitecourriels.gif\" alt=\"\" width=\"443\" height=\"350\" \/><!--more--><\/p>\r\n<h2><span class=\"ez-toc-section\" id=\"Principe\"><\/span>Principle<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>There are several sites that are able to test if my email address is compromised or not.<\/p>\r\n<p>The compromise of an email address occurs when the information associated with that address (such as password, contacts, or personal data) is exposed to unauthorised third parties, usually as a result of a data breach. This can happen when databases of online services are hacked, and user information is stolen and then leaked or sold on forums or darknet sites. A compromised email address can be used to send spam, phishing attacks, or access other accounts linked to that address, endangering the security and privacy of the user.<\/p>\r\n<p>The best-known site of all is:<\/p>\r\n<ul>\r\n<li><strong><a href=\"https:\/\/haveibeenpwned.com\/\" target=\"_blank\" rel=\"noopener\">Have I Been Pwned<\/a><\/strong><\/li>\r\n<\/ul>\r\n<p>But this site no longer provides APIs without a subscription, I looked for another solution and found the site:<\/p>\r\n<ul>\r\n<li><a href=\"https:\/\/leakcheck.io\/\" target=\"_blank\" rel=\"noopener\">https:\/\/leakcheck.io\/<\/a><\/li>\r\n<\/ul>\r\n<p>This site offers a paid APIV2 but has left its APIV1 online, it is lighter but it is enough for me to know if my email is compromised and if it is compromised, how many leaks there are. This API also does not need an authentication token, so it is much simpler.<\/p>\r\n<p>Here is the link to the API doc:<\/p>\r\n<ul>\r\n<li><a href=\"https:\/\/wiki.leakcheck.io\/en\/api\/public\" target=\"_blank\" rel=\"noopener\">https:\/\/wiki.leakcheck.io\/en\/api\/public<\/a><\/li>\r\n<\/ul>\r\n<h2><span class=\"ez-toc-section\" id=\"Je_cree_des_requetes_REST_dans_sensorsyaml\"><\/span>I create REST queries in sensors.yaml<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>I have very classically organised my configuration files into YAML files which are called by configuration.yaml.<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">sensor: !include rest.yaml<\/pre>\r\n<p>The call I am going to make is in the following format:<\/p>\r\n<p>https:\/\/leakcheck.io\/api\/public?check=monmail@mail.fr<\/p>\r\n<p>The result is in json format, for example:<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">{ \"successful\": true, \"found\": 7, \"fields\": [ \"last _name\", \"country\", \"first _name\", \"username\", \"dob\", \"password\", \"city\" ], \"sources\": [ { \"name\": \"Deezer.com\", \"date\": \"2019-09\" }, { \"name\": \"Badoo.com\", \"date\": \"2013-07\" } ] }<\/pre>\r\n<ul>\r\n<li><strong>found<\/strong> gives the number of compromises or rather the number of pirated databases that contain the email.\u00a0<\/li>\r\n<li><strong>fields<\/strong> is useless at this stage<\/li>\r\n<li><strong>sources<\/strong> gives the names and databases of the compromises, but in the free version we obviously do not have completeness.<\/li>\r\n<\/ul>\r\n<p>Here is the code I add for an example email:<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">- resource: \"https:\/\/leakcheck.io\/api\/public?check=demo46@mail.com\" scan_interval: 86400 sensor: - name: \"demo46@mail.com\" unique _id: _demo46 _mail _com value _template: \"{{value _json.success }}\" json _attributes: - found - sources<\/pre>\r\n<p>&nbsp;<\/p>\r\n<h2><span class=\"ez-toc-section\" id=\"Je_renomme_le_sensor_cree\"><\/span>I rename the created sensor<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>I have to restart HA or at least reload the Yaml config, and the sensor arrives.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7958\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46.png\" alt=\"\" width=\"916\" height=\"167\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46.png 916w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46-600x109.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46-300x55.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46-768x140.png 768w\" sizes=\"auto, (max-width: 916px) 100vw, 916px\" \/><\/p>\r\n<p>I am always surprised that the only _id is not taken into account, nothing serious, I correct it manually. I use sensor.fuite* because it is a self-entities card that I will then use.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7960\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46_2.png\" alt=\"\" width=\"373\" height=\"65\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46_2.png 373w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/demo46_2-300x52.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/p>\r\n<h2><span class=\"ez-toc-section\" id=\"Je_vais_creer_la_carte\"><\/span>I'll create the map<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The code is quite complex, I started from the code of the excellent <span class=\"first username\">herveaurel for its batteries.<\/span><\/p>\r\n<p>Here is what I added in the configuration editor to configure type: custom:button-card and template: leak _card<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">_card _templates button: leak_card: variables: entity: &#039;[[[ return entity.entity _id ]]]&#039; entity: &#039;[[[ return variables.entity ]]]&#039; icon: | [[ return entity.state === &quot;True&quot;? &quot;mdi:car-brake-alert&quot;: &quot;mdi:shield-lock-outline&quot; ]]] name: &#039;[[[ return entity.attributes.friendly_name ]]]&#039; label: | [[ return entity.state === &quot;True&quot;? Compromise&lt;br&gt;${entity.attributes.found} leaks&ldquo;: &quot;Protected&quot; ]]] show_icon: true show_state: false show_label: true template: - no_style - font tap_action: action: more-info double_tap_action: action: toggle custom _fields: bar: card: type: custom:bar-card entities: - entity: &#039;[[[ return variables.entity ]]]&#039; color: | [[ var state = entity.state; if (state === &quot;True&quot;) { return &quot;var(--card-red)&quot;; } else { return &quot;var(--card-green)&quot;; } ]]] Directorate: right positions: name: &#039;off&#039; indicator: &#039;off&#039; value: &#039;off&#039; height: 50px width: 100% icon: &#039;off&#039; entity _row: true styles: card: - height: 40px - padding: 2px - animation: blink 0.8s ease infinite icon: - position: absolute - width: 25px - color: var(--orange) - left: calc(7%) - 5px) - margin-bottom: 2px name: - position: absolute - font-size: 13px - color: var(--orange) - font-weight: 500 - left: calc((20%) - 15px) label: - position: absolute - font-size: 13px - color: | [[ var state = entity.state; if (state === &quot;True&quot;) return &quot;var(--red)&quot; else return &quot;var(--green)&quot; ]]] - font-weight: 600 - width: 100% - text-align: center - left: calc((10%) + 70px) custom_fields: bar: - top: &#039;-19%&#039; - left: &#039;-50%&#039; - width: 100% - position: absolute - z-index: 0 state: -value: &#039;False&#039; styles: icon: - color: var(--green) name: - color: var(--green) card: - animation: none - value: unknown styles: name: - color: var(--grey) label: - color: var(--grey) card: - animation: blink 0.8s ease infinite - value: unavailable styles: name: - color: var(--grey) label: - color: var(--grey) card: - animation: blink 0.8s ease infinite<\/pre>\r\n<p>And here is the code of the card:<\/p>\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\">type: entities card_mod: style: | ha-card { background-color: var(--card-background-color); border-radius: var(--ha-card-border-radius)!important; } entities: - type: custom:decluttering-card template: header variables: - name: E-mail leaks - icon: mdi:home-battery - type: custom:auto-entities card: type: entities show _header _toggle: true filter: include: - entity_id: sensor.leak* options: type: custom:button-card template: leak_card comes out: method: state numeric: true ignores _case: false ip: false show_empty: true\r\n<\/pre>\r\n<h2><span class=\"ez-toc-section\" id=\"Et_la_carte_terminee_apparait\"><\/span>And the finished card appears<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7952\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2024\/09\/Fuitecourriels.gif\" alt=\"\" width=\"443\" height=\"350\" \/><\/p>\r\n<p>&nbsp;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>At the moment, it is cata, cyberattacks and data exfiltration are almost daily, I need to be reassured about the leaks of my email addresses. So I created this HA card:<\/p>","protected":false},"author":1,"featured_media":7952,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,166],"tags":[],"class_list":["post-7951","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-retex"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/7951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/comments?post=7951"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/7951\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media\/7952"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=7951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=7951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=7951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}