<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Murat Necip Arcan on Medium]]></title>
        <description><![CDATA[Stories by Murat Necip Arcan on Medium]]></description>
        <link>https://medium.com/@muratneciparcan?source=rss-119106f46e4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Rmx90eBLEb6gPIgTszZ54w@2x.jpeg</url>
            <title>Stories by Murat Necip Arcan on Medium</title>
            <link>https://medium.com/@muratneciparcan?source=rss-119106f46e4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:36:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muratneciparcan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bookinclub: The New Platform Bringing Book Clubs, Live Streams, and Reading Communities into the…]]></title>
            <link>https://muratneciparcan.medium.com/bookinclub-the-new-platform-bringing-book-clubs-live-streams-and-reading-communities-into-the-146cbdd572ab?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/146cbdd572ab</guid>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[books-and-authors]]></category>
            <category><![CDATA[book-club]]></category>
            <category><![CDATA[bookworm]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Wed, 27 May 2026 08:53:06 GMT</pubDate>
            <atom:updated>2026-05-27T08:53:06.255Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Bookinclub: The New Platform Bringing Book Clubs, Live Streams, and Reading Communities into the Digital World</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*sk3I_lhO-n0sccYK6e_zFg.png" /></figure><p>Reading habits around the world are changing. People no longer want to simply read books; they also want to talk about the books they read, share quotes, write reviews, follow authors and other readers, and come together with people who share similar interests.</p><p>In Turkey, the United Kingdom, the United States, and many other countries around the world, interest in book clubs is increasing every day. Digital communities, online events, live streams, and newsletter-based content creation are making book culture more social, more accessible, and more sustainable.</p><p>Today, books no longer offer only an individual reading experience. A book can become the starting point of a discussion, an event, a community, a live stream, a review, or a new idea. People want to share their thoughts through the books they read, discover different perspectives, and become part of deeper conversations.</p><p>This is exactly why Bookinclub was created: a global platform built for this new reading culture.</p><h3>What Is Bookinclub?</h3><p>Bookinclub is a modern book club and reading community platform that brings together book lovers, book club owners, content creators, authors, and reading communities in one digital space.</p><p>With Bookinclub, users can join book clubs, take part in live streams, share reviews and comments about books, create quotes, follow authors, and continue their reading journey in a digital environment.</p><p>The platform is not only designed to list books or provide book recommendations. Bookinclub aims to build living communities around books. It offers a new digital reading experience where people who read the same book can come together, talk, discuss, write, and learn together.</p><h3>What Can You Do on Bookinclub?</h3><p>On Bookinclub, users can join different book clubs and participate in live streams, events, and book discussions organized by those clubs. Book club owners can create their own communities, open paid or free clubs, and reach wider audiences.</p><p>Bookinclub does not simply give club owners a page or a profile; it also provides powerful tools to help them grow their communities. Club owners can create live streams, organize events, communicate with their members, and deliver book-focused content to their followers.</p><p>Users can also create individual live streams, paid live streams, or paid events without opening a club. This allows authors, educators, reading coaches, content creators, or anyone who wants to talk about books to connect directly with their own audience.</p><p>However, users who open book clubs have the opportunity to reach larger audiences by building a more structured community. Clubs make it easier to maintain continuous communication with followers, organize events regularly, and turn reading culture into a community experience.</p><h3>Live Streams and Online Book Events</h3><p>One of Bookinclub’s most important features is the ability for book clubs and individual users to create live streams.</p><p>Today, many people cannot always attend physical events. Online events offer a major advantage for readers living in different cities, countries, or time zones. Bookinclub meets this need by allowing book clubs to gather easily in a digital environment.</p><p>Users can join live discussions about a book, follow author talks, participate in reading groups, or create their own events. Through paid events, content creators and club owners can also generate income.</p><p>This structure transforms book clubs from hobby-based communities into part of a sustainable digital content and community economy.</p><h3>Paid and Free Book Clubs</h3><p>On Bookinclub, users can create both free and paid book clubs.</p><p>Free clubs are ideal for reaching wider audiences, building reading habits, and creating communities around specific books. Paid clubs provide a strong model for people who want to offer more exclusive content, private events, special live streams, reading programs, or premium community experiences.</p><p>This allows authors, academics, educators, book reviewers, influencers, and anyone who wants to build a reading community to create their own digital book club through Bookinclub.</p><p>Bookinclub does not only offer club owners the ability to build a community; it also provides the infrastructure to turn that community into a revenue model.</p><h3>Newsletters and Email Notifications</h3><p>On Bookinclub, the content, events, and announcements shared by book club owners can also be delivered to users by email.</p><p>This structure combines a Substack-like newsletter experience with book clubs. Club owners can communicate more directly with their followers, announce new events, share book recommendations, and keep their communities active beyond the platform itself.</p><p>Email notifications allow book clubs to remain visible not only within the platform, but also within users’ daily digital habits. This helps club owners build stronger and more continuous relationships with their followers.</p><h3>Book Reviews, Quotes, and Comments</h3><p>Bookinclub is not only about clubs and live streams. The platform is also a social reading space where individual users can create content about books.</p><p>Users can comment on the books they read, share book ratings, create quotes, and write detailed reviews. In this way, different thoughts, interpretations, and reading experiences come together around each book.</p><p>On Bookinclub, you do not just read a book; you can think about it, write about it, discuss it, and discover the perspectives of other readers.</p><h3>Advanced Book Review Editor</h3><p>Bookinclub also offers an advanced writing editor for book reviews.</p><p>Users can write detailed book reviews in a blog-style format. With a word processor editor that includes an advanced toolbar, users can prepare their writing in a more organized, professional, and readable way.</p><p>This feature is especially valuable for users who want to write long book analyses, essays, critiques, character studies, chapter reviews, or academic-style book articles.</p><p>Bookinclub creates a reading and writing space that supports different forms of writing, from short comments to long analyses.</p><h3>A Global and Multilingual Platform</h3><p>Bookinclub is not focused on only one country or one language. The platform is designed to be open to users around the world and has a structure that can support many languages.</p><p>Users from different countries can discover books in different languages, review foreign books, follow authors, and become part of international reading communities.</p><p>Books naturally build bridges between cultures. Bookinclub makes this bridge more visible, accessible, and interactive in the digital world.</p><h3>Following Authors and Books</h3><p>On Bookinclub, users can follow not only book clubs, but also books and authors.</p><p>This allows users to more easily discover the content, comments, reviews, and communities formed around the authors they love. All the social interactions around a book enrich the reading experience.</p><p>Bookinclub takes book discovery beyond the traditional search experience. Users do not only find an answer to the question “What should I read?” They can also discover answers to questions such as “Who is talking about this book?”, “What do people think about it?”, and “Which club is discussing it?”</p><h3>Why Bookinclub?</h3><p>Bookinclub transforms the reading experience from an individual habit into a social and interactive community experience.</p><p>The platform brings together online book clubs, digital book club tools, paid book clubs, live book events, book reviews, book quotes, reading communities, and newsletter-based community communication under one structure.</p><p>Today, there are many social platforms in the digital world. However, the number of platforms specifically designed for users who want to build deeper, more meaningful, and more organized communities around books is still limited. Bookinclub was developed to fill this gap.</p><p>With <a href="https://bookinclub.com/"><strong>Bookinclub</strong></a>, users can:</p><p>Join book clubs.<br> Create their own book clubs.<br> Create paid or free events.<br> Participate in live streams.<br> Share comments, quotes, and reviews about books.<br> Write detailed book analyses.<br> Follow authors and books.<br> Grow their communities with newsletter-like email notifications.<br> Become part of a global reading community.</p><h3>The Future of Book Clubs Is Digital</h3><p>For many years, book clubs have been places where people come together to share ideas, discuss, and learn together. But this experience is no longer limited to physical meetings.</p><p>Thanks to digital platforms, a book club can bring together people from Istanbul, London, New York, Berlin, or anywhere else in the world at the same time. This makes book clubs more inclusive, more accessible, and more global.</p><p>Bookinclub aims to become the book club platform of this new era.</p><p>It offers readers a more social reading experience, club owners stronger community tools, content creators new revenue models, and book culture a more vibrant digital ecosystem.</p><h3>Conclusion</h3><p><a href="https://bookinclub.com/"><strong>Bookinclub</strong></a> does not see reading as only an individual activity. It places books at the center of communities, conversations, live streams, writing, ideas, and events.</p><p>As interest in book clubs, online reading communities, and digital events continues to grow around the world, Bookinclub offers a modern, global, and versatile solution to this need.</p><p>For anyone who wants to open a book club, write about books, host live streams, create paid events, follow authors, or simply become part of a more meaningful reading community, Bookinclub creates a new digital space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*sk3I_lhO-n0sccYK6e_zFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/37/1*R85rSgX5Si8HdB4XfowZdA.png" /></figure><p>Bookinclub makes books social again.</p><p><a href="https://bookinclub.com/">https://bookinclub.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=146cbdd572ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bookinclub: Kitap Kulüplerini, Canlı Yayınları ve Okuma Topluluklarını Dijital Dünyaya Taşıyan Yeni…]]></title>
            <link>https://muratneciparcan.medium.com/bookinclub-kitap-kul%C3%BCplerini-canl%C4%B1-yay%C4%B1nlar%C4%B1-ve-okuma-topluluklar%C4%B1n%C4%B1-dijital-d%C3%BCnyaya-ta%C5%9F%C4%B1yan-yeni-a6834fddee06?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6834fddee06</guid>
            <category><![CDATA[book-recommendations]]></category>
            <category><![CDATA[book-club]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[bookworm]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Wed, 27 May 2026 08:49:03 GMT</pubDate>
            <atom:updated>2026-05-27T08:54:10.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>Bookinclub: Kitap Kulüplerini, Canlı Yayınları ve Okuma Topluluklarını Dijital Dünyaya Taşıyan Yeni Platform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*sk3I_lhO-n0sccYK6e_zFg.png" /></figure><p>Dünyada kitap okuma alışkanlıkları değişiyor. İnsanlar artık yalnızca kitap okumakla yetinmiyor; okudukları kitaplar hakkında konuşmak, alıntılar paylaşmak, incelemeler yazmak, yazarları ve diğer okurları takip etmek, benzer ilgi alanlarına sahip insanlarla bir araya gelmek istiyor.</p><p>Türkiye’de, İngiltere’de, Amerika’da ve dünyanın birçok ülkesinde kitap kulüplerine olan ilgi her geçen gün artıyor. Özellikle dijital topluluklar, online etkinlikler, canlı yayınlar ve newsletter tabanlı içerik üretimi, kitap kültürünü daha sosyal, daha erişilebilir ve daha sürdürülebilir bir hale getiriyor.</p><p>Bugün kitaplar artık sadece bireysel bir okuma deneyimi sunmuyor. Bir kitap; bir tartışmanın, bir etkinliğin, bir topluluğun, bir canlı yayının, bir incelemenin veya yeni bir fikrin başlangıç noktası olabiliyor. İnsanlar okudukları kitaplar üzerinden düşüncelerini paylaşmak, farklı bakış açıları görmek ve daha derin sohbetlerin parçası olmak istiyor.</p><h3>Bookinclub Nedir?</h3><p><strong>Bookinclub</strong>, kitap severleri, kitap kulübü sahiplerini, içerik üreticilerini, yazarları ve okuma topluluklarını tek bir dijital platformda buluşturan modern bir kitap kulübü ve okuma topluluğu platformudur.</p><p>Bookinclub ile kullanıcılar kitap kulüplerine katılabilir, canlı yayınlara dahil olabilir, kitaplar hakkında inceleme ve yorumlar paylaşabilir, alıntılar oluşturabilir, yazarları takip edebilir ve kendi okuma yolculuklarını dijital bir alanda sürdürebilir.</p><p>Platformun amacı yalnızca kitap listelemek veya kitap tavsiyesi vermek değildir. Bookinclub, kitapların etrafında yaşayan topluluklar oluşturmayı hedefler. Bir kitabı okuyan insanların bir araya gelip konuşabildiği, tartışabildiği, yazabildiği ve birlikte öğrenebildiği yeni bir dijital okuma deneyimi sunar.</p><h3>Bookinclub’da Neler Yapılabilir?</h3><p>Bookinclub’da kullanıcılar farklı kitap kulüplerine üye olabilir ve bu kulüplerin düzenlediği canlı yayınlara, etkinliklere ve kitap tartışmalarına katılabilir. Kitap kulübü sahipleri ise kendi topluluklarını oluşturabilir, ücretli veya ücretsiz kulüpler açabilir ve daha geniş kitlelere ulaşabilir.</p><p>Bookinclub, kulüp sahiplerine sadece bir sayfa veya profil sunmaz; aynı zamanda kendi topluluklarını büyütebilecekleri güçlü araçlar sağlar. Kulüp sahipleri canlı yayınlar oluşturabilir, etkinlikler düzenleyebilir, üyeleriyle iletişim kurabilir ve kitap odaklı içeriklerini takipçilerine ulaştırabilir.</p><p>Ayrıca kullanıcılar kulüp açmadan da bireysel olarak canlı yayınlar, ücretli canlı yayınlar veya ücretli etkinlikler oluşturabilir. Böylece yazarlar, eğitmenler, okuma koçları, içerik üreticileri veya kitaplar üzerine konuşmak isteyen herkes kendi kitlesiyle doğrudan buluşabilir.</p><p>Ancak kitap kulübü açan kullanıcılar, daha düzenli bir topluluk yapısı kurarak daha büyük kitlelere ulaşma fırsatı elde eder. Çünkü kulüpler, takipçilerle sürekli iletişim kurmayı, etkinlikleri düzenli hale getirmeyi ve okuma kültürünü bir topluluk deneyimine dönüştürmeyi kolaylaştırır.</p><h3>Canlı Yayınlar ve Online Kitap Etkinlikleri</h3><p>Bookinclub’ın en önemli özelliklerinden biri, kitap kulüplerinin ve bireysel kullanıcıların canlı yayınlar oluşturabilmesidir.</p><p>Bugün birçok insan fiziksel etkinliklere her zaman katılamıyor. Farklı şehirlerde, farklı ülkelerde veya farklı zaman dilimlerinde yaşayan okurlar için online etkinlikler büyük bir avantaj sağlıyor. Bookinclub, bu ihtiyaca cevap vererek kitap kulüplerinin dijital ortamda kolayca buluşmasını sağlar.</p><p>Kullanıcılar bir kitap üzerine canlı tartışmalara katılabilir, yazar söyleşilerini takip edebilir, okuma gruplarına dahil olabilir veya kendi etkinliklerini oluşturabilir. Ücretli etkinlikler sayesinde içerik üreticileri ve kulüp sahipleri aynı zamanda gelir elde edebilir.</p><p>Bu yapı, kitap kulüplerini yalnızca hobi amaçlı bir topluluk olmaktan çıkarır; aynı zamanda sürdürülebilir bir dijital içerik ve topluluk ekonomisinin parçası haline getirir.</p><h3>Ücretli ve Ücretsiz Kitap Kulüpleri</h3><p>Bookinclub’da kullanıcılar hem ücretsiz hem de ücretli kitap kulüpleri açabilir.</p><p>Ücretsiz kulüpler, daha geniş kitlelere ulaşmak, okuma alışkanlığı oluşturmak ve belirli bir kitap etrafında topluluk kurmak için idealdir. Ücretli kulüpler ise daha özel içerikler, kapalı etkinlikler, özel canlı yayınlar, okuma programları veya premium topluluk deneyimleri sunmak isteyen kişiler için güçlü bir model sağlar.</p><p>Bu sayede yazarlar, akademisyenler, eğitmenler, kitap yorumcuları, influencer’lar ve okuma topluluğu kurmak isteyen herkes Bookinclub üzerinden kendi dijital kitap kulübünü oluşturabilir.</p><p>Bookinclub, kitap kulübü sahiplerine sadece bir topluluk kurma imkânı sunmaz; aynı zamanda bu topluluğu gelir modeline dönüştürebilecekleri bir altyapı sağlar.</p><h3>Newsletter ve E-posta Bildirimleri</h3><p>Bookinclub’da kitap kulübü sahiplerinin paylaştığı içerikler, etkinlikler ve duyurular kullanıcılara e-posta yoluyla da ulaştırılabilir.</p><p>Bu yapı, Substack benzeri bir newsletter deneyimini kitap kulüpleriyle birleştirir. Kulüp sahipleri takipçileriyle daha doğrudan iletişim kurabilir, yeni etkinliklerini duyurabilir, kitap önerilerini paylaşabilir ve topluluklarını platform dışında da aktif tutabilir.</p><p>E-posta bildirimleri, kitap kulüplerinin sadece platform içinde değil, kullanıcıların günlük dijital alışkanlıkları içinde de görünür olmasını sağlar. Böylece kulüp sahipleri takipçileriyle daha güçlü ve sürekli bir bağ kurabilir.</p><h3>Kitap İncelemeleri, Alıntılar ve Yorumlar</h3><p>Bookinclub sadece kulüpler ve canlı yayınlardan ibaret değildir. Platform aynı zamanda bireysel kullanıcıların kitaplar hakkında içerik üretebildiği sosyal bir okuma alanıdır.</p><p>Kullanıcılar okudukları kitaplar hakkında yorum yapabilir, kitap değerlendirmeleri paylaşabilir, alıntılar oluşturabilir ve detaylı incelemeler yazabilir. Bu sayede her kitap etrafında farklı düşünceler, farklı yorumlar ve farklı okuma deneyimleri bir araya gelir.</p><p>Bookinclub’da bir kitabı sadece okumazsınız; o kitap hakkında düşünebilir, yazabilir, tartışabilir ve başka okurların bakış açılarını keşfedebilirsiniz.</p><h3>Gelişmiş Kitap İnceleme Editörü</h3><p>Bookinclub, kitap incelemeleri için gelişmiş bir yazı editörü de sunar.</p><p>Kullanıcılar blog tarzında detaylı kitap incelemeleri yazabilir. Gelişmiş toolbar yapısına sahip bu kelime işlemci editörü sayesinde kullanıcılar yazılarını daha düzenli, daha profesyonel ve daha okunabilir şekilde hazırlayabilir.</p><p>Bu özellik, özellikle uzun kitap analizleri, denemeler, eleştiriler, karakter çözümlemeleri, bölüm değerlendirmeleri veya akademik tarzda kitap yazıları yazmak isteyen kullanıcılar için oldukça değerlidir.</p><p>Bookinclub, kısa yorumlardan uzun analizlere kadar farklı yazı türlerini destekleyen bir okuma ve yazma alanı oluşturur.</p><h3>Global ve Çok Dilli Bir Platform</h3><p>Bookinclub, yalnızca tek bir ülkeye veya tek bir dile odaklanan bir platform değildir. Platform, dünya genelindeki kullanıcılara açık olacak şekilde tasarlanmıştır ve birçok dilde hizmet verebilecek bir yapıya sahiptir.</p><p>Farklı ülkelerden kullanıcılar, farklı dillerde kitaplar keşfedebilir, yabancı kitapları inceleyebilir, yazarları takip edebilir ve uluslararası okuma topluluklarının parçası olabilir.</p><p>Kitaplar zaten doğası gereği kültürler arası bir köprü kurar. Bookinclub ise bu köprüyü dijital dünyada daha görünür, daha erişilebilir ve daha etkileşimli hale getirir.</p><h3>Yazarları ve Kitapları Takip Etmek</h3><p>Bookinclub’da kullanıcılar yalnızca kitap kulüplerini değil, kitapları ve yazarları da takip edebilir.</p><p>Bu sayede kullanıcılar sevdikleri yazarların kitapları etrafında oluşan içerikleri, yorumları, incelemeleri ve toplulukları daha kolay keşfedebilir. Bir kitabın etrafında oluşan tüm sosyal etkileşimler, okuma deneyimini daha zengin hale getirir.</p><p>Bookinclub, kitap keşfetme sürecini klasik arama deneyiminin ötesine taşır. Kullanıcılar sadece “hangi kitabı okumalıyım?” sorusuna cevap bulmaz; aynı zamanda “bu kitap hakkında kimler konuşuyor, kim ne düşünüyor, hangi kulüpte tartışılıyor?” gibi sorulara da cevap bulabilir.</p><h3>Neden Bookinclub?</h3><p>Bookinclub, kitap okuma deneyimini bireysel bir alışkanlıktan sosyal ve interaktif bir topluluk deneyimine dönüştürür.</p><p>Platform; online book club, digital book club platform, paid book clubs, live book events, book reviews, book quotes, reading community ve newsletter tabanlı topluluk iletişimini tek bir yapı altında birleştirir.</p><p>Bugün dijital dünyada birçok sosyal platform var. Ancak kitaplar etrafında daha derin, daha anlamlı ve daha düzenli topluluklar oluşturmak isteyen kullanıcılar için özel olarak tasarlanmış platformların sayısı hâlâ sınırlı. Bookinclub bu boşluğu doldurmak için geliştirildi.</p><p>Bookinclub ile kullanıcılar:</p><p>Kitap kulüplerine katılabilir.<br> Kendi kitap kulüplerini açabilir.<br> Ücretli veya ücretsiz etkinlikler oluşturabilir.<br> Canlı yayınlara katılabilir.<br> Kitaplar hakkında yorum, alıntı ve inceleme paylaşabilir.<br> Detaylı kitap analizleri yazabilir.<br> Yazarları ve kitapları takip edebilir.<br> Newsletter benzeri e-posta bildirimleriyle topluluklarını büyütebilir.<br> Global bir okuma topluluğunun parçası olabilir.</p><h3>Kitap Kulüplerinin Geleceği Dijitalde</h3><p>Kitap kulüpleri uzun yıllardır insanların bir araya gelip fikir paylaştığı, tartıştığı ve birlikte öğrendiği alanlar oldu. Ancak artık bu deneyim sadece fiziksel toplantılarla sınırlı değil.</p><p>Dijital platformlar sayesinde bir kitap kulübü aynı anda İstanbul’dan, Londra’dan, New York’tan, Berlin’den veya dünyanın herhangi bir yerinden insanları bir araya getirebilir. Bu da kitap kulüplerini daha kapsayıcı, daha erişilebilir ve daha global hale getirir.</p><p>Bookinclub, bu yeni dönemin kitap kulübü platformu olmayı hedefliyor.</p><p>Okurlar için daha sosyal bir okuma deneyimi, kulüp sahipleri için daha güçlü topluluk araçları, içerik üreticileri için yeni gelir modelleri ve kitap kültürü için daha canlı bir dijital ekosistem sunuyor.</p><h3>Sonuç</h3><p><a href="https://bookinclub.com/">Bookinclub</a>, kitap okumayı yalnızca bireysel bir aktivite olarak görmez. Kitapları; toplulukların, sohbetlerin, canlı yayınların, yazıların, fikirlerin ve etkinliklerin merkezine koyar.</p><p>Dünyada kitap kulüplerine, online okuma topluluklarına ve dijital etkinliklere olan ilgi artarken, Bookinclub bu ihtiyaca modern, global ve çok yönlü bir çözüm sunar.</p><p>Kitap kulübü açmak, kitaplar hakkında yazmak, canlı yayın düzenlemek, ücretli etkinlikler oluşturmak, yazarları takip etmek veya sadece daha anlamlı bir okuma topluluğunun parçası olmak isteyen herkes için Bookinclub yeni bir dijital alan yaratıyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*sk3I_lhO-n0sccYK6e_zFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/37/1*R85rSgX5Si8HdB4XfowZdA.png" /></figure><p><a href="https://bookinclub.com/">https://bookinclub.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6834fddee06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Lambda function for AWS Security Hub [ES.2] — How to locate Elasticsearch domains in a VPC]]></title>
            <link>https://muratneciparcan.medium.com/python-lambda-function-for-aws-security-hub-es-2-how-to-locate-elasticsearch-domains-in-a-vpc-2ecd4124aaae?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ecd4124aaae</guid>
            <category><![CDATA[remediation]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws-security-hub]]></category>
            <category><![CDATA[aws-vpc]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Sun, 24 Sep 2023 16:47:43 GMT</pubDate>
            <atom:updated>2023-09-24T16:47:43.098Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Lambda function for AWS Security Hub [ES.2] — How to locate Elasticsearch domains in a VPC</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*A4pkoIGDxtsMaNBX2akyyw.png" /></figure><p>[ES.2] in AWS Security Hub is necessary to enforce best practices for securing Elasticsearch domains by ensuring they are located within a VPC. This configuration helps organizations meet security, compliance, and data protection requirements while reducing the risk of security incidents.</p><p><strong>Here is the Lambda function designed to automatically evaluate and remediate security issues related to AWS Elasticsearch domains. Below is a summary of the code</strong>:</p><p>Imports and Parameters: The code imports necessary libraries such as requests_aws4auth, boto3, and others. It also sets various parameters, including the control ID, control name, DynamoDB table name, and a flag for assuming a role. It lists the events that trigger this Lambda function.</p><h4><strong>Code Flow</strong></h4><p><strong>Main Code</strong>: The main code of the Lambda function is structured as follows:</p><ul><li>get_domain_instance_by_id (Function #1): Checks if an Elasticsearch domain has been configured with a Virtual Private Cloud (VPC).</li><li>create_new_domain (Function #2): Creates a new Elasticsearch domain with VPC settings and related configurations.</li><li>create_bucket (Function): Creates an Amazon S3 bucket in the specified region.</li><li>create_repository (Function): Creates a repository for Elasticsearch snapshots, typically used for backup and restoration.</li><li>restore_snapshot_froms3_es (Function): Restores Elasticsearch data from a snapshot stored in an S3 bucket to a new Elasticsearch domain.</li><li>remove_non_complaint_domain (Function #4): Removes a non-compliant Elasticsearch domain.</li><li>send_sns_notification (Function): Sends a notification message to an AWS SNS topic, typically used to notify about success or failure of remediation actions.</li><li>get_parameter (Function): Retrieves a parameter value from AWS Systems Manager Parameter Store (SSM).</li><li>get_default_security_group (Function): Retrieves the default security group for an Amazon Elastic Compute Cloud (EC2) instance.</li><li>filter_subnet_by_availability (Function): Filters subnets by availability zones.</li><li>lambda_handler (Main Handler Function): The main entry point for the Lambda function. It processes AWS events, such as the creation of Elasticsearch domains, and takes remediation actions if needed. It also sets up clients for AWS services.</li></ul><p>Function Description and Trigger: The code defines a Lambda function named aws-sechubrem-es-2. It is designed to handle security issues related to AWS Elasticsearch domains. The trigger for this function is when specific AWS events occur, including CreateDomain and CreateElasticsearchDomain.</p><p><strong>Python Code:</strong></p><pre>&quot;&quot;&quot;<br>##############################################################<br>##                      Murat Arcan                         ##<br>##############################################################<br>Function Name:<br>    aws-sechubrem-es-2<br>Description:<br>    Source code to auto-evaluate and auto-remediate the security issue.<br>Trigger:<br>    CreateDomain<br>    CreateElasticsearchDomain<br>&quot;&quot;&quot;<br><br>from requests_aws4auth import AWS4Auth<br>import boto3, requests, json, os, time, datetime, logging, sys<br>from botocore.exceptions import ClientError<br><br>##############<br># Parameters #<br>##############<br>CONTROL_ID = &#39;ES.2&#39;<br>CONTROL_NAME = &#39;[ES.2] Elasticsearch domains should be in a VPC&#39;<br>DDB_TABLE = &#39;event_wait_table&#39;<br>ASSUME_ROLE_MODE = True<br>ASSUME_ROLE_NAME = &#39;elasticsearch-adminrole-for-lambda&#39;<br>EVENTS = [<br>    &#39;CreateDomain&#39;,<br>    &#39;CreateElasticsearchDomain&#39;,<br>]<br><br>#############<br># Main Code #<br>#############<br>def get_domain_instance_by_id(domain_name): # 1<br>    &quot;&quot;&quot;<br>    Check if the domain has configured VPC<br>    &quot;&quot;&quot;<br>    try:<br>        response = AWS_ES_CLIENT.describe_elasticsearch_domain(<br>            DomainName=domain_name<br>        )<br>        if &#39;VPCOptions&#39; in response[&#39;DomainStatus&#39;]:<br>            return {<br>              &quot;isConfigured&quot;: True,<br>              &quot;instance&quot;: &#39;&#39;<br>            }<br>        return {<br>              &quot;isConfigured&quot;: False,<br>              &quot;instance&quot;: response<br>            }<br>    except ClientError as e:<br>        print(e)<br>        return False<br><br>def create_new_domain(particularDomain): # 2<br>    &quot;&quot;&quot;<br>    Create new domain<br>    &quot;&quot;&quot;<br>    <br>    sn_all = AWS_EC2_CLIENT.describe_subnets()<br><br>    SubnetIds = filter_subnet_by_availability()<br>    SecurityGroupIds = get_default_security_group()<br><br>    for sn in sn_all[&#39;Subnets&#39;]:<br>        SubnetIds.append(sn[&#39;SubnetId&#39;])<br><br>    try: <br>        response = AWS_ES_CLIENT.create_elasticsearch_domain(<br>            DomainName = particularDomain,<br>            VPCOptions={<br>                &#39;SubnetIds&#39;: SubnetIds,<br>                &#39;SecurityGroupIds&#39;: SecurityGroupIds<br>          }<br>        )<br>        <br>        return response<br>    except ClientError as e:<br>        print(e)<br>        return False<br><br># Create a bucket in the same region where the Elasticsearch domain exists.<br># Copy the bucket arn.<br># Create an IAM role, this role will allow Elasticsearch to use S3. <br># Initially create a role of ec2 use case (it will be changed later) without any policy. The policy will be added later.<br><br>def create_bucket(bucket_name, region=None):<br>    &quot;&quot;&quot;Create an S3 bucket in a specified region<br><br>    If a region is not specified, the bucket is created in the S3 default<br>    region (us-east-1).<br><br>    :param bucket_name: Bucket to create<br>    :param region: String region to create bucket in, e.g., &#39;us-west-2&#39;<br>    :return: True if bucket created, else False<br>    &quot;&quot;&quot;<br><br>    # Create bucket<br>    try:<br>        if region is None:<br>            s3_client = boto3.client(&#39;s3&#39;)<br>            s3_client.create_bucket(Bucket=bucket_name)<br>        else:<br>            s3_client = boto3.client(&#39;s3&#39;, region_name=region)<br>            location = {&#39;LocationConstraint&#39;: region}<br>            s3_client.create_bucket(Bucket=bucket_name,<br>                                    CreateBucketConfiguration=location)<br>    except ClientError as e:<br>        print(e)<br>        return False<br>    return True<br><br># Manual Snapshot / Backup<br># # https://search-first-domain-dhozh363umusdk2zcpbekj2tkq.us-east-1.es.amazonaws.com/<br><br>def create_repository(host, region, bucket_name):<br>    &quot;&quot;&quot;<br>    Create repository<br>    &quot;&quot;&quot;<br>    host = host<br>    region = region<br>    service = &#39;es&#39;<br><br>    credentials = boto3.Session().get_credentials()<br>    awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, region, service, session_token=credentials.token)<br><br>    path = &#39;/_snapshot/&#39; + host # the Elasticsearch API endpoint<br>    url = &quot;https://&quot; + host + path<br><br>    payload = {<br>     &quot;type&quot;: &quot;s3&quot;,<br>     &quot;settings&quot;: {<br>     &quot;bucket&quot;: bucket_name,<br>     &quot;region&quot;: region,<br>     &quot;role_arn&quot;: &quot;arn:aws:iam::your-iam-role:role/es-snapshot-role&quot; # AmazonESSnapshotRole is the default role name for ES snapshot<br>     }<br>    }<br><br>    headers = {&quot;Content-Type&quot;: &quot;application/json&quot;}<br>    <br>    r = requests.put(url, auth=awsauth, json=payload, headers=headers, verify=False)<br>    print(&quot;Repo created : &quot;, r)<br><br>    return True<br><br>def restore_snapshot_froms3_es(new_host, region, bucket_name, previous_domain_api):<br>    &quot;&quot;&quot;<br>    Restore<br>    &quot;&quot;&quot;<br><br>    host = new_host<br>    region = region<br>    service = &#39;es&#39;<br>    credentials = boto3.Session().get_credentials()<br>    awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, region, service, session_token=credentials.token)<br><br>    # Register repository<br>    path = &#39;/_snapshot/&#39; + previous_domain_api # the Elasticsearch API endpoint<br>    url = &quot;https://&quot; + host + path<br><br>    payload = {<br>      &quot;type&quot;: &quot;s3&quot;,<br>      &quot;settings&quot;: {<br>      &quot;bucket&quot;: bucket_name,<br>      &quot;region&quot;: region,<br>      &quot;role_arn&quot;: &quot;arn:aws:iam::your-iam-id:role/es-snapshot-role&quot; # dynamic<br>      }<br>    }<br>    <br>    headers = {&quot;Content-Type&quot;: &quot;application/json&quot;}<br>    r = requests.put(url, auth=awsauth, json=payload, headers=headers)<br><br>    print(r.status_code)<br>    return True<br><br>def remove_non_complaint_domain(resource_id, account_id, usr_name,<br>                              usr_arn, region_name): # 4<br>    &quot;&quot;&quot;<br>    Remove non-complaint domain<br>    &quot;&quot;&quot;<br>    <br>    try: <br>        response = AWS_ES_CLIENT.delete_elasticsearch_domain(<br>            DomainName=resource_id<br>        )<br><br>        status = response[&#39;ResponseMetadata&#39;][&#39;HTTPStatusCode&#39;]<br><br>        if status == 200:<br>          print(&#39;Remediation succeeded, sending the notification&#39;)<br>          send_sns_notification(resource_id, account_id, usr_name,<br>                              usr_arn, region_name, &quot;Success&quot;)<br>        else:<br>          print(&#39;Remediation failed, sending the notification&#39;)<br>          send_sns_notification(resource_id, account_id, usr_name,<br>                              usr_arn, region_name, &quot;Failure&quot;)<br><br>        return True<br>    except ClientError as e:<br>        print(e)<br>        return False<br><br><br>def send_sns_notification(<br>    resource_id, account_id, usr_name, usr_arn, region_name, result<br>):<br>    &quot;&quot;&quot;<br>    publish message to SNS topic<br>    &quot;&quot;&quot;<br>    # Compose email<br>    if result == &#39;Success&#39;:<br>        subject = &#39;Security Remediation Failure (#&#39; + \<br>            account_id + &#39;): &#39; + CONTROL_ID<br>        message = (<br>            f&quot;Control name: &#39;{CONTROL_NAME}&#39;. \n\n&quot;<br>            f&quot;The following Elasticsearch &#39;{resource_id}&#39; was &quot; +<br>            &quot;brought into compliance following a remediation attempt. \n\n&quot;<br>            f&quot;User &#39;{usr_name}&#39; with the Arn &#39;{usr_arn}&#39; modified the &quot; +<br>            f&quot;configuration of the distribution in &#39;{region_name}&#39;.&quot;<br>        )<br><br>    elif result == &#39;Failure&#39;:<br>        subject = &#39;Security Remediation Failure (#&#39; + \<br>            account_id + &#39;): &#39; + CONTROL_ID<br>        message = (<br>            f&quot;Control name: &#39;{CONTROL_NAME}&#39;. \n\n&quot;<br>            f&quot;The following Elasticsearch &#39;{resource_id}&#39; is &quot; +<br>            &quot;still non-compliant following a remediation attempt. \n\n&quot;<br>            f&quot;User &#39;{usr_name}&#39; with the Arn &#39;{usr_arn}&#39; modified the &quot; +<br>            f&quot;configuration of the distribution in &#39;{region_name}&#39;.&quot;<br>        )<br><br>    audit_account_id = get_parameter(&#39;/control-tower/audit-account-id&#39;)<br><br>    sns_arn = &#39;arn:aws:sns:us-east-1:&#39; + audit_account_id + \<br>              &#39;:sechubrem-sns-topic&#39;<br><br>    sns_client = boto3.client(&#39;sns&#39;)<br>    sns_client.publish(<br>        TopicArn=sns_arn,<br>        Message=message,<br>        Subject=subject<br>    )<br><br>    return<br><br><br>def get_parameter(name):<br>    ssm_client = boto3.client(&#39;ssm&#39;)<br>    response = ssm_client.get_parameter(<br>        Name=name<br>    )<br><br>    value = response[&#39;Parameter&#39;][&#39;Value&#39;]<br>    return value<br><br>def get_default_security_group():<br>    &quot;&quot;&quot;<br>    Get default security group<br>    &quot;&quot;&quot;<br>    response = AWS_EC2_CLIENT.describe_security_groups(<br>        Filters=[<br>            {<br>                &#39;name&#39;: &#39;group-name&#39;,<br>                &#39;Values&#39;: [<br>                    &#39;default&#39;,<br>                ]<br>            },<br>        ],<br>        MaxResults=5<br>    )<br><br>    return response[&#39;SecurityGroups&#39;][0][&#39;GroupId&#39;]<br><br><br>def filter_subnet_by_availability():<br>    &quot;&quot;&quot;<br>    Filter subnet by availability - region can be dynamic<br>    &quot;&quot;&quot;<br><br>    zones = []<br><br>    firstZone = AWS_EC2_CLIENT.describe_subnets(<br>        Filters=[<br>            {<br>                &#39;Name&#39;: &#39;availability-zone&#39;,<br>                &#39;Values&#39;: [<br>                    &#39;us-east-1a&#39;,<br>                ]<br>            },<br>        ],<br>        MaxResults=5<br>    )<br><br>    secondZone = AWS_EC2_CLIENT.describe_subnets(<br>        Filters=[<br>            {<br>                &#39;Name&#39;: &#39;availability-zone&#39;,<br>                &#39;Values&#39;: [<br>                    &#39;us-east-1b&#39;,<br>                ]<br>            },<br>        ],<br>        MaxResults=5<br>    )<br><br>    thirdZone = AWS_EC2_CLIENT.describe_subnets(<br>        Filters=[<br>            {<br>                &#39;Name&#39;: &#39;availability-zone&#39;,<br>                &#39;Values&#39;: [<br>                    &#39;us-east-1c&#39;,<br>                ]<br>            },<br>        ],<br>        MaxResults=5<br>    )<br><br>    if firstZone[&#39;Subnets&#39;]:<br>        zones.append(firstZone[&#39;Subnets&#39;][0][&#39;SubnetId&#39;])<br><br>    if secondZone[&#39;Subnets&#39;]:<br>        zones.append(secondZone[&#39;Subnets&#39;][0][&#39;SubnetId&#39;])<br><br>    if thirdZone[&#39;Subnets&#39;]:<br>        zones.append(thirdZone[&#39;Subnets&#39;][0][&#39;SubnetId&#39;])<br><br>    return zones<br><br><br>def lambda_handler(event, context):<br>    print(&quot;lambda invoked&quot;)<br><br>    # Declare global variables<br>    global AWS_ES_CLIENT<br>    global AWS_EC2_CLIENT<br><br>    check_defined(event, &#39;event&#39;)<br>    print(&#39;*****Event Details*****&#39; + str(event))<br><br>    # Get event details<br>    event_name = event[&#39;detail&#39;][&#39;eventName&#39;]<br>    resource_id = event[&#39;detail&#39;][&#39;responseElements&#39;][&#39;domainStatus&#39;][&#39;domainId&#39;]<br>    domain_name = event[&#39;detail&#39;][&#39;responseElements&#39;][&#39;domainStatus&#39;][&#39;domainName&#39;]<br>    user = (event[&#39;detail&#39;][&#39;userIdentity&#39;][&#39;principalId&#39;]).split(&quot;:&quot;, 1)[1]<br>    usr_arn = event[&#39;detail&#39;][&#39;userIdentity&#39;][&#39;arn&#39;]<br>    account_id = event[&#39;detail&#39;][&#39;recipientAccountId&#39;]<br>    region_name = event[&#39;detail&#39;][&#39;awsRegion&#39;]<br>    bucket_name = &#39;es2-snapshot-bucket-new&#39;<br><br>    if event_name in EVENTS:<br>        try:<br>            # Configure clients<br>            AWS_ES_CLIENT = get_client(&#39;es&#39;, account_id, region_name)<br>            AWS_EC2_CLIENT = get_client(&#39;ec2&#39;, account_id, region_name)<br><br>            # check the resource<br>            domain = get_domain_instance_by_id(domain_name)<br><br>            # Validate the resource<br>            if not domain[&quot;isConfigured&quot;]:<br>                print(&#39;The domain &#39; + resource_id + &#39; is not configured with VPC&#39;)<br><br>                print(&#39;Creating new domain and migrating data for &#39; +<br>                      &#39;domain &#39; + resource_id)  <br>                      <br>                print(&#39;Creating new bucket for the snapshot of &#39; + resource_id)<br>                create_bucket(bucket_name, region_name)<br><br>                print(&#39;Registering current domain snapshot to restore for the new domain &#39; + resource_id)<br>                create_repository(domain[&quot;instance&quot;][&quot;DomainStatus&quot;][&quot;Endpoint&quot;], region_name, bucket_name)<br>                <br>                print(&#39;Creating new domain...&#39;)<br>                new_domain = create_new_domain(domain[&quot;instance&quot;][&quot;DomainStatus&quot;][&quot;DomainName&quot;] + &quot;-new&quot;)<br><br>                print(&#39;Restoring data from previous domain to new domain&#39;)<br>                restore_snapshot_froms3_es(new_domain[&quot;DomainStatus&quot;][&quot;Endpoint&quot;], region_name, bucket_name, domain[&quot;instance&quot;][&quot;DomainStatus&quot;][&quot;Endpoint&quot;])<br><br>                print(&#39;Finalizing the process...&#39;)<br>                remove_non_complaint_domain(resource_id, account_id, user, usr_arn, region_name)<br><br>                print(&#39;Completed &#39; + &#39;domain &#39; + resource_id)<br><br>            else:<br>                print(&#39;The default root object for &#39; + &#39;distribution &#39; + resource_id + &#39; is configured&#39;)<br><br>        except ClientError as ex:<br>            if is_internal_error(ex):<br>                return build_internal_error_response(<br>                    &quot;Unexpected error while completing API request&quot;, str(ex)<br>                )<br>            return build_error_response(<br>                &quot;Customer error while making API request&quot;, str(ex),<br>                ex.response[&#39;Error&#39;][&#39;Code&#39;], ex.response[&#39;Error&#39;][&#39;Message&#39;]<br>            )<br>        except ValueError as ex:<br>            return build_internal_error_response(str(ex), str(ex))<br><br>    return<br><br><br>####################<br># Helper Functions #<br>####################<br>def get_client(service, account_id, region):<br>    &quot;&quot;&quot;<br>    Return the service boto client.<br>       It should be used instead of directly calling the client.<br>    Keyword arguments:<br>       service -- the service name used for calling the boto.client()<br>       account_id -- the account id provided in the event<br>    &quot;&quot;&quot;<br>    if not ASSUME_ROLE_MODE:<br>        return boto3.client(service, region_name=region)<br>    execution_role_arn = &#39;arn:aws:iam::&#39; + account_id + \<br>        &#39;:role/&#39; + ASSUME_ROLE_NAME<br><br>    credentials = get_assume_role_credentials(execution_role_arn)<br>    return boto3.client(service, region_name=region,<br>                        aws_access_key_id=credentials[&#39;AccessKeyId&#39;],<br>                        aws_secret_access_key=credentials[&#39;SecretAccessKey&#39;],<br>                        aws_session_token=credentials[&#39;SessionToken&#39;])<br><br><br>####################<br># Boilerplate Code #<br>####################<br>def check_defined(reference, reference_name):<br>    &quot;&quot;&quot;<br>    Helper function used to validate input<br>    &quot;&quot;&quot;<br>    if not reference:<br>        raise Exception(&#39;Error: &#39;, reference_name, &#39;is not defined&#39;)<br>    return reference<br><br><br>def get_assume_role_credentials(role_arn):<br>    sts_client = boto3.client(&#39;sts&#39;)<br>    print(role_arn)<br>    try:<br>        assume_role_response = sts_client.assume_role(<br>            RoleArn=role_arn, RoleSessionName=&quot;sechubrem-lambda&quot;)<br>        return assume_role_response[&#39;Credentials&#39;]<br>    except ClientError as ex:<br>        # Scrub error message for any internal account info leaks<br>        print(str(ex))<br>        if &#39;AccessDenied&#39; in ex.response[&#39;Error&#39;][&#39;Code&#39;]:<br>            ex.response[&#39;Error&#39;][&#39;Message&#39;] = &quot;SecHubRem Lambda does not &quot; + \<br>                &quot;have permission to assume the IAM role.&quot;<br>        else:<br>            ex.response[&#39;Error&#39;][&#39;Message&#39;] = &quot;InternalError&quot;<br>            ex.response[&#39;Error&#39;][&#39;Code&#39;] = &quot;InternalError&quot;<br>        raise ex<br><br><br>def is_internal_error(exception):<br>    return (<br>        (not isinstance(exception, ClientError)) or<br>        exception.response[&#39;Error&#39;][&#39;Code&#39;].startswith(&#39;5&#39;) or<br>        &#39;InternalError&#39; in exception.response[&#39;Error&#39;][&#39;Code&#39;] or<br>        &#39;ServiceError&#39; in exception.response[&#39;Error&#39;][&#39;Code&#39;]<br>    )<br><br><br>def build_internal_error_response(customer_error_message,<br>                                  internal_error_details=None):<br>    return build_error_response(<br>        customer_error_message, internal_error_details,<br>        &#39;InternalError&#39;, &#39;InternalError&#39;<br>    )<br><br><br>def build_error_response(<br>    internal_error_message, internal_error_details=None,<br>    customer_error_code=None, customer_error_message=None<br>):<br>    error_response = {<br>        &#39;internalErrorMessage&#39;: internal_error_message,<br>        &#39;internalErrorDetails&#39;: internal_error_details,<br>        &#39;customerErrorMessage&#39;: customer_error_message,<br>        &#39;customerErrorCode&#39;: customer_error_code<br>    }<br>    print(error_response)<br>    return error_response<br><br>test_event = {<br>    &quot;detail&quot;: {<br>    &quot;eventVersion&quot;: &quot;1.08&quot;,<br>    &quot;userIdentity&quot;: {<br>        &quot;type&quot;: &quot;Root&quot;,<br>        &quot;principalId&quot;: &quot;&quot;,<br>        &quot;arn&quot;: &quot;arn:aws:iam::your-iam-id:role/admin-xa-role&quot;,<br>        &quot;accountId&quot;: &quot;your-account-id&quot;,<br>        &quot;accessKeyId&quot;: &quot;your-key-id&quot;,<br>        &quot;userName&quot;: &quot;marcan&quot;,<br>        &quot;sessionContext&quot;: {<br>            &quot;sessionIssuer&quot;: {},<br>            &quot;webIdFederationData&quot;: {},<br>            &quot;attributes&quot;: {<br>                &quot;creationDate&quot;: &quot;2022-10-06T10:09:35Z&quot;,<br>                &quot;mfaAuthenticated&quot;: &quot;false&quot;<br>            }<br>        }<br>    },<br>    &quot;eventTime&quot;: &quot;2022-10-06T13:22:08Z&quot;,<br>    &quot;eventSource&quot;: &quot;es.amazonaws.com&quot;,<br>    &quot;eventName&quot;: &quot;CreateDomain&quot;,<br>    &quot;awsRegion&quot;: &quot;us-east-1&quot;,<br>    &quot;sourceIPAddress&quot;: &quot;AWS Internal&quot;,<br>    &quot;userAgent&quot;: &quot;AWS Internal&quot;,<br>    &quot;requestParameters&quot;: {<br>        &quot;domainName&quot;: &quot;elastichsearch-public&quot;,<br>        &quot;engineVersion&quot;: &quot;Elasticsearch_7.10&quot;,<br>        &quot;clusterConfig&quot;: {<br>            &quot;instanceType&quot;: &quot;t3.small.search&quot;,<br>            &quot;instanceCount&quot;: 3,<br>            &quot;dedicatedMasterEnabled&quot;: True,<br>            &quot;zoneAwarenessEnabled&quot;: True,<br>            &quot;zoneAwarenessConfig&quot;: {<br>                &quot;availabilityZoneCount&quot;: 3<br>            },<br>            &quot;dedicatedMasterType&quot;: &quot;t3.small.search&quot;,<br>            &quot;dedicatedMasterCount&quot;: 3,<br>            &quot;warmEnabled&quot;: False,<br>            &quot;coldStorageOptions&quot;: {<br>                &quot;enabled&quot;: False<br>            }<br>        },<br>        &quot;eBSOptions&quot;: {<br>            &quot;eBSEnabled&quot;: True,<br>            &quot;volumeType&quot;: &quot;gp3&quot;,<br>            &quot;volumeSize&quot;: 10,<br>            &quot;iops&quot;: 3000,<br>            &quot;throughput&quot;: 125<br>        },<br>        &quot;accessPolicies&quot;: &quot;{\&quot;Version\&quot;:\&quot;2012-10-17\&quot;,\&quot;Statement\&quot;:[{\&quot;Effect\&quot;:\&quot;Deny\&quot;,\&quot;Principal\&quot;:{\&quot;AWS\&quot;:[\&quot;*\&quot;]},\&quot;Action\&quot;:[\&quot;es:*\&quot;],\&quot;Resource\&quot;:\&quot;arn:aws:es:us-east-1:157353034158:domain/first-domain-es/*\&quot;}]}&quot;,<br>        &quot;snapshotOptions&quot;: {},<br>        &quot;encryptionAtRestOptions&quot;: {<br>            &quot;enabled&quot;: True<br>        },<br>        &quot;nodeToNodeEncryptionOptions&quot;: {<br>            &quot;enabled&quot;: True<br>        },<br>        &quot;advancedOptions&quot;: {<br>            &quot;indices.fielddata.cache.size&quot;: &quot;20&quot;,<br>            &quot;override_main_response_version&quot;: &quot;false&quot;,<br>            &quot;indices.query.bool.max_clause_count&quot;: &quot;1024&quot;,<br>            &quot;rest.action.multi.allow_explicit_index&quot;: &quot;true&quot;<br>        },<br>        &quot;domainEndpointOptions&quot;: {<br>            &quot;enforceHTTPS&quot;: True,<br>            &quot;customEndpointEnabled&quot;: False<br>        },<br>        &quot;tagList&quot;: []<br>    },<br>    &quot;responseElements&quot;: {<br>        &quot;domainStatus&quot;: {<br>            &quot;domainId&quot;: &quot;969611828275/elastichsearch-public&quot;,<br>            &quot;domainName&quot;: &quot;elastichsearch-public&quot;,<br>            &quot;aRN&quot;: &quot;arn:aws:es:us-east-1:969611828275:domain/elastichsearch-public&quot;,<br>            &quot;created&quot;: True,<br>            &quot;deleted&quot;: False,<br>            &quot;processing&quot;: True,<br>            &quot;upgradeProcessing&quot;: False,<br>            &quot;engineVersion&quot;: &quot;Elasticsearch_7.10&quot;,<br>            &quot;clusterConfig&quot;: {<br>                &quot;instanceType&quot;: &quot;t3.small.search&quot;,<br>                &quot;instanceCount&quot;: 3,<br>                &quot;dedicatedMasterEnabled&quot;: True,<br>                &quot;zoneAwarenessEnabled&quot;: True,<br>                &quot;zoneAwarenessConfig&quot;: {<br>                    &quot;availabilityZoneCount&quot;: 3<br>                },<br>                &quot;dedicatedMasterType&quot;: &quot;t3.small.search&quot;,<br>                &quot;dedicatedMasterCount&quot;: 3,<br>                &quot;warmEnabled&quot;: False,<br>                &quot;coldStorageOptions&quot;: {<br>                    &quot;enabled&quot;: False<br>                }<br>            },<br>            &quot;eBSOptions&quot;: {<br>                &quot;eBSEnabled&quot;: True,<br>                &quot;volumeType&quot;: &quot;gp3&quot;,<br>                &quot;volumeSize&quot;: 10,<br>                &quot;iops&quot;: 3000,<br>                &quot;throughput&quot;: 125<br>            },<br>            &quot;accessPolicies&quot;: &quot;{\&quot;Version\&quot;:\&quot;2012-10-17\&quot;,\&quot;Statement\&quot;:[{\&quot;Effect\&quot;:\&quot;Deny\&quot;,\&quot;Principal\&quot;:{\&quot;AWS\&quot;:\&quot;*\&quot;},\&quot;Action\&quot;:\&quot;es:*\&quot;,\&quot;Resource\&quot;:\&quot;arn:aws:es:us-east-1:157353034158:domain/first-domain-es/*\&quot;}]}&quot;,<br>            &quot;snapshotOptions&quot;: {},<br>            &quot;cognitoOptions&quot;: {<br>                &quot;enabled&quot;: False<br>            },<br>            &quot;encryptionAtRestOptions&quot;: {<br>                &quot;enabled&quot;: False,<br>                &quot;kmsKeyId&quot;: &quot;arn:aws:kms:us-east-1:157353034158:key/e8b84510-9a3f-42e0-aa08-8490211c66ed&quot;<br>            },<br>            &quot;nodeToNodeEncryptionOptions&quot;: {<br>                &quot;enabled&quot;: False<br>            },<br>            &quot;advancedOptions&quot;: {<br>                &quot;indices.fielddata.cache.size&quot;: &quot;20&quot;,<br>                &quot;override_main_response_version&quot;: &quot;false&quot;,<br>                &quot;indices.query.bool.max_clause_count&quot;: &quot;1024&quot;,<br>                &quot;rest.action.multi.allow_explicit_index&quot;: &quot;true&quot;<br>            },<br>            &quot;serviceSoftwareOptions&quot;: {<br>                &quot;currentVersion&quot;: &quot;&quot;,<br>                &quot;newVersion&quot;: &quot;&quot;,<br>                &quot;updateAvailable&quot;: False,<br>                &quot;cancellable&quot;: False,<br>                &quot;updateStatus&quot;: &quot;COMPLETED&quot;,<br>                &quot;description&quot;: &quot;There is no software update available for this domain.&quot;,<br>                &quot;automatedUpdateDate&quot;: &quot;Dec 31, 1969 4:00:00 PM&quot;,<br>                &quot;optionalDeployment&quot;: False<br>            },<br>            &quot;domainEndpointOptions&quot;: {<br>                &quot;enforceHTTPS&quot;: False,<br>                &quot;tLSSecurityPolicy&quot;: &quot;Policy-Min-TLS-1-0-2019-07&quot;,<br>                &quot;customEndpointEnabled&quot;: False<br>            },<br>            &quot;advancedSecurityOptions&quot;: {<br>                &quot;enabled&quot;: False,<br>                &quot;internalUserDatabaseEnabled&quot;: False,<br>                &quot;anonymousAuthEnabled&quot;: False<br>            },<br>            &quot;autoTuneOptions&quot;: {<br>                &quot;state&quot;: &quot;ENABLE_IN_PROGRESS&quot;<br>            },<br>            &quot;changeProgressDetails&quot;: {<br>                &quot;changeId&quot;: &quot;f155c954-073d-4639-b632-3b26d724f48a&quot;<br>            }<br>        },<br>        &quot;isElasticsearchDomain&quot;: True<br>    },<br>    &quot;requestID&quot;: &quot;264de301-4ef1-4285-a97b-9f83cda18709&quot;,<br>    &quot;eventID&quot;: &quot;404466b0-4166-4a26-8d03-d0fd0b6cd5cb&quot;,<br>    &quot;readOnly&quot;: False,<br>    &quot;eventType&quot;: &quot;AwsApiCall&quot;,<br>    &quot;managementEvent&quot;: True,<br>    &quot;recipientAccountId&quot;: &quot;157353034158&quot;,<br>    &quot;eventCategory&quot;: &quot;Management&quot;,<br>    &quot;sessionCredentialFromConsole&quot;: &quot;true&quot;<br>    }<br>}<br><br>test_context = {}<br><br>lambda_handler(test_event, test_context)</pre><blockquote><strong>Overall, this Lambda function is intended to automate the evaluation and remediation of security issues related to AWS Elasticsearch domains, particularly focusing on ensuring that Elasticsearch domains are configured with VPC settings. It also handles snapshot creation and restoration. The function communicates with AWS services, such as Elasticsearch, EC2, S3, and SNS, to achieve its goals.</strong></blockquote><ul><li><a href="https://docs.aws.amazon.com/securityhub/latest/userguide/es-controls.html">Elasticsearch controls</a></li><li><a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/es.html">ElasticsearchService - Boto3 1.28.53 documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ecd4124aaae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Nuke! Enabling automated deletion of AWS SSO account resources utilizing aws-nuke without…]]></title>
            <link>https://awstip.com/aws-nuke-enabling-automated-deletion-of-aws-sso-account-resources-utilizing-aws-nuke-without-5a12b530c36f?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a12b530c36f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[lambda-function]]></category>
            <category><![CDATA[sso-single-sign-on-portal]]></category>
            <category><![CDATA[aws-nuke]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Tue, 25 Jul 2023 14:27:06 GMT</pubDate>
            <atom:updated>2023-07-27T19:33:46.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Nuke! Enabling automated deletion of AWS SSO account resources utilizing aws-nuke without touching SSO profiles</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmPMgH2qtv9oX01nC2Mv8g.jpeg" /></figure><p><strong>aws-nuke</strong> is a powerful open-source CLI tool that complements the DevOps philosophy by automating the deletion of AWS resources that are no longer needed. It helps prevent resource accumulation, reduce costs, and maintain a clean and efficient AWS infrastructure.</p><p><strong>Deleting Resources with AWS Nuke</strong>:</p><p>AWS Nuke is capable of deleting AWS resources across multiple regions and services, allowing users to define specific resource types they want to delete. By specifying the desired resource types and accounts, AWS Nuke systematically scans and deletes the identified resources, ensuring they are no longer consuming unnecessary resources or incurring costs.</p><p><strong>Using AWS Nuke with AWS Organizations and AWS SSO</strong>:</p><p>AWS Nuke seamlessly integrates with AWS Organizations, which is a service that enables the central management of multiple AWS accounts. With AWS Organizations, you can use AWS Nuke to delete resources across all linked AWS accounts from a single control account, simplifying the resource cleanup process for large-scale AWS infrastructures.</p><p>Furthermore, AWS Nuke can be integrated with AWS Single Sign-On (SSO) service, which enables users to access multiple AWS accounts with a single set of credentials. By utilizing AWS SSO, administrators can ensure that only authorized personnel can execute AWS Nuke operations, enhancing security and governance during the resource deletion process.</p><p>In summary, AWS Nuke aligns perfectly with the principles of DevOps by automating resource cleanup, reducing operational costs, and promoting efficiency within AWS environments. Its compatibility with AWS Organizations and AWS SSO strengthens its capabilities, making it an invaluable tool for managing AWS resources effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6AXYV3uwPK8N4v71PfI-w.png" /><figcaption>Example diagram to see where aws-nuke is taking action</figcaption></figure><h3><strong>Run aws-nuke on EC2 and lambda together to automate the nuke process</strong></h3><p>To automate the nuke process using AWS Lambda and EC2 together, you can follow these steps:</p><p><strong>Set up AWS Nuke on EC2:</strong></p><ul><li>Launch an EC2 instance and choose an appropriate Amazon Machine Image (AMI) that supports your desired Linux distribution.</li><li>Install the necessary dependencies, such as AWS CLI and Go, on the EC2 instance.</li><li>Clone the aws-nuke repository from GitHub onto the EC2 instance.</li><li>Build aws-nuke by running the appropriate commands.</li><li>Configure AWS credentials on the EC2 instance to allow aws-nuke to access your AWS resources.</li></ul><p><strong>Test AWS Nuke on EC2:</strong></p><ul><li>Manually run aws-nuke on the EC2 instance to ensure it works correctly and deletes the desired AWS resources.</li></ul><p><strong>Create a Lambda function</strong>:</p><ul><li>Write a Lambda function in Python that will be responsible for triggering aws-nuke on the EC2 instance.</li><li>Use the AWS SDK for Python (Boto3) to communicate with the EC2 instance and execute aws-nuke remotely.</li></ul><p><strong>Grant necessary permissions</strong>:</p><ul><li>Configure the Lambda function with an IAM role that has the necessary permissions to interact with EC2 instances and execute commands.</li></ul><p><strong>Implement the Lambda function:</strong></p><ul><li>In the Lambda function, use Boto3 to start the EC2 instance if it is not already running (optional step if you prefer to keep the instance running).</li><li>Use Boto3 to execute commands on the EC2 instance remotely. You can use tools like Paramiko or SSH into the EC2 instance and execute commands over SSH.</li></ul><p><strong>Trigger the Lambda function</strong>:</p><ul><li>You can manually invoke the Lambda function for testing purposes.</li><li>Set up a CloudWatch Events rule to trigger the Lambda function on a schedule (e.g., daily, weekly) to automate the nuke process.</li></ul><p><strong>Logging and Monitoring</strong>:</p><p>Set up CloudWatch Logs to capture logs from the Lambda function and EC2 instance to monitor the process and troubleshoot any issues.</p><p><strong>Understanding the code below</strong></p><blockquote><em>There are some variables that are global, you have to adjust the code according to your code. Those codes are parts of a lambda code which prepares aws-nuke file and downloads and runs it on EC2 machine. Also you might write your own </em><strong><em>STS</em></strong><em> policy and role statements whenever the root account tries to reach out sub-accounts on organizations or SSO via assuming role on AWS.</em></blockquote><p><strong>Check for more info</strong>: <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html</a></p><p><strong>Code to prepare aws-nuke configuration</strong> <strong>file</strong>.</p><pre>def aws_nuke_config_file(test_account_id):<br><br>    try:<br>  <br>     # Preapre file name<br>     filename = datetime.datetime.now().strftime(&quot;%Y-%m-%d&quot;) + &quot;-&quot; + test_account_id + &quot;.yml&quot;<br><br>     data = {<br>     &#39;regions&#39;: [&#39;global&#39; ,&#39;us-east-1&#39;],<br>     &#39;account-blacklist&#39;: [account_id, admin_account_id], # Management Account and Admin Account should be added to account block list<br>     &#39;accounts&#39;: {<br>        test_account_id: {}<br>      },<br>      &#39;presets&#39;: {<br>        &#39;sso&#39;: {<br>         &#39;filters&#39;: {<br>        &quot;IAMSAMLProvider&quot;: [<br>          {<br>            &quot;type&quot;: &quot;regex&quot;,<br>            &quot;value&quot;: &quot;AWSSSO_.*_DO_NOT_DELETE&quot;<br>          }<br>        ],<br>        &quot;IAMRole&quot;: [<br>          {<br>            &quot;type&quot;: &quot;glob&quot;,<br>            &quot;value&quot;: &quot;AWSReservedSSO_*&quot;<br>          }<br>        ],<br>        &quot;IAMRolePolicyAttachment&quot;: [<br>          {<br>            &quot;type&quot;: &quot;glob&quot;,<br>            &quot;value&quot;: &quot;AWSReservedSSO_*&quot;<br>          }<br>        ]}<br>        }<br>      },<br>     &quot;resource-types&quot;: {<br>      &quot;excludes&quot;: [<br>      &quot;IAMUser&quot;,<br>      &quot;IAMUserAccessKey&quot;,<br>      &quot;IAMGroup&quot;,<br>      &quot;IAMPolicy&quot;,<br>      &quot;IAMRole&quot;,<br>      &quot;IAMRolePolicy&quot;,<br>      &quot;IAMRolePolicyAttachment&quot;,<br>      &quot;IAMSAMLProvider&quot;,<br>      &quot;IAMLoginProfile&quot;,<br>      &quot;IAMUserPolicyAttachment&quot;,<br>      &quot;CloudTrailTrail&quot;,<br>      &quot;CloudWatchEventsRule&quot;,<br>      &quot;OpsWorksUserProfile&quot;,<br>      &quot;ConfigServiceConfigRule&quot;,<br>      &quot;CloudFormationStack&quot;,<br>      &quot;SSMParameter&quot;,<br>      &quot;SNSTopic&quot;<br>    ]}}<br>    <br>     # Load YAML file<br>     yaml_string = yaml.dump(data)<br><br>     S3_RESOURCE.Object(S3_BUCKET_NAME, filename).put(Body=yaml_string)<br><br>     url = S3_CLIENT.generate_presigned_url(https://medium.com/%3Cbr%3E%20%20%20%20%20%20%20%20ClientMethod=&#39;get_object&#39;,%3Cbr%3E%20%20%20%20%20%20%20%20Params={%3Cbr%3E%20%20%20%20%20%20%20%20%20%20%20%20&#39;Bucket&#39;:%20S3_BUCKET_NAME,%3Cbr%3E%20%20%20%20%20%20%20%20%20%20%20%20&#39;Key&#39;:%20filename%3Cbr%3E%20%20%20%20%20%20%20%20},%3Cbr%3E%20%20%20%20%20%20%20%20ExpiresIn=3600%20#%20The%20URL%20will%20expire%20in%201%20hour%3Cbr%3E)<br><br>     S3_CLIENT.put_object_acl(<br>        ACL=&quot;public-read&quot;, Bucket=S3_BUCKET_NAME, Key=filename<br>     )<br><br>     s3url = &quot;https://testaccountmanagement.s3.amazonaws.com/&quot; + filename<br><br>     response = dict()<br>     response[&#39;filename&#39;] = filename<br>     response[&#39;url&#39;] = s3url<br><br>     return response<br><br>     # return response<br>    except ClientError as e:<br>     print(&quot;Error aws_nuke_config_file of S3 &quot;, e)<br>     print(e)</pre><p><strong>Code to connect to EC2 and run terminal command to invoke aws-nuke</strong>.</p><pre>def delete_all_resources_aws_nuke(account_principal_id, test_account_id):<br><br>    print(&quot;Nuke Starting for &quot;, account_principal_id)<br><br>    text_account_profile_name = &quot;&quot;<br><br>    try:<br>     # Get the response of prepared and upload config file<br>     response = aws_nuke_config_file(test_account_id)<br><br>     # Download the current config file for aws nuke and run it on server<br>     shell_scipt = &quot;wget -P ./ &quot; + response[&quot;url&quot;] + &quot; &amp;&amp; aws-nuke -c &quot; + response[&quot;filename&quot;] + &quot; --no-dry-run --profile &quot; + text_account_profile_name + &quot; --force --force-sleep 3&quot;<br>     <br>     # Set up the SSH client<br>     ssh_client = paramiko.SSHClient()<br>     ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())<br><br>     private_key = io.StringIO(PRIVATE_KEY_FILE)<br>     pk = paramiko.RSAKey.from_private_key(private_key)<br><br>     # Connect to the EC2 instance<br>     result = ssh_client.connect(hostname=EC2_PUBLIC_IP, username=&#39;ubuntu&#39;, pkey=pk)<br><br>     # Execute aws-nuke command with config file on the EC2 instance<br>     stdin, stdout, stderr = ssh_client.exec_command(shell_scipt)<br><br>     # Print the output of the command<br>     for line in stdout.readlines():<br>         print(line.strip())<br><br>     # Close the SSH connection<br>     ssh_client.close()<br>     print(&quot;The account resources are deleted&quot;)<br>     return True<br><br>     # return response<br>    except paramiko.SSHException as e:<br>        print(&quot;errror : &quot;, e)</pre><p><strong>Resources</strong>:</p><ul><li><a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html">S3 - Boto3 1.38.33 documentation</a></li><li><a href="https://github.com/rebuy-de/aws-nuke">GitHub - rebuy-de/aws-nuke: Nuke a whole AWS account and delete all its resources.</a></li><li><a href="https://www.paramiko.org/">Paramiko</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a12b530c36f" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/aws-nuke-enabling-automated-deletion-of-aws-sso-account-resources-utilizing-aws-nuke-without-5a12b530c36f">AWS Nuke! Enabling automated deletion of AWS SSO account resources utilizing aws-nuke without…</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform configuration for GCP updates based on either a fixed number or a percentage.]]></title>
            <link>https://muratneciparcan.medium.com/terraform-configuration-for-gcp-updates-based-on-either-a-fixed-number-or-a-percentage-73c549fb71f5?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/73c549fb71f5</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[google-compute-engine]]></category>
            <category><![CDATA[rolling-updates]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 21:03:20 GMT</pubDate>
            <atom:updated>2023-07-24T21:03:20.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBEnGcNWYY6UlvktJ4lcdA.png" /></figure><p>Terraform to manage resources on <strong>Google Cloud Platform</strong> (<strong>GCP</strong>). It defines an instance group manager with a rolling update policy based on a maximum surge value.</p><pre>variable &quot;fixed_value&quot; {<br>  description = &quot;The value to use for fixed_value.&quot;<br>  type        = number<br>  default     = 4<br>}<br><br>variable &quot;max_surge_value&quot; {<br>  description = &quot;The value to use for max_surge. If use_fixed_max_surge is true, this is the fixed number; otherwise, it&#39;s the percentage.&quot;<br>  type        = number<br>  default     = 20<br>}<br><br>locals {<br>  total_instances = google_compute_instance_group_manager.your-source-label.target_size<br>  max_surge_instances = local.total_instances &gt; 10 ? ceil(local.total_instances * (var.max_surge_value / 100)) : var.fixed_value<br>  updated_instance_count = local.total_instances + local.max_surge_instances<br>}<br><br>resource &quot;google_compute_instance_group_manager&quot; &quot;your-source-label&quot; {<br>  name               = &quot;my-instance-group&quot;<br>  zone               = &quot;us-central1-a&quot;<br>  base_instance_name = &quot;my-instance&quot;<br>  target_size        = 3<br><br>  version {<br>    instance_template = google_compute_instance_template.my_template.self_link<br>  }<br><br>  update_policy {<br>    type     = &quot;ROLLING_UPDATE&quot;<br>    max_surge_fixed = local.total_instances &gt; 10 ? null : local.max_surge_instances<br>    max_surge_percent = local.total_instances &gt; 10 ? &quot;${var.max_surge_instances}%&quot; : null<br>  }<br>}<br><br>resource &quot;google_compute_instance_template&quot; &quot;my_template&quot; {<br>  // ... your instance template configuration ...<br>}</pre><p><strong>Variables</strong>: The code defines two variables, “fixed_value” and “max_surge_value,” both of type number, with default values of 20. These variables allow customization of the instance group manager’s behavior.</p><p><strong>Locals</strong>: The code then declares a “locals” block to calculate some intermediate values. It calculates the total number of instances from the target_size attribute of the instance group manager, and it computes the “max_surge_instances” based on the value of “max_surge_value” and “fixed_value.” If the total instances are greater than 10, “max_surge_instances” will be a percentage (max_surge_value is a percentage of total_instances), otherwise, it will be the fixed value.</p><p><strong>Instance Group Manager</strong>: The resource “google_compute_instance_group_manager” defines the instance group manager configuration. It specifies the name, zone, and base instance name. The “target_size” is set to 3, but this can be changed based on requirements.</p><p><strong>Instance Template</strong>: The code refers to an instance template resource “google_compute_instance_template” named “my_template,” which is expected to be defined elsewhere in the configuration. The details of this resource are not provided in the snippet, but it should include the configuration for the virtual machine instances to be created.</p><p><strong>Update Policy</strong>: The instance group manager has a “ROLLING_UPDATE” policy. The “max_surge” attribute is set based on the value of “local.total_instances.” If the total instances are greater than 10, the “max_surge” will be “local.max_surge_instances + %,” indicating a percentage of the total instances that can surge during the update process. Otherwise, “max_surge” will be “local.max_surge_instances,” indicating a fixed number of instances that can surge during the update.</p><p>Overall, this <strong>Terraform</strong> configuration creates an instance group manager with a rolling update policy that allows for a surge in instances during updates based on either a fixed number or a percentage of the total instances. The instance template, not shown in the provided code, should contain the configuration details for the virtual machine instances created within the instance group.</p><p><strong>Resources</strong> :</p><p><strong>Automatically apply VM configuration updates in a MIG</strong></p><p><a href="https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#using_a_fixed_number_or_a_percentage_in_update_requests">https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#using_a_fixed_number_or_a_percentage_in_update_requests</a></p><p><strong>Terraform</strong> <strong>Google Compute Engine Instance Group Manager API</strong></p><p><a href="https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance_group_manager">https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance_group_manager</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73c549fb71f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calculating Neutron Flux Using Parallel Programming in C with OpenMP and Monte Carlo Neutron…]]></title>
            <link>https://muratneciparcan.medium.com/calculating-neutron-flux-using-parallel-programming-in-c-with-openmp-and-monte-carlo-neutron-89f828aefae5?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/89f828aefae5</guid>
            <category><![CDATA[monte-carlo-method]]></category>
            <category><![CDATA[neutron-transport]]></category>
            <category><![CDATA[neutron-flux]]></category>
            <category><![CDATA[monte-carlo-simulation]]></category>
            <category><![CDATA[parallel-programming-in-c]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Mon, 24 Jul 2023 18:37:42 GMT</pubDate>
            <atom:updated>2023-07-24T18:37:42.306Z</atom:updated>
            <content:encoded><![CDATA[<h3>Calculating Neutron Flux Using Parallel Programming in C with OpenMP and Monte Carlo Neutron Transport</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*09Ye0Nb-3yltzjcU5SOoYA.png" /></figure><p>The Monte Carlo Neutron Transport problem involves simulating the behavior of neutrons as they interact and move through a material or a system. Neutrons are subatomic particles that play a crucial role in nuclear reactions and various applications, such as nuclear energy, nuclear weapons, and medical imaging. In this problem, the objective is to model the movement of neutrons in a specific environment and study their interactions with the materials present. Neutrons can scatter, be absorbed, or undergo fission as they travel through the medium, making their behavior complex and challenging to predict analytically.</p><p>Overall, the Monte Carlo Neutron Transport problem allows us to understand and optimize the behavior of neutrons in diverse scenarios, aiding in the design and safety assessment of nuclear systems and technologies.</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;time.h&gt;<br>#include &lt;omp.h&gt;<br><br>#define NUM_PARTICLES 1000000<br>#define NUM_THREADS_LIST {1, 2, 4, 8, 16}<br><br>// Function to perform neutron transport simulation<br>double monteCarloNeutronTransport(int num_particles) {<br>    int i, num_collisions = 0;<br>    double neutron_flux = 0.0;<br><br>    // Set seed for random number generator<br>    unsigned int seed = (unsigned)time(NULL) + omp_get_thread_num();<br><br>    // Monte Carlo simulation loop<br>    for (i = 0; i &lt; num_particles; i++) {<br>        double position = 0.0; // Neutron&#39;s initial position<br><br>        // Particle movement loop<br>        while (position &gt;= 0.0 &amp;&amp; position &lt;= 1.0) {<br>            double random_num = (double)rand_r(&amp;seed) / RAND_MAX; // Generate a random number between 0 and 1<br><br>            // Probability of collision = 0.5<br>            if (random_num &lt; 0.5) {<br>                num_collisions++;<br>                break;<br>            }<br><br>            // Move neutron randomly to the left or right<br>            if (random_num &lt; 0.75) {<br>                position -= 0.1; // Move left<br>            } else {<br>                position += 0.1; // Move right<br>            }<br>        }<br>    }<br><br>    // Calculate neutron flux<br>    neutron_flux = (double)num_collisions / num_particles;<br>    return neutron_flux;<br>}<br><br>int main() {<br>    double neutron_flux_total = 0.0;<br>    int i;<br><br>    // Define an array of thread counts to test<br>    int num_threads_list[] = NUM_THREADS_LIST;<br>    int num_threads_list_size = sizeof(num_threads_list) / sizeof(num_threads_list[0]);<br><br>    // Perform the simulation with a single thread for serial execution<br>    omp_set_num_threads(1);<br>    double start_time_serial = omp_get_wtime();<br>    double neutron_flux_serial = monteCarloNeutronTransport(NUM_PARTICLES);<br>    double end_time_serial = omp_get_wtime();<br>    double execution_time_serial = end_time_serial - start_time_serial;<br><br>    printf(&quot;Serial Execution Time: %lf seconds\n&quot;, execution_time_serial);<br><br>    double average_neutron_flux = 0.00;<br>    // Perform the simulation for different thread counts (excluding the first entry since it corresponds to serial execution)<br>    for (i = 1; i &lt; num_threads_list_size; i++) {<br>        int num_threads = num_threads_list[i];<br><br>        // Set the number of threads for OpenMP<br>        omp_set_num_threads(num_threads);<br><br>        // Record the starting time<br>        double start_time = omp_get_wtime();<br><br>        // Perform the simulation using OpenMP parallel for loop<br>        #pragma omp parallel for reduction(+:neutron_flux_total)<br>        for (int j = 0; j &lt; num_threads; j++) {<br>            double neutron_flux_thread = monteCarloNeutronTransport(NUM_PARTICLES / num_threads);<br>            neutron_flux_total += neutron_flux_thread;<br>        }<br><br>        // Calculate the average neutron flux over all threads<br>        average_neutron_flux = neutron_flux_total / num_threads;<br><br>        // Record the ending time<br>        double end_time = omp_get_wtime();<br><br>        // Calculate the execution time<br>        double execution_time = end_time - start_time;<br><br>        // Calculate the speedup relative to the serial execution<br>        double speedup = execution_time_serial / execution_time;<br>        <br>        printf(&quot;Threads: %d, Execution Time: %lf seconds, Speedup: %lf, Average Neutron Flux: %lf\n&quot;,<br>               num_threads, execution_time, speedup, average_neutron_flux);<br><br>    }<br><br>    return 0;<br>}</pre><p>The purpose of the code is to run the neutron transport simulation in parallel and measure the processing time and acceleration for different thread counts. This illustrates an example of evaluating the performance of the simulation and understanding the benefits of parallel computing.</p><p><strong>Resources</strong>:</p><p><strong>OpenMP official website</strong>: <a href="https://www.openmp.org/">https://www.openmp.org</a></p><p><strong>Books</strong></p><p><strong>Monte Carlo Neutron Transport: Concepts, Codes, and Applications</strong></p><p>This book provides a comprehensive overview of Monte Carlo methods for neutron transport simulations and their applications. It covers the theoretical foundations as well as practical implementation details.</p><p><strong>Parallel Programming in C with OpenMP by Michael J. Quinn</strong></p><p>This book focuses on parallel programming techniques using OpenMP in C. It covers various parallelization concepts and strategies to optimize code for multi-core architectures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89f828aefae5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firestore üzerinde Twitter ve Instagram benzeri haber kaynağı mimarisi.]]></title>
            <link>https://muratneciparcan.medium.com/firestore-%C3%BCzerinde-twitter-ve-instagram-benzeri-haber-kayna%C4%9F%C4%B1-mimarisi-9457ee5744a?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9457ee5744a</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[newsfeed]]></category>
            <category><![CDATA[firestore-newsfeed]]></category>
            <category><![CDATA[datastrucutre]]></category>
            <category><![CDATA[firestore]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Sun, 26 Sep 2021 19:50:19 GMT</pubDate>
            <atom:updated>2021-09-26T19:50:19.491Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*YEAF_A9BYUamwaB0qx-I5Q.jpeg" /></figure><p>Hali hazırda kullanıcı dökümanınızın olduğunu ve bazı yapıları hazırlamış olduğunuzu varsayıyorum.</p><p>Her kullanıcı dökümanınıza ‘recentPosts’ adlı bir dizi ekleyin,</p><p>Firebase cloud functions üzerinde onWrite fonksiyonunu kullanarak, sistem üzerinde herhangi bir kullanıcı post eklediğinde OnWrite fonksiyonu ile yakalıyoruz ve kullanıcının recentPosts arrayi’ni güncelliyoruz.</p><p>Maliyet ve zaman açısından en ideal yol,</p><p>{</p><p>“postId”: xxxxxxxxxxx,</p><p>“createdAt”: tttttt</p><p>}</p><p>LastPosts dizisini 1.000 nesneyle sınırlayın bu sayede limiti aşarken en eski postları ve girişleri siler.</p><p>Şimdi, 1.000 kullanıcıyı takip ettiğinizi ve haber kaynağını sorgu ile getirmek istediğinizi varsayalım, 1.000 kullanıcı belgesinin tümünü sorgulayın (bunu 100 sorguda yapabilmeniz için “in-query” kullanmanızı öneririm). Bu bin okuma olarak sayılacaktır.</p><p>1000 belgeye sahip olduğunuzda, her belgede bir dizi recentPosts dizisi olacaktır. Tüm dizileri tek bir ana dizide birleştirin ve createAt’a göre sıralayın.</p><p>Artık, yalnızca 1.000 okuma için tümü kronolojik olarak sıralanmış, potansiyel olarak 1 milyona kadar gönderinin docID’sine sahipsiniz. Artık kullanıcınız haber kaynağını kaydırırken, bu belgeleri docID’lerini referans olarak sıralar.</p><p>Şimdi X kadar postu Y takipçilerinden getirebilirsiniz ve veritabanı işlem sayısı X + Y kadar olacaktır.</p><p>Yani 100 takip edilenden 2.000 gönderi 2,100 okuma yapar.</p><p>Ve 1000 takip edilenden 1000 gönderi 2000 okuma yapar.</p><p>Daha fazla tasarruf mu etmek istiyorsunuz ?</p><p>O zaman, lastPostsLastUpdatedAt gibi bir alana göre filtreleyebilir ve bunun o kullanıcı dokümanı için önbelleğe alınmış değerinizden daha büyük olup olmadığını kontrol edebilirsiniz, bu sayede recentPosts dizisini güncellememiş olan herhangi bir kullanıcı dokümanı okunmayacaktır. Bu, temel okumalarda teorik olarak 10 kat tasarruf etmenizi sağlayabilir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9457ee5744a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The forgotten game cd in wall street computer’s cd rom.]]></title>
            <link>https://muratneciparcan.medium.com/the-forgotten-game-cd-in-wall-street-computers-cd-rom-3a52dae8f7f2?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a52dae8f7f2</guid>
            <category><![CDATA[wall-street-bets]]></category>
            <category><![CDATA[reddit]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Fri, 05 Feb 2021 19:15:59 GMT</pubDate>
            <atom:updated>2021-02-05T19:26:54.643Z</atom:updated>
            <content:encoded><![CDATA[<h3>The forgotten game cd in wall street’s computer cd rom.</h3><p>For the first time in history, a social market movement based on a digital community has been observed in the face of capital-based market movements. This event is as important as Karl Max’s first breakout in the industrial age, or as important as the trade union movements in chicago of the early twentieth century, we need to understand from this that Redditors busted the wall street bankers in their place, and they kneeled them down by applying their own rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zZDMm-XKebzu4Teg-JXoiw.jpeg" /></figure><p><a href="https://edition.cnn.com/2021/01/29/investing/wallstreetbets-reddit-culture/index.html">https://edition.cnn.com/2021/01/29/investing/wallstreetbets-reddit-culture/index.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a52dae8f7f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The LEGENDS]]></title>
            <link>https://muratneciparcan.medium.com/nine-years-ago-we-lost-one-of-the-greatest-minds-of-our-time-who-shaped-the-history-of-computing-412d1c841233?source=rss-119106f46e4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/412d1c841233</guid>
            <category><![CDATA[c-language]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[dennis-ritchie]]></category>
            <dc:creator><![CDATA[Murat Necip Arcan]]></dc:creator>
            <pubDate>Sun, 16 Feb 2020 04:41:50 GMT</pubDate>
            <atom:updated>2020-02-25T03:45:46.223Z</atom:updated>
            <content:encoded><![CDATA[<p>I wanted to give spotlight to Dennis Ritchie in my first entry,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*8633W-XM97vTYA8Ga3EZMw.jpeg" /></figure><p>Nine years ago, we lost one of the greatest minds of our time who shaped the history of computing. Dennis Ritchie was the best known for creating the C programming language and Unix along with long-time colleague Ken Thompson. While Steve Jobs got lots of credit, almost everyone, especially the media, forgot about dmr. Don’t get me wrong Steve Jobs did some good things, but we should always remember that we are standing on the shoulders of giants.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=412d1c841233" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>