{"id":5459,"date":"2023-12-03T10:00:00","date_gmt":"2023-12-03T10:00:00","guid":{"rendered":"https:\/\/netguide.io\/linux\/home-synology-nas-automatically-import-ip-blocklistssynology-nas-automatically-import-ip-blocklists\/"},"modified":"2023-12-03T10:00:00","modified_gmt":"2023-12-03T10:00:00","slug":"home-synology-nas-automatically-import-ip-blocklistssynology-nas-automatically-import-ip-blocklists","status":"publish","type":"post","link":"https:\/\/netguide.io\/linux\/en\/home-synology-nas-automatically-import-ip-blocklistssynology-nas-automatically-import-ip-blocklists\/","title":{"rendered":"Synology NAS: Automatically import IP blocklists"},"content":{"rendered":"<script type=\"text\/plain\" data-tcf=\"waiting-for-consent\" data-id=\"4797\" data-bid=\"2\" data-placement=\"4798\">PGRpdiBpZD0ibmV0Z3VpZGVhLTEyMzE5OTk4NTEiIGNsYXNzPSJuZXRndWlkZWEtYmVmb3JlLWNvbnRlbnQgbmV0Z3VpZGVhLWVudGl0eS1wbGFjZW1lbnQiPjxkaXYgY2xhc3M9Im5ldGd1aWRlYS1hZGxhYmVsIj5BZHZlcnRpc2VtZW50czwvZGl2PjxzY3JpcHQgYXN5bmMgc3JjPSIvL3BhZ2VhZDIuZ29vZ2xlc3luZGljYXRpb24uY29tL3BhZ2VhZC9qcy9hZHNieWdvb2dsZS5qcz9jbGllbnQ9Y2EtcHViLTYyNTg1NTYyNTcyNDU5OTgiIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiPjwvc2NyaXB0PjxpbnMgY2xhc3M9ImFkc2J5Z29vZ2xlIiBzdHlsZT0iZGlzcGxheTpibG9jazsiIGRhdGEtYWQtY2xpZW50PSJjYS1wdWItNjI1ODU1NjI1NzI0NTk5OCIgCmRhdGEtYWQtc2xvdD0iMzQ5NDExNTM0MiIgCmRhdGEtYWQtZm9ybWF0PSJhdXRvIj48L2lucz4KPHNjcmlwdD4gCihhZHNieWdvb2dsZSA9IHdpbmRvdy5hZHNieWdvb2dsZSB8fCBbXSkucHVzaCh7fSk7IAo8L3NjcmlwdD4KPC9kaXY+<\/script>\n<p class=\"wp-block-paragraph\">All Synology NAS have an internal firewall that is responsible for blocking IP addresses that have too many failed login attempts, for example. The NAS does this consistently. But of course it is even more practical if the attacker does not even get to the login screen because the IP address is already blocked.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Many firewalls have exactly this function by default. With the Synology NAS we have to make do with a script.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Synology: Automatically import IP blocklist via script<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With the help of the script, the blocklists can be retrieved from Blockliste.de and automatically imported into the blocklist of the Synology DSM. To do this, the script must be downloaded and copied to a folder on the NAS. The script comes from the <a href=\"https:\/\/www.synology-forum.de\/threads\/staendige-anmeldeversuche-am-dsm.122250\/page-2#post-1015901\">Synology-forum.de<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex wp-container-core-buttons-is-layout-3e41869c\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/github.com\/geimist\/Update_Blocklist\/\">Script Download<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">I have created a &#8220;Scripts&#8221; folder in the home share of my admin account for this purpose.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Security tip<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The administrator account should only be used for administrative purposes. For everyday access to the Synology apps or network shares, another account with limited rights should be used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the script has been copied to an appropriate folder, we can create the task that will execute the script automatically on a regular basis.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this, we navigate in DSM to: Control Panel -&gt; Task Scheduler -&gt; Create -&gt; Scheduled Task -&gt; Custom Script.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1004\" height=\"435\" src=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-nlocklist-user-defined-script.png\" alt=\"\" class=\"wp-image-5455\" srcset=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-nlocklist-user-defined-script.png 1004w, https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-nlocklist-user-defined-script-300x130.png 300w, https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-nlocklist-user-defined-script-768x333.png 768w\" sizes=\"auto, (max-width: 1004px) 100vw, 1004px\" \/><figcaption class=\"wp-element-caption\">Control Panel -&gt; Task Scheduler -&gt; Create -&gt; Scheduled Task -&gt; Custom Script<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The script should be executed every 10 minutes. This is necessary to always block the latest IP addresses.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" width=\"532\" height=\"583\" decoding=\"async\" src=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-blocklist-import-scedule.png\" alt=\"\" class=\"wp-image-5456\" srcset=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-blocklist-import-scedule.png 532w, https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-blocklist-import-scedule-274x300.png 274w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The following script must now be entered in the corresponding field:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"chmod +x &quot;\/volume1\/homes\/admin\/Scripts\/update_blocklist.sh&quot;\n&quot;\/volume1\/homes\/admin\/Scripts\/update_blocklist.sh&quot;\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E1E4E8\">chmod +x &quot;\/volume1\/homes\/admin\/Scripts\/update_blocklist.sh&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">&quot;\/volume1\/homes\/admin\/Scripts\/update_blocklist.sh&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The first line makes the script executable and the second calls it. The path must of course be adapted accordingly.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" width=\"531\" height=\"577\" decoding=\"async\" src=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-auttomatic-ip-blocklist-task-settings.png\" alt=\"\" class=\"wp-image-5457\" srcset=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-auttomatic-ip-blocklist-task-settings.png 531w, https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-auttomatic-ip-blocklist-task-settings-276x300.png 276w\" sizes=\"auto, (max-width: 531px) 100vw, 531px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The first execution of the script may take a little longer; after that it should be much faster.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" width=\"701\" height=\"439\" decoding=\"async\" src=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-blocklist.png\" alt=\"\" class=\"wp-image-5458\" srcset=\"https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-blocklist.png 701w, https:\/\/netguide.io\/linux\/wp-content\/uploads\/sites\/2\/2026\/08\/synology-ip-blocklist-300x188.png 300w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The number of IP addresses that are now blocked shows that the script has worked. Now you have an additional security layer protecting the NAS from unauthorized access. However, this should only be one of several layers, consisting of a next-gen firewall and, of course, the configured software firewall of the Synology NAS.<\/p>\n<script type=\"text\/plain\" data-tcf=\"waiting-for-consent\" data-id=\"4799\" data-bid=\"2\" data-placement=\"4800\">PGRpdiBpZD0ibmV0Z3VpZGVhLTM5OTkzNjE0ODkiIGNsYXNzPSJuZXRndWlkZWEtYWZ0ZXItY29udGVudCBuZXRndWlkZWEtZW50aXR5LXBsYWNlbWVudCI+PGRpdiBjbGFzcz0ibmV0Z3VpZGVhLWFkbGFiZWwiPkFkdmVydGlzZW1lbnRzPC9kaXY+PHNjcmlwdCBhc3luYyBzcmM9Ii8vcGFnZWFkMi5nb29nbGVzeW5kaWNhdGlvbi5jb20vcGFnZWFkL2pzL2Fkc2J5Z29vZ2xlLmpzP2NsaWVudD1jYS1wdWItNjI1ODU1NjI1NzI0NTk5OCIgY3Jvc3NvcmlnaW49ImFub255bW91cyI+PC9zY3JpcHQ+PGlucyBjbGFzcz0iYWRzYnlnb29nbGUiIHN0eWxlPSJkaXNwbGF5OmJsb2NrOyIgZGF0YS1hZC1jbGllbnQ9ImNhLXB1Yi02MjU4NTU2MjU3MjQ1OTk4IiAKZGF0YS1hZC1zbG90PSI0NTU5Nzg1MDAyIiAKZGF0YS1hZC1mb3JtYXQ9ImF1dG8iPjwvaW5zPgo8c2NyaXB0PiAKKGFkc2J5Z29vZ2xlID0gd2luZG93LmFkc2J5Z29vZ2xlIHx8IFtdKS5wdXNoKHt9KTsgCjwvc2NyaXB0Pgo8L2Rpdj4=<\/script>","protected":false},"excerpt":{"rendered":"<p>Every Synology NAS has a firewall, but attackers still reach the login screen. Learn how a scheduled script auto-imports IP blocklists into Synology DSM.<\/p>\n","protected":false},"author":1,"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":"","ast-disable-related-posts":"","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-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":"","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-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":"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":""},"mobile":{"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":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-5459","post","type-post","status-publish","format-standard","hentry","category-uncategorized-en"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Tobias Pries","author_link":"https:\/\/netguide.io\/linux\/author\/tobias-pries\/"},"uagb_comment_info":0,"uagb_excerpt":"Every Synology NAS has a firewall, but attackers still reach the login screen. Learn how a scheduled script auto-imports IP blocklists into Synology DSM.","brizy_media":[],"_links":{"self":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/5459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/comments?post=5459"}],"version-history":[{"count":0,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/5459\/revisions"}],"wp:attachment":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/media?parent=5459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/categories?post=5459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/tags?post=5459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}