<?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 Purnaresa Y on Medium]]></title>
        <description><![CDATA[Stories by Purnaresa Y on Medium]]></description>
        <link>https://medium.com/@purnaresa?source=rss-581bea2d858f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dJuf7Gx1kpS5HZKjklM8uQ.jpeg</url>
            <title>Stories by Purnaresa Y on Medium</title>
            <link>https://medium.com/@purnaresa?source=rss-581bea2d858f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:41:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@purnaresa/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[IT Risk Management 101 for Startup Founders]]></title>
            <link>https://medium.com/@purnaresa/it-risk-management-101-for-startup-founders-7851406c133d?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7851406c133d</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[compliance]]></category>
            <category><![CDATA[growth-strategy]]></category>
            <category><![CDATA[it-risk-management]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Sun, 15 Aug 2021 05:53:46 GMT</pubDate>
            <atom:updated>2021-08-15T05:53:46.878Z</atom:updated>
            <content:encoded><![CDATA[<h4>Risk management sounds like activity in an enterprise environment. That’s not wrong. That’s why enterprises are able to scale their business globally and operate in the very long term. If you are a startup founder, this article will help you to succeed in growing your startup. Better tools and technology nowadays allow small businesses to do risk mitigation early with low investment costs.</h4><h3>Why your startup needs IT Risk Management</h3><p>Competition, cost issues, loss of focus, and legal challenges are among the top 20 reasons startups fail [1]. Those four items are closely related to IT Risk Management. IT Risk Management is an activity to identify the threat and vulnerability of a system or process to lower the risk by implementing proper mitigation. This activity help startup prepares an event like service downtime, therefore, they will able to compete with a more established company. When we do IT Risk Management early, we can have clear visibility of what is the risk in order by risk scoring. That priority will help startup fonder to keep them away from losing focus. Proper IT Risk Management will help forecast the cost of unwelcomed legal challenge events. Combining all the benefits mentioned, this activity will prevent costly issues in the startup runway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*DssmA5QhehGX87ce-b7mDQ.png" /><figcaption>Venturing into the startup world without covering risk is like walking in a minefield. The risk is there whatever the startup founder is ready or not. <a href="https://www.armscontrol.org/act/2015-10/news-briefs/mozambique-declared-free-landmines">Photo credit</a>.</figcaption></figure><h3>Inviting failure!</h3><p>It’s easy to understand the benefit of IT Risk Management. But in reality startup founders always have too many agenda in their hand scraping all the things need to be done [2]. The angle that makes sense would be to realize what could go wrong with their business if they do not spend a portion of their attention on IT Risk Management early. IT Risk Management is the same in concept with Business Risk Management. But if the startup is in the technology space that relies on IT, the importance is significant. Following are an example of a successful startup that failed to do IT Risk Management early;</p><p>· Uber fines for $148 Millions over a data breach in 2016 [3]</p><p>· Slack went down globally due to a scaling issue on the first working day of 2021 [4]</p><p>· Indonesia’ fintech Cermati data breach leak user salary in 2020 [5]</p><p>· MolaTV downtime during Euro 2020 tournament in 2021 [6]</p><p>In reality, there are much more unpublished failures are related to uncontrolled risk. The evidence above shows that IT Risk Management is currency to startup success.</p><h3>When is the right time?</h3><p>If potential benefit and loss of IT Risk Management are realized by founders. The next question is when should they started it. The anecdote is that activity only makes sense for the big company due to the cost associated [7]. That’s statement is not wrong, there is no zero-cost risk management. But startups nowadays have the luxury to adopt new technology and try various service providers easily. Compare to the big enterprise which will take more effort to plan and implement when trying new technology.</p><p>Following are technology and service that are available for startups:</p><ul><li>For infrastructure, AWS Well-Architected Tool helps startups to manage operations and security [8]. These tools significantly improve IT Risk Management implementation.</li><li>For productivity, Office 365 and Gsuite have tools to support Risk, Security, and Trust Management [9] [10].</li><li>For communication, Slack has tools to do data protection and risk management [11].</li></ul><p>Not limited to the list above, most of the service provider is concern about IT risk, security, and data protection. It’s expected to have the feature built in to manage IT risk. Based on that, the cost is no longer a major obstacle to do IT Risk Management. The major investment now is the effort to do it.</p><p>In the software development landscape, preventing bugs from occurring in production called Shift Left development is the effort-effective approach [12]. The idea is to put effort and time as early as possible when the scope of work is small and changes will impact a small radius. This approach will require testing effort in the early development to prevent bugs, saving potential major effort to fix the bug in the production. The Shift Left model can also be adopted in IT Risk Management to save the effort required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*WYbqNeTLeKcjVlxW_U8Kfw.png" /><figcaption>Picture 2 Start managing IT risk early to save mitigation effort</figcaption></figure><p>The picture above illustrates that as a startup growing, the IT Risk Management implementation will require more effort. Take an example; an early startup with 10 employees wants to mitigate the data loss risk. They enroll the required policy in their productivity software, monitor the effectiveness, run the training. It will take 1 day or less. Compare to a mature startup with 200 employees, the implementation will be more complex. A simple change policy of email attachment maximum file limit may disrupt business operations if not tested properly and communicated to all employees.</p><h3>How to start IT Risk Management</h3><p>When startup founders incline to do IT Risk Management early, the question now is how to do it. Most founders need to stay focus on business growth. They cannot full-time focusing on the IT risk framework nor hire risk management employees in the early stage of the startup. That situation makes sense because full management framework like ISO27001 and NIST SP800 is big. Instead, focusing on the core principle of Risk Management will bring the return of investment faster. Following are the essence of IT Risk Management [13]</p><h3>Identification</h3><p>Identification is a process to collect information of all entities in the business (ie; server, employee, data, and application). The goal is to list all the threats to the whole startup. A threat itself by definition is a potential event that impacts the system or process, therefore we must list down all the possibilities [14]. The process is better to be executed in a group to have a 360-view of the business. An example of identification result can be as simple as following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*ZJYngOYKkO5JrY8U9gSvPQ.png" /><figcaption>Table 1 Simple risk identification table</figcaption></figure><p>The list can be long or short depending on the stage of the startup and the founder’s observation. The goal is not to create the longest list, but the goal is to get started. Write down all risks identified and move on. We can always go back to add more items later.</p><h3>Quantification</h3><p>Quantification is the process to measure the impact of the risk. Measurement may be valid or not valid based on the observations. If the founder measurement is not valid it is fine. The most important is to let all the stakeholders agree on the measurement so the risk mitigation can be implemented later on. When all the stakeholders agree on the measurement, the process to regularly review the risk must be implemented (ie; every 6 months).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*olQR8MUXZPIPCauojYcxYA.png" /><figcaption>Table 2 Quantification of identified risk</figcaption></figure><p>Above are an example of a quantification report. The impact can be measured in number to ease the process.</p><h3>Analysis</h3><p>The analysis is a process to understand more what variable may trigger the event. When the variable is defined, next is to forecast the likelihood of the variable occur. When the likelihood is defined, we can use the following formula [15]</p><p><em>Risk = impact x likelihood</em></p><p>An example of an analysis process is following;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5YtXFEHyyo33JWE3NfKbUg.png" /><figcaption>Table 3 Simple risk analysis example</figcaption></figure><h3>Response</h3><p>When all stakeholders are agreed on the analysis report, the last step is to create a response based on the analysis. The response itself may not able to implement right away due to budget or manpower, so the minimum we need is the mitigation plan. When the plan is implemented, we will update the risk table. Example below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwKreeDpTw-QVoRV7za1UA.png" /><figcaption>Table 4 Response to risk</figcaption></figure><h3>What’s next</h3><p>After the essence of IT Risk Management is implemented, create a regular schedule to review the plan. Ideally, every 6-month document must be updated. When the startup grows to the scale that the founder cannot pay attention to IT Risk Management, it’s an indicator to open a role for risk management in the company.</p><p>The key takeaway of this is to start risk management as early as possible with all available tools provided. Use the simple process to kick start the risk management. Update the plan to a more comprehensive framework like ISO or NIST when the company is growing big and preparing for IPO.</p><h3>Reference</h3><p>[1] CB Information Services, Inc., “The Top 20 Reasons Startups Fail,” 6 November 2019. [Online]. Available: <a href="https://www.cbinsights.com/research/startup-failure-reasons-top/">https://www.cbinsights.com/research/startup-failure-reasons-top/.</a> [Accessed 27 June 2021].</p><p>[2] M. Goldsholl, “The Art Of Scrappy: What Large Organizations Can Learn From Startups,” 27 July 2017. [Online]. Available: <a href="https://www.forbes.com/sites/forbeshumanresourcescouncil/2017/07/27/the-art-ofscrappy-what-large-organizations-can-learn-from-startups/?sh=8cd5b7570345.">https://www.forbes.com/sites/forbeshumanresourcescouncil/2017/07/27/the-art-ofscrappy-what-large-organizations-can-learn-from-startups/?sh=8cd5b7570345.</a> [Accessed 27 June 2021].</p><p>[3] NEW YORK STATE ATTORNEY GENERAL, “A.G. Underwood Announces Record $148 Million Settlement With Uber Over 2016 Data Breach,” 26 September 2018. [Online]. Available: <a href="https://ag.ny.gov/pressrelease/2018/ag-underwood-announces-record-148-million-settlement-uber-over-2016-data-breach.">https://ag.ny.gov/pressrelease/2018/ag-underwood-announces-record-148-million-settlement-uber-over-2016-data-breach.</a> [Accessed 27 June 2021].</p><p>[4] L. Nolan, “Slack’s Outage on January 4th 2021,” 4 January 2021. [Online]. Available: <a href="https://slack.engineering/slacks-outage-on-january-4th-2021/">https://slack.engineering/slacks-outage-on-january-4th-2021/.</a> [Accessed 27 June 2021].</p><p>[5] E. A. Eloksari, “Fintech Cermati data breach points to urgency for data protection law: Expe rts,” 5 November 2020. [Online]. Available: <a href="https://www.thejakartapost.com/news/2020/11/05/fintech-cermati-data-breachpoints-to-urgency-for-data-protection-law-experts.html.">https://www.thejakartapost.com/news/2020/11/05/fintech-cermati-data-breachpoints-to-urgency-for-data-protection-law-experts.html.</a> [Accessed 27 June 2021].</p><p>[6] R. Negoro, “Euro 2020, Inggris dan Downtime,” 15 June 2021. [Online]. Available: <a href="https://www.robee.id/euro-2021-inggris-dan-downtime/">https://www.robee.id/euro-2021-inggris-dan-downtime/</a> [Accessed 27 June 2021].</p><p>[7] D. Hillson, “The cost of managing risk,” 23 February 2016. [Online]. Available: <a href="https://www.projectmanagement.com/blog/blogPostingView.cfm?blogPostingID=18929&amp;thisPageURL=/blogpost/18929/The-cost-of-managing-risk#_=_.">https://www.projectmanagement.com/blog/blogPostingView.cfm?blogPostingID=18929&amp;thisPageURL=/blogpost/18929/The-cost-of-managing-risk#_=_.</a> [Accessed 27 June 2021].</p><p>[8] Amazon Web Services, Inc., “AWS Well-Architected,” [Online]. Available: <a href="https://aws.amazon.com/architecture/well-architected.">https://aws.amazon.com/architecture/well-architected.</a> [Accessed 27 June 2021].</p><p>[9] Microsoft, “Microsoft 365 Insider Risk Management,” [Online]. Available: <a href="https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWCPQo.">https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWCPQo.</a> [Accessed 27 June 2021].</p><p>[10] Google, “G Suite Security and Trust,” [Online]. Available: <a href="https://static.googleusercontent.com/media/gsuite.google.com/en//security/g-suite-security-ebook.pdf.">https://static.googleusercontent.com/media/gsuite.google.com/en//security/g-suite-security-ebook.pdf.</a> [Accessed 27 June 2021].</p><p>[11] Slack Technologies, Inc., “Enterprise-grade data protection,” [Online]. Available: <a href="https://slack.com/intl/enid/trust/security.">https://slack.com/intl/enid/trust/security.</a> [Accessed 27 June 2021].</p><p>[12] K. Magowan, “Shift Left Testing: What, Why &amp; How To Shift Left,” 30 November 2020. [Online]. Available: <a href="https://www.bmc.com/blogs/what-is-shift-left-shift-left-testing-explained/">https://www.bmc.com/blogs/what-is-shift-left-shift-left-testing-explained/.</a> [Accessed 27 June 2021].</p><p>[13] PMTips.net, “A High-Level Overview of Risk Management,” 7 December 2010. [Online]. Available: <a href="https://pmtips.net/article/highlevel-overview-risk-management.">https://pmtips.net/article/highlevel-overview-risk-management.</a> [Accessed 27 June 2021].</p><p>[14] National Institute of Standards and Technology, “COMPUTER SECURITY RESOURCE CENTER: Threat,” [Online].Available: <a href="https://csrc.nist.gov/glossary/term/threat.">https://csrc.nist.gov/glossary/term/threat.</a> [Accessed 27 June 2021].</p><p>[15] C. C. C. C. C. Jaewon Lee, “An Enhanced Risk Formula for Software Security Vulnerabilities,” 1 July 2014. [Online]. Available: <a href="https://www.isaca.org/resources/isaca-journal/past-issues/2014/an-enhanced-riskformula-for-software-security-vulnerabilities.">https://www.isaca.org/resources/isaca-journal/past-issues/2014/an-enhanced-riskformula-for-software-security-vulnerabilities.</a> [Accessed 27 June 2021</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7851406c133d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Startup Founder Should Know IT Audit]]></title>
            <link>https://medium.com/swlh/why-startup-founder-should-know-it-audit-2b3f02225b06?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b3f02225b06</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[growth-strategy]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[compliance]]></category>
            <category><![CDATA[it-audit-and-compliance]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Sun, 15 Aug 2021 05:37:07 GMT</pubDate>
            <atom:updated>2021-08-15T05:37:07.786Z</atom:updated>
            <content:encoded><![CDATA[<h4>Run out of cash, out of the competition and legal issue is among top startup failure reason [1]. IT Audit is a process to assist founders to prepare for that area. While a full-fledged audit framework is too much for a startup, newer technology can help implement the core of IT audit with much less effort.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ncgTeYmUqVbfQ2AnjHE7g.jpeg" /><figcaption>IT Audit can be a casual conversation. Photo by <a href="https://unsplash.com/@dylandgillis?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Dylan Gillis</a> on <a href="https://unsplash.com/s/photos/collaboration?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>What Is IT Audit</h3><p>In a startup fast-paced culture, we can simplify an IT Audit is a process to evaluate your IT environment to make sure it is operated as intended and following the industry’s best practice. In detail, an IT audit is an examination of the management controls within an IT infrastructure and business applications. The evaluation of evidence obtained determines if the information systems are safeguarding assets, maintaining data integrity, and operating effectively to achieve the organization’s goals or objectives [2]. If not done effectively, the process will be long and complex</p><p>The core benefit of IT Audit is to improve internal system design and effectiveness. The area of improvement is including development, operation, and security. Pragmatically, it’s easy to understand what is the benefit of IT Audit. The problem is usually in the prioritization of founder resources. Delay an IT Audit in a later stage is commonly observed in startup culture. But it will only make the process more complex later on to remediate the technical debts. Making IT Audit part of the startup culture is more beneficial to avoid technical debts and preparing company growth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*wqDQhyyglMyDeDlx4q4f6w.png" /><figcaption>Figure 1 Why IT audit good for startup</figcaption></figure><h3>What Will Happen Without IT Audit</h3><h3>Unnecessary spending leaks</h3><p>With the proper IT Audit, we can observe all assets in the company. From there, assets can be identified which one is not optimized. The operational activities also can be observed in IT Audit. Inefficient operational can be replaced with automation. And more importantly, is outdated technology can be identified early. Newer computing technology offers a better cost-performance ratio [3]. This entire process will help startups to have a cost-optimized mindset from the beginning of the startup journey.</p><h3>System failure risk</h3><p>Management complexity is a common reason for system failure or downtime [4]. Managing 2 servers in early product development might be easy. But managing a hundred or thousand servers is a difficult task if not prepared accordingly. IT audit process will help to scale preparation. The output of the IT audit will indicate how many assets companies have and how they manage them. From there, we can evaluate best industry best practices to get recommendations on how to manage them properly [5]. This way, system failure can be avoided as early as possible.</p><h3>Investors move away</h3><p>Currently, startup thousand startups are created every month around the world. There is a finite number of startups that receive investment. And founder that hasn’t receive investment previously will have more difficulty getting one [6]. In the situation where two startups are competing for investment, both have a great business idea and decent takeoff. But one of them has a proper technical scaling plan by IT Audit process. Investors surely will tend to invest in a startup that already does the due diligence internally to prepare for future growth.</p><h3>Cybersecurity attack</h3><p>Developing an application for solving a problem is not easy. Managing production operations is harder. But protecting the operation from cyberattacks is the hardest one for startups [7]. Mainly because startups do not have the resource and knowledge to do security hardening. To build security posture, an IT Audit is the right step to do. The output of IT Audit is a recommendation of the existing operation compare to best practices in the industry [5]. Meaning a company can start protecting from a cybersecurity attack.</p><h3>How To Do IT Audit</h3><p>COBIT and ISO are prime examples of IT Audit frameworks [8], [9]. It is widely used globally by the enterprise. The framework explore every area of the enterprise environment. That approach is too much for a startup. Startups do not have a dedicated team to do Audits nor the time to follow every step in the framework. With the availability of automated auditing tools, the startup can do the core process of IT audit without sacrificing valuable time and resources [10].</p><h3>List every system in the environment</h3><p>Start with writing down every system used in the company. Most companies at least have an email system for communication internally and a cloud provider to run their workload. Add more systems as the company moving forward. Create the list as a living document that can be updated in the future. The idea of this step is to ensure the company knows where most of its data is operated. In this step, some assets maybe not be identified because the asset is a self-managed asset that needs to be maintained manually. That’s why a self-managed asset from an IaaS provider is not the best choice if the SaaS counterpart is available. Using more SaaS will lessen the operational effort of a startup [11].</p><h3>Configure audit feature on the system</h3><p>The most modern system already has a built-in audit feature. It’s a standard feature for business SaaS. Amazon Web Service has AWS CloudTrail and AWS Config to ensure all the access and assets are monitored and following the compliance standard [12]. Office 365 have all required feature to manage identity, email, and document within the company [13]. Follow each system documentation to configure the auditing feature.</p><p>It’s rare to see a business SaaS that does not have this type of functionality. If the system that the company uses does not have this functionality, it’s recommended to move away from that system because in the future governing and auditing activity in that system will be a major issue.</p><h3>Evaluate audit report</h3><p>Once configuring the audit feature in the system, review the report. Three activities need to be done on each finding; remediation, prevention, and monitoring. Remediation is an activity to fix the finding based on compliance or best practice. Prevention is the activity to create a rule/condition that prevents non-compliant action to be executed. This is the recommended first action to ensure the finding does not appear again. Most systems have this rule checking functionality available, users have to enable which rule is relevant to their company. Monitoring is activity to monitor every activity in the system. This is a very important activity where preventing non-compliant action is possible.</p><p>To remediate a finding, there are two approaches; automated and manual. Some findings can be remediated automatically [14]. It depends on system capability and finding complexity. Wherever automatic remediation is available, use it, else remediate manually.</p><h3>Conclusion</h3><p>IT Audit for a startup is the right to do to prepare for company growth. Delaying auditing to a later stage will only add more technical debt along the journey. The effort to do IT audits nowadays is reduced significantly due to audit feature availability in most modern SaaS. On top of that, automated remediation is also possible in some cases. Following is the flowchart to visualize the IT audit for a startup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*oZjzIEtIwUILQryKS7oCLw.png" /><figcaption>Figure 2 IT audit flowchart for startups</figcaption></figure><h3>Reference</h3><p>[1] CBI Insight, “The Top 20 reasons Startups fail,” <em>CB Insights</em>, vol. 1, 2020.</p><p>[2] B. R. Aditya, R. Hartanto, and L. E. Nugroho, “The Role of IT Audit in the Era of Digital Transformation,” <em>IOP Conf. Ser. Mater. Sci. Eng.</em>, vol. 407, no. 1, p. 012164, Aug. 2018, doi: 10.1088/1757–899X/407/1/012164.</p><p>[3] Q. Jiang, Y. C. Lee, and A. Y. Zomaya, “The Power of ARM64 in Public Clouds,” <em>Proc. — 20th IEEE/ACM Int. Symp. Clust. Cloud Internet Comput. CCGRID 2020</em>, pp. 459–468, May 2020, doi: 10.1109/CCGRID49817.2020.00–47.</p><p>[4] A. Basiri <em>et al.</em>, “Chaos Engineering,” <em>IEEE Softw.</em>, vol. 33, no. 3, 2016, doi: 10.1109/MS.2016.60.</p><p>[5] Amazon Web Services, “AWS Security Best Practices,” <em>AWS Cloud Comput. Whitepapers</em>, no. August, 2016.</p><p>[6] S. Xu, Q. Zhang, L. Lü, and M. S. Mariani, “Recommending investors for new startups by integrating network diffusion and investors’ domain preference,” <em>Inf. Sci. (Ny).</em>, vol. 515, 2020, doi: 10.1016/j.ins.2019.11.045.</p><p>[7] R. Kalaiprasath, R. Elankavi, and R. Udayakumar, “Cloud security and compliance — A semantic approach in end to end security,” <em>Int. J. Smart Sens. Intell. Syst.</em>, vol. 2017, no. Specialissue, 2017, doi: 10.21307/ijssis-2017–265.</p><p>[8] A. Mutiara, Prihandoko, E. Prasetyo, and C. Widya, “Analyzing cobit 5 it audit framework implementation using ahp methodology,” <em>Int. J. Informatics Vis.</em>, vol. 1, no. 2, 2017, doi: 10.30630/joiv.1.2.18.</p><p>[9] A. Purba and M. Soetomo, “Assessing Privileged Access Management (PAM) using ISO 27001:2013 Control,” <em>ACMIT Proc.</em>, vol. 5, no. 1, 2019, doi: 10.33555/acmit.v5i1.76.</p><p>[10] P. Goodman and A. Dinaburg, “The Past, Present, and Future of Cyberdyne,” <em>IEEE Secur. Priv.</em>, vol. 16, no. 2, 2018, doi: 10.1109/MSP.2018.1870859.</p><p>[11] F. Doelitzscher, A. Sulistio, C. Reich, H. Kuijs, and D. Wolf, “Private cloud for collaboration and e-Learning services: From IaaS to SaaS,” <em>Comput. (Vienna/New York)</em>, vol. 91, no. 1, 2011, doi: 10.1007/s00607–010–0106-z.</p><p>[12] B. McLaughlin and S. Perrott, “AWS Config,” in <em>AWS Certified SysOps Administrator Study Guide, 2E</em>, 2020.</p><p>[13] M. Grysiuk CRM, CIP, “Out of the Box: Why Organizations Are Jumping To Office 365/ Sharepoint Online,” <em>Inf. Manag.</em>, vol. 52, no. 5, 2018.</p><p>[14] L. Banica, P. Polychronidou, C. Stefan, and A. Hagiu, “Empowering IT Operations through Artificial Intelligence — A New Business Perspective,” <em>KnE Soc. Sci.</em>, 2020, doi: 10.18502/kss.v4i1.6003.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b3f02225b06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/why-startup-founder-should-know-it-audit-2b3f02225b06">Why Startup Founder Should Know IT Audit</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Digital Signature Using RSA in Go]]></title>
            <link>https://medium.com/geekculture/create-digital-signature-using-rsa-in-go-8da82552f028?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8da82552f028</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Sun, 21 Mar 2021 02:02:40 GMT</pubDate>
            <atom:updated>2021-03-21T02:02:40.567Z</atom:updated>
            <content:encoded><![CDATA[<h4>You receive a letter from your grandmother to transfer money but the letter does not have her signature. Will you transfer the money? I wish you don’t.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7ughhI2CqdZqcoqt.jpg" /><figcaption>Cover Photo by <a href="https://unsplash.com/@skillscouter?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">SkillScouter</a> on <a href="https://unsplash.com/s/photos/signature?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>A signature is the most common way to ensure the authenticity of the information. It’s been around since Rome Empire. And it’s ironic that in this digital age, there are many companies and applications that interact without proper digital signature.</p><h3>Project Scope</h3><p>Build a simple go application that creates a signature based on sample text. Then verify the signature if it is a valid signature.</p><p>Community Library</p><ul><li>Bulwark: <a href="https://github.com/purnaresa/bulwark">https://github.com/purnaresa/bulwark</a></li></ul><h3>Finished Project Preview</h3><p>Run the application in the command shell by calling the go build file.</p><pre>go run main.go</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7mDtI4TioAj8T42J.png" /></figure><p>First, the application print out the dummy plaintext. Then it creates a signature. If creating signature success, the signature will be printed out. The last part is the application verifying the signature to the plaintext. If the verification succeeds, it prints the success message.</p><h3>Application Design</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*XDrzt1ir3IlR-HI6.png" /><figcaption>Example Application Design</figcaption></figure><blockquote><em>Before continue, subscribe to our website so you get notified if we have new tutorial content.</em></blockquote><h3>Code</h3><h3>Main Application</h3><pre>package main</pre><pre>import (<br>	&quot;log&quot;</pre><pre>	&quot;github.com/purnaresa/bulwark/crypto&quot;<br>)</pre><pre>func main() {<br>	// provision key pair<br>	privateKey, publicKey, err := crypto.GenerateKeyPair()<br>	if err != nil {<br>		log.Fatalln(err)<br>	}</pre><pre>	// create dummy plaintext<br>	plaintext := []byte(&quot;hello, my name is plaintext&quot;)<br>	log.Printf(&quot;plaintext : %s\n\n&quot;, string(plaintext))</pre><pre>	// create signature<br>	log.Println(&quot;creating signature...&quot;)<br>	signature, err := crypto.SignDefault(plaintext, privateKey)<br>	if err != nil {<br>		log.Fatalln(err)<br>	} else {<br>		log.Printf(&quot;signature : %s\n\n&quot;, string(signature))<br>	}</pre><pre>	// verify signature<br>	log.Println(&quot;verifying signature and plaintext...&quot;)<br>	errVerify := crypto.VerifyDefault(plaintext, publicKey, signature)<br>	if errVerify != nil {<br>		log.Fatalln(errVerify)<br>	} else {<br>		log.Println(&quot;verification success!&quot;)<br>	}</pre><pre>}</pre><p>The code above is the full code of main.go. We will breakdown the code with an explanation below.</p><p><strong>Section 1: provision key pair</strong></p><pre>privateKey, publicKey, err := crypto.GenerateKeyPair()<br>	if err != nil {<br>		log.Fatalln(err)<br>	}</pre><p>In a production environment, the RSA key pair is provisioned off the system. You must store the private key in a secure place. Holistically — if your private key is leaked, the signature is flawed because the signature cannot guarantee its authenticity. The public key should be shared with the partner that communicating with you. If your private key is leaked, generate new key pair!</p><p>The key pair in this project is generated on the fly for the sake of simplicity.</p><p><strong>Section 2: create dummy plaintext</strong></p><pre>plaintext := []byte(&quot;hello, my name is plaintext&quot;)<br>log.Printf(&quot;plaintext : %s\n\n&quot;, string(plaintext))</pre><p>You can encrypt anything as long as it is in byte format. The important thing is the size of the plaintext. RSA is only able to encrypt a limited size of plaintext. It will be enough for most cases when encrypting a text message. If you need to encrypt big-sized data like an image or pdf, use the double encryption approach. First, you encrypt the file with a randomly generated key using AES/symmetrical. Then you encrypt the generated key using RSA.</p><p><strong>Section 3: create a signature</strong></p><pre>log.Println(&quot;creating signature...&quot;)<br>signature, err := crypto.SignDefault(plaintext, privateKey)<br>	if err != nil {<br>		log.Fatalln(err)<br>	} else {<br>		log.Printf(&quot;signature : %s\n\n&quot;, string(signature))<br>	}</pre><p>Sign the plaintext with a private key. The output is a signature that can be verified using the public key from the key pair. The signature is created using a randomizer. The signature will be different each time even the plaintext is the same.</p><p>The use case for creating a signature is right before sending the data to your partner along with the signature. If your application is handling Personally identifiable information (PII) you will need to encrypt the data. Create a signature based on plaintext before encryption. If you create the signature after encryption, an attacker may sabotage (modify) the signature so the verification failed, therefore the information is not processed. Protect the information by encrypting both ciphertext and signature.</p><p><strong>Section 4: Verify the signature</strong></p><pre>log.Println(&quot;verifying signature and plaintext...&quot;)<br>errVerify := crypto.VerifyDefault(plaintext, publicKey, signature)<br>	if errVerify != nil {<br>		log.Fatalln(errVerify)<br>	} else {<br>		log.Println(&quot;verification success!&quot;)<br>	}</pre><p>The signature must be verified using the public key of the signature creator. The plaintext is required material to check whatever the signature is valid or not. If the verification failed, it will return with an error object.</p><p>In the production scenario, the one that verifies the signature is the partner that you are communicating with. So you must share your public key with them for them to verify the signature.</p><h3>Library</h3><p>The main application above is importing library from</p><pre>&quot;github.com/purnaresa/bulwark/crypto&quot;</pre><p>It’s a library for secure application architecture. Three functions that utilized in this application are:</p><ul><li>GenerateKeyPair()</li><li>SignDefault(plaintext []byte, privateKey []byte) (signature string, err error)</li><li>VerifyDefault(plaintext []byte, publicKey []byte, signature string) (err error)</li></ul><p><strong>GenerateKeyPair</strong> is a function to generate RSA Keypair. The details and example of a function is available at this post <a href="https://www.purnaresa.co/build-rsa-private-public-key-generator-in-go/">Generate RSA Private-Public Key Pair in Go</a></p><p><strong>SignDefault </strong>is a function to create a signature. The inputs is plaintext and private key. The output is signature in base64 string with the purpose of easy storing and delivery. The function is flexible for most use cases. Check this <a href="https://github.com/purnaresa/bulwark/blob/master/crypto/encryption_public.go">Github Code</a> if you need to know under the hood.</p><p><strong>VerifyDefault </strong>is a function to verify the signature. The input is plaintext, the public key, and the public key. The output is an empty error object if verification is successful. Check this <a href="https://github.com/purnaresa/bulwark/blob/master/crypto/encryption_public.go">Github Code</a> if you need to know under the hood.</p><h3>Summary</h3><p>Creating a digital signature is easy. Many community libraries are available to use. You can use one that you trust. The important thing is to ensure the specification of those libraries is up to industry standard. If the specification does not follow the industry standard, the partner that you are communicating with will have a hard time verifying the signature</p><p>Example code available here:</p><p><a href="https://github.com/purnaresa/bulwark/blob/master/crypto/example/create_signature/main.go">https://github.com/purnaresa/bulwark/blob/master/crypto/example/create_signature/main.go</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8da82552f028" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/create-digital-signature-using-rsa-in-go-8da82552f028">Create Digital Signature Using RSA in Go</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advantage Using Cloud Managed Database From Security Perspective]]></title>
            <link>https://medium.com/geekculture/advantage-using-cloud-managed-database-from-security-perspective-fdec5aa7cbce?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdec5aa7cbce</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Fri, 19 Mar 2021 17:03:09 GMT</pubDate>
            <atom:updated>2021-03-19T17:03:09.072Z</atom:updated>
            <content:encoded><![CDATA[<h4>The database is one of the most critical components in any Tech company ecosystem. From a business continuity point of view, the company can’t do business without a running database system. It’s expected to have a dedicated team to manage the database.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rPrEsvfwE_HEx8WX" /></figure><p>Currently, a cybersecurity attack related to the database is growing exponentially. A single data leak incident can cost a million dollars. Even worst, attack kind of data destruction or ransom can stop the business activity instantly. Cybersecurity is not the Database or Cybersecurity team’s responsibility but a collaboration of all stakeholders related to the database, including the Infrastructure and Developer Team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sLLbpITvSAU5SlQi.png" /><figcaption>Hacked Database News</figcaption></figure><h3>Objective</h3><p>Analyze the threat of managing a database system and understand how to control the threat by leveraging Public Cloud managed database.</p><p>In most modern digital-native business, the activity related to the database are the following:</p><ul><li>Storing data for application</li><li>Replication of database for high-performance data access</li><li>Redundancy for high-availability setup</li><li>Backup data for a business continuity plan</li><li>Managing DB credential for application usage</li><li>Managing the DB Server instance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/0*_nMI-L0Fk84Ikosv.png" /><figcaption>Activity Around Database</figcaption></figure><h3>Threat Vector</h3><h4>Server Instance Compromised</h4><p>There are many servers to support the High Availability and High-Performance Setup. Server as a technology component inherits the threat by nature from OS and Hardware vulnerability. When an attacker can access the server by exploiting the weakness, they can do many things. Or simply, they can target the server administrator to gain access to the server.</p><h4>Credential Leaked</h4><p>Local user access in the database is authenticated using a username and password. Its single-factor authentication creates a weakness in the Authentication process. Renew or recreate credentials is not easy for the native DB engine. Therefore when an attacker can get a credential by successful attack reconnaissance, they can utilize the credential to make a more severe attack.</p><h4>Backup Center Compromised</h4><p>The backup center holds equal importance to the primary database system. By design, they should have the same data. There are two points where weakness can be exploited. One is to the backup storage, and another is the data transfer access. And most incident related to Data exfiltration is actually targeting database backup center.</p><h3>Threat Analysis</h3><p>Based on the threat above, we can update the previous diagram.</p><p>As a qualitative analysis, the following heatmap can represent the threat every team must manage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/0*-twvkMmokLwGQSRv.png" /><figcaption>Threat Heatmap on self-managed database</figcaption></figure><h3>Managed Database</h3><p>The managed database is a solution to provide a database system where the user does not have to operate the infrastructure. In a traditional (self-manage) database, the user must manage the infrastructure, provide the server, maintain the OS, and hardening the instance. To support business use-case using self-managed database setup requires us to handle various stuff like simple OS patching to complex database backup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/0*NYwSsD8NM-L2EuWv.png" /><figcaption>Self-managed database system responsibility</figcaption></figure><p>Self-managed database setup has been around for decades and is seen as the standard setup. But the introduction of Manage-database is changing the perspective of what is the right design. By allowing the user to focus on the database, the mange-database will reduce the database team’s burdens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/0*ZjW-3OssB0GOsYLt.png" /><figcaption>Managed database system responsibility</figcaption></figure><h3>Managed Database Provider</h3><h4>Amazon Web Service — RDS</h4><p>RDS is a managed database by Amazon Web Service (AWS). They offer high-availability by using a Multi-Availability Zone in each region. We can also set up the replication to support high-performance read access. We can also access the database using AWS IAM to allow better credential management and distribution. The most important thing is their pricing, which relatively cheap compares to the manhour required to set up and operate all of the features if done by an in-house team. The database team operation effort will be reduced by auto backup and auto-update feature from AWS RDS.</p><p>Check <a href="https://aws.amazon.com/rds/">here</a> for more info.</p><h4>Google Cloud Platform — Cloud SQL</h4><p>Google Cloud Platform (GCP) is offering its managed database named Cloud SQL. It supports high-availability, auto backup, and access using GCP IAM. It also uses the pay-as-you-go concept, which helps managing costs easier.</p><p>Check <a href="https://cloud.google.com/sql">here</a> for more info.</p><h3>Verdict</h3><p>Based on the feature that two Public Cloud offers, here is the highlight from a security perspective.</p><ul><li>secure servers to host the database</li><li>flexible access to the database</li><li>integrated backup functionality</li></ul><p>We can see the advantage of the managed database from this heatmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/0*lSBj8N4asNP3bgiG.png" /><figcaption>Threat Heatmap using Managed Database</figcaption></figure><p>By leveraging the Managed database from the Public cloud, we can transfer the threat to the service provider. This approach allows us to focus on providing a database that scales well and also secure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdec5aa7cbce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/advantage-using-cloud-managed-database-from-security-perspective-fdec5aa7cbce">Advantage Using Cloud Managed Database From Security Perspective</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prevent Access Leakage Using Credential Storage]]></title>
            <link>https://medium.com/geekculture/prevent-access-leakage-using-credential-storage-471f5839e79f?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/471f5839e79f</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Thu, 18 Mar 2021 13:03:24 GMT</pubDate>
            <atom:updated>2021-03-18T13:03:24.694Z</atom:updated>
            <content:encoded><![CDATA[<h4>Digital-native businesses (tech-startup) build most of their tech ecosystem in-house. In the last few years, there are several incidents around access leakage to that ecosystem.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*OOXHowIjdEJGirk4ucrI9g.png" /><figcaption>Digital Native Business</figcaption></figure><p>In some security incidents, access leakage leading to more severe events like business data exfiltration. Looking at how digital-native businesses grow, they build new features in a matter of weeks, if not days. The market demand requires a software engineer and DevOps team to focus on speed in their delivery effort. In between those efforts, access to the network, server, or database is sometimes not adequately protected. Reference from Mitre <a href="https://cwe.mitre.org/data/definitions/798.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zz5IkURGJvi5MjVj.png" /><figcaption>Recent exploit</figcaption></figure><h3>Objective</h3><p>Providing a solution of credential storage to give required credentials for the application to run.</p><p>In most modern applications, it requires the following credentials.</p><ul><li>DB user &amp; password</li><li>Encryption key</li><li>Certificates</li><li>Cloud Platform credentials</li><li>Third-party API Token</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/0*MTwFqr7hV6kTdlgZ.png" /><figcaption>Simple Application Ecosystem</figcaption></figure><h3>Threat Vector</h3><p>Pragmatically, we can observe from the past incident that the threat vector can be mitigated. But do we?</p><p>To answer that, we need to identify the threat vector of access leakage that the application used. To help identify, let’s take a look at how the application was developed and deployed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*IBanzpsBbrMFaCck.png" /><figcaption>Common SDLC practice</figcaption></figure><p>Based on the common SDLC above, we can draw the following threat vector.</p><h3>Development Workstation Compromised</h3><p>When a software engineer is working on application development, they often require testing staging and production resources. Debugging situation is happening all the time in the digital native business. In that situation, the engineer also requires accessing production resources. At the end of the day, the engineer’s workstation stores several credentials in the form of a certificate, DB connection strings, and API token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*oz5dQS35FbU1tVhX.png" /><figcaption>Development Workstation Threat</figcaption></figure><p>In the event of the workstation compromised, the attacker can retrieve the essential credentials and can conduct further malicious action.</p><h3>Hardcoded Credential</h3><p>In most the development team, git is the most common code repository. It helps to share one developer code with another easily. If that developer is doing a hardcode, it also shares the hardcoded credential. Adding a threat of internal malicious access usage.</p><p>The case of accidentally publish code repositories to the public is quite common these days. The company lost the source code, but it also gives away access to its system via hardcoded credentials in its code repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/0*nHyltyrA5w30dPS5.png" /><figcaption>Hardcode Credential Threat</figcaption></figure><h3>Deployment Tool Compromised</h3><p>CI/CD is a standard procedure in the most current development team. Those deployment tools help them to deploy new features faster. It works by building the application, deploy the artifact in the target server, supply the credentials, and start the application.</p><p>Popular CI/CD tools like Jenkins and CircleCI have a native feature to store the credentials. In terms of effectiveness, this is awesome. From the perspective of security, this practice is against the least privilege and segregation of duty concepts. The one that manages deployment operation also manages the credentials. Most CI/CD tools do not have adequate security measures like RBAC and audits. While it’s no doubt that CI/CD tools are super crucial to a digital-native business’s rapid growth, it’s not the best tool to manage the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/0*bt5C2SXoFhmbWWua.png" /><figcaption>CI/CD Tool Threat</figcaption></figure><h3>Production Server Compromised</h3><p>When an application is running in production, it must have credentials to access dependency resources. Developers have limited choice to store the credentials. The options are credentials on file, credentials on OS variable, and inject into the application binary. None of those are fully protected when threat actors already have access to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/0*WLXQlwgpnpbwTJqP.png" /><figcaption>Production Server Threat</figcaption></figure><h3>Threat Analysis</h3><p>In all stages of SDLC, the threat of access leakage exists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*E6t_9x_VqNPR1GuR.png" /><figcaption>Access Leakage Threat in SDLC</figcaption></figure><p>To qualification the threat surface, we can present the threat in the following heatmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*wxO2O3VrYHFWu83v.png" /><figcaption>Access Leakage Threat Heatmap</figcaption></figure><h3>Credential Storage Solution</h3><p>Credential storage is a system that stores a set of data securely. The data is usually credential access to other resources such as DB and third-party API Token, but it can store simple user-passwords and complex certificates. Credential storage will interact with other applications like a customer-facing application or an internal enterprise application. It will supply other applications with credentials required by them to operate appropriately. This approach helps transfer the threat to manage the application credentials to the Credential storage system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*zUSultmgAIVAP5dA.png" /><figcaption>Application Ecosystem with Credential Storage</figcaption></figure><p>A running Credential Storage system can serve multiple applications. This flexibility allows different applications to retrieve the only credentials required by them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/0*1GqQlkCqjtP9ZNzQ.png" /><figcaption>Credential Storage at Scale</figcaption></figure><p>Interaction with the credentials as object data is following the AAA model.</p><ul><li>Authentication</li><li>Authorization</li><li>Accountability</li></ul><p>Proper configuration of Credential Storage with the AAA model will reduce the threat of access leakage transferred from the other application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/0*fGBf58qU3TWlUlfG.png" /><figcaption>AAA model for credential data</figcaption></figure><p>Credential Storage as a dedicated system itself -by nature- has a threat vector that needs to be addressed. This system will be the core system of the company environment. Credential Storage implementation must adhere to the security CIA model.</p><ul><li>Confidentiality</li><li>Integrity</li><li>Availability</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/0*hqteEEDVC6qAUR9n.png" /><figcaption>CIA model for credential storage system</figcaption></figure><h3>Credential Storage Vendor</h3><p><strong>Harsicorp Vault</strong></p><p>Vault is an open-source project from Harsicorp. Anyone can set up the Vault system in their environment as a Credential Manager. Given this project’s public-license nature, Vault is popular with the developer team, who is starting to level up their security game.</p><p>Check <a href="https://www.vaultproject.io/">https://www.vaultproject.io/</a> for more info.</p><p><strong>AWS Secrets Manager</strong></p><p>Secrets Manager from AWS is a SaaS-based solution to store credentials. Having a system running in the cloud allows us to transfer operation effort — effectively release the CIA model requirement. Billed by the number of keys and number of requests, the AWS Secrets Manager is cost-efficient.</p><p>Check <a href="https://aws.amazon.com/secrets-manager/">https://aws.amazon.com/secrets-manager/</a> for more info.</p><p><strong>GCP Secret Manager</strong></p><p>Google Cloud Platform (GCP) offers SaaS-based Credential Storage named Secret Manager. With a full cloud advantage in operations, Secret Manager is very cheap.</p><p>Check <a href="https://cloud.google.com/secret-manager">https://cloud.google.com/secret-manager</a> for more info.</p><p><strong>CyberArk Conjur</strong></p><p>Conjur is open-source Credential Storage from Cyberark. It has an enterprise version to support enterprise companies that do not have the resources to self-manage the open-source version. The enterprise&#39;s name is CyberArk Application Access Manager.</p><p>Check <a href="https://www.conjur.org/">https://www.conjur.org/</a> for more info.</p><h3>Implementation</h3><p>Credential Storage is implemented in the same application ecosystem. The system access and policy are managed by Security Ops to allow specific applications to fetch the credentials. Each application has a particular path to separate the credential between the application. The idea is to ensure the application or user only able to read credentials designated for them. Application and user require to present the authentication when accessing credential storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*lMv9IGqIdwNIoBvO.png" /><figcaption>Credential Storage Implementation</figcaption></figure><p>As a metamorph of this implementation, we can imagine how we leave our house locked when we go out. We have many valuable assets in our place, but it’s not making sense to carry all of the assets whenever we go. The intuitive thinking is to lock the house and hold the key with us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uGX9_4JjyPmOLGLj" /><figcaption>Locked House Photo by <a href="https://unsplash.com/@eduardmilitaru?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Eduard Militaru</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Now, back to technical thinking. We can verify the implementation using a threat heatmap. Adding Credential Storage in our ecosystem. Storing many essential data, Credential Storage is an entity with a lot of threat surfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NOFUA5trP293KPeT.png" /><figcaption>Threat Heatmap with Credential Storage</figcaption></figure><p>To a smaller team, the Credential Storage benefit may not offset the implementation and operation effort. That’s a true statement because, by nature, Credential Storage is transferring the threat. To the bigger team running a dozen applications, Credential Storage is crucial to control the threat hotspot. Also, team security can focus on protecting critical assets — the Crown Jewels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*tR7NtFSTP6z2LV-k.png" /></figure><h3>Technical Control</h3><p>Credential Storage itself is just a tool. It requires proper configuration to ensure an adequate security posture with AAA.</p><ul><li>Create a robust authentication method for the user and service to manage credentials. Most credential storage vendors have this capability but it’s the user&#39;s responsibility to configure it properly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ICuM-kINgTomJop2.png" /><figcaption>Robust Auth</figcaption></figure><ul><li>Follow the least-privilege principle for user and service access roles. By having clear visibility of “who can do what” and translate it to the system RBAC, we can prevent illegal activity.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d3F1wN4ywirzJd2h.png" /><figcaption>Least-privilege Principle</figcaption></figure><ul><li>Real-time stream audit log for event monitoring and auditing purpose. Log retention is out of scope from the credential storage system. We properly set up the log backup to ensure the availability of information for future audits.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/0*WGFClPrscx0nppys.png" /><figcaption>Non-Repudiation Log</figcaption></figure><h3>Administrative Control</h3><p>A tool cannot run by itself without a policy to support the usage.</p><ul><li>Create a role-matrix to define the object interaction behavior. Creating least-privilege RBAC in the system only possible if the policy of the organization is defined. This policy is a collaboration of HR department and IT department to ensure all role is governed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mu0prtOgudhKP52u.png" /><figcaption>Example role-matrix</figcaption></figure><ul><li>Prohibition to distribute any credential in any media. We can have better threat control with credential storage. But, research suggests that human is the weakest link in the security posture. If one of the employees ever distribute the credential using an external communication channel, we cannot guarantee the secrecy of that credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IR-N2loI1g2mPZAi.png" /><figcaption>Slack Chat</figcaption></figure><ul><li>Strict policy to keeping and transferring master key. The nature of credential storage where any data is encrypted is wonderful security control. However, there is a concern regarding who has the key and how to store it. More importantly, if the key holder is no longer in the company, there must be a policy to renew the master key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*M3Dh0WrYOS14WMmY.png" /><figcaption>Master Key</figcaption></figure><h3>Verdict</h3><p>Credential Storage is a perfect solution to control access leakage threats. It’s an essential tool for a team that manages a lot of services to keep the threat heatmap sane.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=471f5839e79f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/prevent-access-leakage-using-credential-storage-471f5839e79f">Prevent Access Leakage Using Credential Storage</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build an API Using Go and MySQL]]></title>
            <link>https://medium.com/better-programming/build-an-api-using-go-and-mysql-1d290c681f1c?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d290c681f1c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Fri, 10 Jul 2020 15:48:33 GMT</pubDate>
            <atom:updated>2020-08-26T21:44:37.870Z</atom:updated>
            <content:encoded><![CDATA[<h4>It’s easier than you think</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/0*vsPEboIHViNi03dH.png" /><figcaption>Image source: Author</figcaption></figure><h3>Scope</h3><p>The project scope is to build an API to manage content posts. You’ll create an API with three functionalities: create a post, read a single post, and list posts. The database is MySQL installed in localhost.</p><p>The database library is using <a href="https://github.com/jmoiron/sqlx">https://github.com/jmoiron/sqlx</a>.<br>The HTTP routing library is using <a href="https://github.com/gin-gonic/gin">https://github.com/gin-gonic/gin</a>.</p><p>Since the Go community already has a wonderful library, there is almost no reason to write everything from scratch.</p><h3>Application Design</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/0*hA0QplsB9up_Aame.png" /><figcaption>Project Application Design</figcaption></figure><p>We have two packages: main and post.</p><p>The main package is an executable package in Golang that runs the application. It consists of an instance from the package post (postClient) and three functions to handle routing (listPost, readPost, and createPost).</p><p>The post package is the package that interacts with the database to manage the post. It has two object types: Client and Post. Client is an interface to use the package. Post is an abstraction of the real-world content post model. The instance of Client has three functionalities to run a query or insert to the database.</p><p>The database structure of this project is only one table named “post” to store the object Post in the package post. The table structure is the following.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b22d54212ee49496ad8b17167840e156/href">https://medium.com/media/b22d54212ee49496ad8b17167840e156/href</a></iframe><h3>Code</h3><h4>&#39;post’ package</h4><p>These following code blocks explain how we build the Client and Post types and the NewClient function that requires DB input. The DB input is using a package that is initialized outside the package. The idea of this approach is the package does not care who and what creates the Client instance, as long as it provides a working DB connection pool. The inline comment explains the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/860c38ad928868a47dc18a7ce04ffa7b/href">https://medium.com/media/860c38ad928868a47dc18a7ce04ffa7b/href</a></iframe><p>The next code block shows the function inside the Client. All of the functions are using a function from sqlx.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b7b5e6f13127408c550d39b2adb28b6/href">https://medium.com/media/2b7b5e6f13127408c550d39b2adb28b6/href</a></iframe><h4>&#39;main’ package</h4><p>This package is responsible for running the HTTP request listener. When the request comes, the package uses HTTP request routing from gin. On startup, the main package is initiating a database instance and then passing the instance to create a new Client from the Post package.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/934c47d5bb70a8aa5b97f8ceb75186af/href">https://medium.com/media/934c47d5bb70a8aa5b97f8ceb75186af/href</a></iframe><h4>Initialize DB and HTTP routing</h4><p>In the code above, r is routing with three use cases:</p><ul><li>/listPost = get a list of posts</li><li>/readPost/:id = get a single post, with :id being the dynamic path meant for the post ID</li><li>/createPost = create a new post, this routing using HTTP POST method to carry the request body</li></ul><p>These three routings use functions that utilize the postClient instance that’s defined at the package level. The code for the function is below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d4d9bcd441e230ba8a13277d7dfa5a8/href">https://medium.com/media/0d4d9bcd441e230ba8a13277d7dfa5a8/href</a></iframe><p>The code listPost is receiving input from c.Query(&quot;limit&quot;). The query is capturing the extra argument from the HTTP request. An example of an HTTP request with the argument is /listPost?limit=5. Using code in the function, it will parse 5 as a limit.</p><p>The readPost function receives input from c.Param(&quot;id&quot;), which is reading the parameter in the HTTP request. The parameter is dynamic input on the URL request itself. An example of a request with a parameter is /readPost/1. The code uses capture routing pattern /readPost/:id, which captures :id as input. With that example, the id is 1.</p><p>Function createPost is using an HTTP POST request. The POST request can carry the body which is received using c.PostForm(&quot;content&quot;) to read the body data of content.</p><p>Once all code in place, run the application using the command:</p><pre>go run main.go</pre><h3>Demo</h3><h4>Create a new post</h4><p>Request using the following cURL to create a new post with content “hello”:</p><pre>curl -X POST &#39;localhost:8080/createPost&#39; -d &#39;content=welcome&#39;</pre><p>The output of the request is the post ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y7g3U_l1A7aS7_fS.png" /></figure><h4>Read post using ID</h4><p>Use the previous ID as input to the request. Use the following cURL.</p><pre>curl -X GET &#39;localhost:8080/readPost/12&#39;</pre><p>The output of the request is the post data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aO588xGdbNTCdsGf.png" /></figure><h4>List posts</h4><p>Use the following cURL to get the five latest posts.</p><pre>curl -X GET &#39;localhost:8080/listPost?limit=5&#39;</pre><p>The output is a list of data of the five latest posts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q8QJJbEABBDoANgh.png" /></figure><h3>Summary</h3><p>Developing an API in Go is easy with so many robust libraries in Go communities. You can check the full code here:</p><p><a href="https://github.com/purnaresa/golang/tree/master/project101">https://github.com/purnaresa/golang/tree/master/project101</a></p><p>Leave a comment if you want to ask something about Go or have some issues following the tutorial. What do you want to learn for the next tutorial?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d290c681f1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/build-an-api-using-go-and-mysql-1d290c681f1c">Build an API Using Go and MySQL</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Protect Image File Using Encryption (written in Go)]]></title>
            <link>https://medium.com/swlh/protect-image-file-using-encryption-written-in-go-7d016c5a4719?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d016c5a4719</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Sun, 21 Jun 2020 15:20:01 GMT</pubDate>
            <atom:updated>2020-06-21T15:20:01.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>Protect Image File Using Encryption (Written in Go)</h3><h4>The digital platform must protect consumer data including the image data. Cybersecurity attacks often targeting image files.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1nY7dDQH1cvRbVxQTmVKRA.jpeg" /><figcaption>Protect credit card photo. Photo by <a href="https://unsplash.com/@b0rno?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ryan Born</a> on <a href="https://medium.com/s/photos/credit-caard?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Background</h3><p>There are many sensitive data in the form of an image file. Photo, National ID, Certificates, and any confidential image. Imagine if our <strong>credit card</strong> photo leaked to the internet and shown in Google Search.</p><p>Protecting consumer and company data is mandatory by regulation (and common sense).</p><h3>Objective</h3><p>Protect the image stored in the system from unauthorized access.</p><h3>Pseudocode</h3><h4><strong>Storing</strong></h4><ol><li>Prepare the image file</li><li>Prepare the encryption key (secret)</li><li>Encrypt the image using AES into the cipher data</li><li>Save the cipher data into storage</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*uudfynpzmlA_1kxX5f75_w.png" /><figcaption>Store image as an encrypted file.</figcaption></figure><p>There are two options on the step no 2. The first option is to have a predefined (Shared Key) to encrypt every image. Another option is to create the newly generated key before every encryption — the newly generated key called Data Encryption Key.</p><p>Shared Key is making sense if the system use case is only for internal organization. Since the Shared Key is already predefined, only the cipher data need to be stored.</p><p>Generating Data Encryption Key is a must if the image is also moving outside the organization. Principally, we cannot share the Shared Key to outside organizations. Data Encryption Key must be stored alongside the cipher data so the data can be decypher in the future.</p><h4><strong>Retrieving</strong></h4><ol><li>Retrieve the cipher data</li><li>Retrieve the encryption key (secret)</li><li>Decrypt the cipher file using AES into the plain image file</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*SybT3Re1Cq3mexcjOzUNbQ.png" /><figcaption>Retrieve image from encrypted file</figcaption></figure><h3>Code</h3><h4><strong>Library</strong></h4><p>We have provided a wrapper function for Golang in this link: <a href="https://github.com/purnaresa/bulwark/tree/master/encryption">https://github.com/purnaresa/bulwark/tree/master/encryption</a></p><p>The function <strong>EncryptAES </strong>receive the plain data of image and encryption key. The output of <strong>EncryptAES </strong>is cipher data in byte coded.</p><pre>func (c *Client) EncryptAES(plainData, secret []byte) (cipherData []byte) {<br> block, _ := aes.NewCipher(secret)<br> gcm, err := cipher.NewGCM(block)<br> if err != nil {<br>  return<br> }<br> nonce := make([]byte, gcm.NonceSize())<br> _, err = io.ReadFull(rand.Reader, nonce)<br> if err != nil {<br>  return<br> }</pre><pre>cipherData = gcm.Seal(<br>  nonce,<br>  nonce,<br>  plainData,<br>  nil)</pre><pre>return<br>}</pre><p>The function <strong>DecryptAES </strong>need the input of ciphertext and the encryption key. The output is plain data in byte coded — the byte data used for writing the original image.</p><pre>func (c *Client) DecryptAES(cipherData, secret []byte) (plainData []byte) {<br> block, err := aes.NewCipher(secret)<br> if err != nil {<br>  return<br> }<br> gcm, err := cipher.NewGCM(block)<br> if err != nil {<br>  return<br> }<br> nonceSize := gcm.NonceSize()</pre><pre>nonce, ciphertext := cipherData[:nonceSize], cipherData[nonceSize:]<br> plainData, err = gcm.Open(nil, nonce, ciphertext, nil)<br> if err != nil {<br>  return<br> }<br> return<br>}</pre><p>An extra function to generate Data Encryption Key is in function <strong>GenerateRandomString. </strong>The function needs input for Encryption Key length.</p><pre>const letterBytes = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&quot;</pre><pre>func (c *Client) GenerateRandomString(length int) (result string) {<br> b := make([]byte, length)<br> for i := range b {<br>  b[i] = letterBytes[mathRand.Intn(len(letterBytes))]<br> }<br> result = string(b)<br> return<br>}</pre><p><em>To use the library, please fork from the Github in case of any future update or patch.</em></p><h4><strong>Example Use Case: Store and Retrieve encrypted image</strong></h4><p>We need to encrypt images from local files. Must store a new file containing the encrypted data, together with the Data Encryption Key. Then finally, we need to retrieve the encrypted image into the plain image.</p><p>The original file is “original-image.jpg.” Here is the code for the use case.</p><pre>package main</pre><pre>import (<br> &quot;log&quot;</pre><pre>&quot;github.com/purnaresa/bulwark/encryption&quot;<br> &quot;github.com/purnaresa/bulwark/utils&quot;<br>)</pre><pre>func main() {<br> // encryption start<br> // step 1<br> image := utils.ReadFile(&quot;original-image.jpg&quot;)</pre><pre> // step 2<br> encryptionClient := encryption.NewClient()<br> secret := encryptionClient.GenerateRandomString(32)</pre><pre> // step 3<br> cipherImage := encryptionClient.EncryptAES(image, []byte(secret))</pre><pre> // step 4<br> err := utils.WriteFile(cipherImage, &quot;encrypted-image&quot;)<br> if err != nil {<br>  log.Fatalln(err)<br> }<br> err = utils.WriteFile([]byte(secret), &quot;image-key.txt&quot;)<br> if err != nil {<br>  log.Fatalln(err)<br> }<br> // encryption end</pre><pre> // decryption start<br> // 1<br> encryptedImage := utils.ReadFile(&quot;encrypted-image&quot;)</pre><pre> // 2<br> key := utils.ReadFile(&quot;image-key.txt&quot;)</pre><pre> // 3<br> plainImage := encryptionClient.DecryptAES(encryptedImage, key)<br> err = utils.WriteFile(plainImage, &quot;test-original.jpg&quot;)<br> if err != nil {<br>  log.Fatalln(err)<br> }<br> // decryption end<br>}</pre><p>The output of Encryption step 4 is file “encrypted-image,” which contains encrypted data of image and file “image-key.txt,” which contain the key to decrypt the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCxh9tV52NKScIwevJycVA.png" /><figcaption>Left is the original image, the middle is the encrypted image, right is the data encryption key.</figcaption></figure><h3>Summary</h3><p>Protecting images is a simple step. Since almost all popular languages already have a crypto library, doing encryption is just a few additional codes.</p><p>Let us continue protecting our data.</p><p>Github Link: <a href="https://github.com/purnaresa/bulwark">https://github.com/purnaresa/bulwark</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d016c5a4719" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/protect-image-file-using-encryption-written-in-go-7d016c5a4719">Protect Image File Using Encryption (written in Go)</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure Data Transfer Service Using Rsa Asymmetric Encryption (In Go)]]></title>
            <link>https://medium.com/swlh/building-a-secure-data-transfer-service-using-rsa-asymmetric-encryption-in-go-3a656c9309c1?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a656c9309c1</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Sat, 28 Mar 2020 23:20:48 GMT</pubDate>
            <atom:updated>2020-03-29T10:36:13.630Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Secure Data Transfer Service Using RSA Asymmetric Encryption (In Go)</h3><h4>How to make data safe from Man In The Middle attack and comply with the regulation.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLQzBKYxTIVNdqopT90zMA.jpeg" /><figcaption>Protecting the valuable. Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/data-lock?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Background</strong></h3><p>Security has been a primary concern in business and government for hundreds of years ago. Government regulation is explicitly mentioned how to handle Customer data. And it is essential to protect your business continuity from vulnerability exploit.</p><h3><strong>Objective</strong></h3><p>Send data securely to other parties via an HTTP request. Other parties mean a partner entity which doing a communication to us. Secure parameters are:</p><ul><li>Data cannot be read by an unauthorized party</li><li>The data source can be verified from the right party</li></ul><h3>Components</h3><p>The service is able to send and receive data. Users will use the service to send data to any party using the same service. Prerequisite information for this setup is each party should have Public Key for each partner.</p><p>The diagram below shows how Alice transfers data to Bob using a secure service. The service which Alice use needs Bob’s public key to send a message to Bob and Alice’s private key to sign the message. On the other side, Bob running a service that has his private key to read the message from Alice and Alice’s private key to verify her signature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*Gc28ALKyBTldMIcEbnjKFg.png" /><figcaption>Top-view secure data transfer service</figcaption></figure><p>Once top-view is understood, we need to see components inside the service. Keep in note that a single service can communicate with many services as long as it has the partner’s public key.</p><p>Here is the minimum requirement to build the service.</p><ol><li>The private key reader</li><li>The public key reader</li><li>Message encryptor</li><li>Signature writer</li><li>Message decipher</li><li>Signature verifier</li><li>HTTP listener</li><li>HTTP post</li></ol><p>The diagram below shows the interaction between components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*At3Jt55paZhUF2vAj2XRGw.png" /><figcaption>What&#39;s Inside the Service</figcaption></figure><h3>Code</h3><p>The code below is the implementation of the requirement above in Go. The service will be able to communicate with any service even with different code language as long as follow the same requirement.</p><p><strong>Private key reader</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f62f28d87e6c49800c5f31b4358eecd9/href">https://medium.com/media/f62f28d87e6c49800c5f31b4358eecd9/href</a></iframe><p>The function will read the private key file in naming format:<strong>[name]-private.pem</strong></p><p>There are many tools to generate RSA pair keys. It’s recommended to use a 2048bit size.</p><h4><strong>Public key reader</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12966ea46a3a184e2b6b8d0310ea9269/href">https://medium.com/media/12966ea46a3a184e2b6b8d0310ea9269/href</a></iframe><p>The function will read the public key given by the partner in the naming format: <strong>[name]-public.pem</strong></p><p>The input parameter is an array of string in the sense of the service will communicate with many parties.</p><p>The output is a map-of-object type with the key is partner name and value is the public key. The map-of-object will be utilized when encrypting data.</p><h4><strong>Message encryptor</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/18e608db8eab20a0ecae12c194c47b71/href">https://medium.com/media/18e608db8eab20a0ecae12c194c47b71/href</a></iframe><p>The input of the function is the message. Original data before encryption called plaintext and data after encryption called ciphertext.</p><p>The function uses the minimum required encryption which is plaintext and public key.</p><p>The output is written in base64 string to make it readable to a human.</p><h4><strong>Signature writer</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fcf4b4ee8105f00dcef82efc1b18810/href">https://medium.com/media/3fcf4b4ee8105f00dcef82efc1b18810/href</a></iframe><p>The function will use ciphertext from the previous function. Using the private key of Alice (the sender) the output will be a unique signature that can’t be replicated by other parties.</p><h4><strong>Signature verifier</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2707af0dcf40c91899f2c25a1a6e2906/href">https://medium.com/media/2707af0dcf40c91899f2c25a1a6e2906/href</a></iframe><p>When receiving a message from other parties, the signature verifier function shall be executed first.</p><p>The function will calculate the ciphertext and signature using the partner’s public key. The output is an error object if the signature is not verified.</p><h4><strong>Decipher</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9472f249407cab53590da72f6debf8d6/href">https://medium.com/media/9472f249407cab53590da72f6debf8d6/href</a></iframe><p>If the signature is verified, the next thing to do is decipher the ciphertext into plaintext. Only the right private key able to read the message.</p><p>This is the last step of the flow. We can write out the plaintext in the form of a text display or any kind presentation form.</p><h4><strong>HTTP post</strong></h4><p>Now, we need to put all the functions together.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e0d5f5c45204bc76aa65d7e42fc20f1/href">https://medium.com/media/5e0d5f5c45204bc76aa65d7e42fc20f1/href</a></iframe><p>The input is a <strong>gin </strong>object which comes from <a href="https://github.com/gin-gonic/gin">gin — a very popular HTTP routing.</a></p><p>We will use this function on HTTP routing when the user calls the service to transfer the data. The parameter required is</p><ul><li>receiver: partner name, this required to get the right public key</li><li>host: this is the partner service host address that will be hit after encrypt and sign the message</li><li>message: the original information to be sent</li></ul><p>The function will first encrypt the message, sign the ciphertext and transfer the ciphertext to the partner service. The response to the user is HTTP Status to tell the partner service is reachable or not and ciphertext for that sent.</p><p>This is the complete flow to send data securely to other parties.</p><h4><strong>HTTP receiver</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c18a950175575a4bb77daf78e736847/href">https://medium.com/media/4c18a950175575a4bb77daf78e736847/href</a></iframe><p>This function is executed when the service receives data from other services. Put all the necessary functions to make the data available to the user. First, it matches the public key and the sender. Then verify the signature based on the public key. If the signature is not verified, it tells the user there is a message that not verified. If the signature is verified, the function will decrypt the message into plaintext and print the plaintext for the user.</p><h4><strong>Service Main</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8c5d077ae3fc167a637aec8a8bfbdd2/href">https://medium.com/media/a8c5d077ae3fc167a637aec8a8bfbdd2/href</a></iframe><p>To make all function executable, we need to build the main function with HTTP routing.</p><p>During the service initiation, it will read the <strong>flag </strong>to allow one service to be deployed by every party. The service required 3 flag</p><ul><li>name: the service user — service will use the private key that matches the user name</li><li>contacts: is the partner&#39;s name separated in comma ‘<strong>,</strong>’ — service will use the partner public key that matches the partner&#39;s name</li><li>port: is the port that the service will run</li></ul><p>And that will be all, the service is able to do two full flow, sending data and receiving data.</p><h3>Testing</h3><p>To test the service, we need to build the Go file. Example to build the service with the name <strong>secure-comm</strong> is following:</p><pre>go build -o secure-comm</pre><p>Copy the file into two different folders for Alice and Bob. Put Alice’s Private key and Bob’s public key into folder Alice. Put Bob’s private key and Alice’s public key in folder Bob.</p><pre>➜  test git:(master) ✗ tree<br>.<br>├── alice<br>│   ├── alice-private.pem<br>│   ├── bob-public.pem<br>│   └── secure-comm<br>└── bob<br>    ├── alice-public.pem<br>    ├── bob-private.pem<br>    └── secure-comm</pre><p>Now run this command on folder Alice</p><pre>./secure-comm -name=alice -contacts=bob -port=8080</pre><p>The command use Alice for name’s flag, Bob for contacts’s flag and 8080 for the port’s flag. Running in default gin HTTP routing configuration, the output will be like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1QB3ZUj08JGchFWGFpTQw.png" /><figcaption>Running the service at folder Alice</figcaption></figure><p>Run the following command in folder Bob.</p><pre>./secure-comm -name=bob -contacts=alice -port=8081</pre><p>It works similar way like previous command execution for folder Alice except for the different port — which is 8081. It means the service is running in 8081.</p><p>Now, we need to test the communication. Here is the HTTP call in the CURL command simulating scenario where Alice sends the message to Bob.</p><pre>curl --location --request POST &#39;<a href="http://localhost:8080/send&#39;">http://localhost:8080/send&#39;</a> \<br>--header &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>--data-urlencode &#39;receiver=bob&#39; \<br>--data-urlencode &#39;host=<a href="http://localhost:8081/receive&#39;">http://localhost:8081/receive&#39;</a> \<br>--data-urlencode &#39;message=hello Bob, how are you&#39;</pre><p>The service in folder Alice will response with the following response. This means the data is sent to Bob encrypted.</p><pre>{</pre><pre>&quot;ciphertext&quot;: &quot;i5WGunu3+qMTUTaClS09whPhtxDn3mKMahcMQPo7IHmQEutIeDuGzJkoS7i/kDl85DLv0YgHJtdF6kuR99u9SBL7SMN3PdhqtyPpDyEZal6H8N+4wndB688Cw0SRtOIHJraDFbrBTt2bB13gRQX1l+VNv5MwsDswJ9Gv3UsaKL6Gpi2SatD/BcAsSd7bTeM8cS7ekZ55lV45Ll7je84cKVa7auOvWwuFiY8QdGEJBer0MQ96yB92cPxxvN9/kLfwQ2i0b2d1F1LrWstXDu26wXIiROmAgeQeIahx8+lTFGedLR8y2yY5xvdBAG7caYMgRl1yniSQXVp9we33LOMAuA==&quot;</pre><pre>}</pre><p>When we check on folder Bob service, the service will print out the message from Alice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*Gro_gQRo4BqrOgORsgnakw.png" /><figcaption>Message from Alice to Bob</figcaption></figure><p>That’s mean the Bob will be able to read the message from Alice. End-to-end testing is complete.</p><p>Bob actually able to reply by doing an HTTP call to the service in folder Bob at port 8081. Here is the screenshot of a conversation between Alice and Bob using the secure data transfer service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0daxNvgtHQVs4GjKguJ1Ag.png" /><figcaption>Conversation between Alice and Bob</figcaption></figure><h3>Footnote</h3><p>The service we build here is aligned with the two security principles — Confidentiality and Integrity. The implementation, of course, can be adjusted to real-life business cases. As long as the flow and component are the same, this service can be built in various other languages. The full code repository is available here</p><ul><li><a href="https://github.com/purnaresa/secureme/blob/master/secure-comm/main.go">Github Link</a></li></ul><p>Prerequisites for using this service are having a pair of RSA Keys. Here is how to generate the RSA Keys.</p><ul><li><a href="https://medium.com/better-programming/build-an-rsa-asymmetric-cryptography-generator-in-go-d202b18bcfd0">RSA Asymmetric Cryptography Generator</a></li></ul><p>Hopefully, this service will be useful to you. What do you think the next improvement would be?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a656c9309c1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/building-a-secure-data-transfer-service-using-rsa-asymmetric-encryption-in-go-3a656c9309c1">Building a Secure Data Transfer Service Using Rsa Asymmetric Encryption (In Go)</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Friendship Is My New Long Life Investment]]></title>
            <link>https://medium.com/@purnaresa/friendship-is-my-new-long-life-investment-4135f49677d3?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4135f49677d3</guid>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[friendship]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 20:56:35 GMT</pubDate>
            <atom:updated>2026-08-04T09:40:42.476Z</atom:updated>
            <content:encoded><![CDATA[<h4>The right investment will bring peace of mind and comfort in the future. And for heaven-and-hell, friendship is among the luxurious wealth.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gyjp-r1R98zBprAR3y4xmg.jpeg" /><figcaption>Chilling at mountain trails. Photo by <a href="https://unsplash.com/@matheusferrero?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Matheus Ferrero</a> on <a href="https://unsplash.com/s/photos/friends?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Joe said,</p><blockquote><em>Why talk about a topic that a 10-year-old boy knows naturally?</em></blockquote><p>I answered,</p><blockquote><em>Hold your horses, you modern nomad. In this age, what do we actually know about friendship, natural order, and social law?</em></blockquote><p>Let’s break it down this way:</p><ul><li>You always have lunch with your co-workers. Check.</li><li>A half of the people in your workspace know your name and greet you every time. Check.</li><li>You never miss a Marvel movie debut with your gang. Check.</li><li>You have hundreds of followers and dozens of ❤️ on your privatte Instagram posts. Check.</li><li>You can talk about how fantastic the One Piece manga is with your geek club. Check.</li></ul><p>If you checked yes to at least 4 out of 5, you’re incredible. Maybe you have a lot of friends — just maybe. This story may resonate with you. Let’s dig in.</p><h3>What’s The Deal?</h3><p>I’ve been listening to the Rob Dial podcast regularly for months. It’s usually about productivity, but one episode hit me hard with a question about life. Dial said:</p><blockquote><em>Write down 3–7 people you care about and want to listen to deeply. Ignore everyone else in the world to help you live happily and positively.</em></blockquote><p>That question stuck in my head for weeks. I can’t even name more than one person who actually knows me.</p><p>I do have a social circle and a lovely team at the office, plus a group of friends from college. We hang out and joke about various things. But honestly, most of them know only a tiny bit of my life.</p><p>So how about you? Can you name seven best friends you could sit down and have a real, live conversation with?</p><p>Everyone I know is a real person, not digital data I can sort by a friend-score. In my pursuit of happiness, I needed to rethink how I see friendship.</p><h3>Good Things Happen</h3><p>There are hundreds of articles out there about Fantastic Friends and Where to Find Them. But I don’t go with that approach. Instead of selecting, filtering, and finding friends, I try to be a better friend to the people already close to me. I think that’s enough for me (based on movies and cheesy webtoons). Here’s what I do:</p><p><strong>Ask how they’re doing</strong></p><p>Modern conversation uses “how are you?” as a greeting template. Let’s step back. I try to use that question with genuine intent, to actually know how my friend is doing right now. You have to ask it while looking your friend in the eye. They’ll give a suspenseful pause before answering, “I’m okay.” Then you can explore what that pause means.</p><p>Ask what’s new with them recently, and congratulate them on any of their life achievements.</p><p><strong>Give a gift</strong></p><p>Everyone can have a bad day. A gift can come to the rescue. If you know your friend is having a rough time at work or something happened, it’s a good time to grab something from the nearest store for them. It doesn’t matter whether it’s a hundred-dollar souvenir or a one-dollar coffee — just find whatever’s convenient. None of your gifts will solve their problem, but they’ll remind your friend they’re not alone.</p><p>You can also gift something randomly, even when your friend is doing fine. Say you have a buy-one-get-one promo at the nearby coffee shop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOTaOOWfgN55rJlWisBTOg.jpeg" /><figcaption>Soap as a gift? Photo by <a href="https://unsplash.com/@sonance?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Viktor Forgacs</a> on <a href="https://unsplash.com/s/photos/small-gift?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>Make a phone call</strong></p><p>Twenty-four hours isn’t enough for most millennials. How can I make time for a friend if I don’t even have time for myself? That’s a common question that’s been solved by the invention of the telephone a hundred years ago. We just forget when to use it.</p><p>A gentle reminder that you can actually make phone calls hands-free while driving, using the loudspeaker in your bedroom, or using Apple EarPods during your commute. It’s actually convenient — just try calling a friend you haven’t seen in the last few months. Best thing ever.</p><p><strong>The coffee shop is the best</strong></p><p>People come to coffee shops from time to time. It’s a staple place to share stories with your buddy. It can be a quick escape from office work hours or a weekend chill session.</p><p>What’s different nowadays is that coffee shops are often associated with co-working spaces, casual business meetings, or long-planned reunions. That’s okay though — people do what they need to do. But I’d recommend you go out and have a cup of coffee with your friends regularly. Go with one or two people and talk about real life while calmly sipping your coffee.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHmbqX44jBP_DiGCoAT7CA.jpeg" /><figcaption>Chat over a coffee. Photo by <a href="https://unsplash.com/@dylanferreira?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Dylan Ferreira</a> on <a href="https://unsplash.com/s/photos/coffee-friend?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>My Take Away</h3><p>There are countless reasons to spend time with your friends. But the four things above come naturally to me. The key to any investment is making sure it works for you. After shifting my point of view on finding or making friends, here I am now:</p><ul><li>Do you have more friends? Not sure — I don’t check.</li><li>Can you share your journey with your buddy? Sometimes — most of the time, I just ask and listen.</li><li>Are you happier? YES! YES! YES!</li></ul><p>Spending time, thought, and energy on your friends is a form of investment. Unlike other investments, which rely on technicals or fundamentals, friendship relies on feeling and self-awareness. Continue it when you feel the joy.</p><p>Did you know happiness comes the moment you start investing? Reaping the results later is just an added bonus. Just like making friends, don’t worry about how the future will look. Just be present, and be kind to your friends.</p><p><strong>Quick Reality Check</strong></p><ul><li>Realistically, we don’t have time for dozens of friends. Keep the number small, and invest in fewer people.</li><li>Never expect anything back from your investment — they’re human beings with their own journeys. Just pray for their happiness, whatever happens.</li></ul><blockquote><em>Friendship is the hardest thing in the world to explain. It’s not something you learn in school. But if you haven’t learned the meaning of friendship, you really haven’t learned anything. — Muhammad Ali, one of the greatest boxers of all time.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4135f49677d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Image Watermark App For Branding or Security Purpose in Go]]></title>
            <link>https://medium.datadriveninvestor.com/build-image-watermark-app-for-branding-or-security-purpose-in-go-80f7ee15003b?source=rss-581bea2d858f------2</link>
            <guid isPermaLink="false">https://medium.com/p/80f7ee15003b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Purnaresa Y]]></dc:creator>
            <pubDate>Wed, 26 Feb 2020 02:38:16 GMT</pubDate>
            <atom:updated>2020-03-03T05:55:07.102Z</atom:updated>
            <content:encoded><![CDATA[<p>Write a small portable Go Application to put a logo on top of an image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6UHdkhzGI4A-eJVX2FaGFQ.jpeg" /><figcaption>Watermarked documents. Original Photo by <a href="https://unsplash.com/@anniespratt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Annie Spratt</a> on <a href="https://unsplash.com/s/photos/document?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Background</h3><p>Protecting content in the image format by placing brand identity is a common practice in the industry called watermark. No one wants to use a watermarked image. The effort to remove the watermark is quite high, thus making unauthorized party lost their intention to steal the content. This attempt is proven to improve security measures.</p><p><a href="https://www.datadriveninvestor.com/2019/01/23/which-is-more-promising-data-science-or-software-engineering/">Which is More Promising: Data Science or Software Engineering? | Data Driven Investor</a></p><p>Watermark also serves as auditing tools. When sending a confidential image to an external party, it’s mandatory to put a watermark there containing recipient name and use case. Imagine when a confidential image is leaking. It’s hard to identify where is the source of the leak. But if the image contains a watermark, we can see from which party the image is leaked by looking at the watermark. On the other hand, only the company’s insider able to get his hand on the image without the watermark. If the image leaked without watermark, it must be from an insider.</p><h3>Objective</h3><p>Create watermark to an image file with company label image</p><h3>Pseudocode</h3><ol><li>Fetch raw image file of the base image</li><li>Fetch raw image file of the logo image</li><li>Calculate logo position</li><li>Merge the two files</li><li>Write image file</li></ol><h3>Implementation</h3><p>The App requires the following dependency.</p><pre> &quot;flag&quot;<br> &quot;fmt&quot;<br> &quot;image&quot;<br> &quot;image/color&quot;<br> &quot;image/draw&quot;<br> &quot;image/jpeg&quot;<br> &quot;image/png&quot;<br> &quot;log&quot;<br> &quot;os&quot;<br> &quot;strings&quot;</pre><p>Create a function named readImage to read the file and transform it into the image object. We use this function twice. (reflecting step 1 and 2 at pseudocode)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c8f29073cdda6c8fe6f3254d547d249/href">https://medium.com/media/0c8f29073cdda6c8fe6f3254d547d249/href</a></iframe><p>Create another function named writeImage to write the image object into a file. After adding a watermark done, the App calls the function. (reflecting step 6 at pseudocode)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d7cbe677621a595975914a9c836afb1/href">https://medium.com/media/9d7cbe677621a595975914a9c836afb1/href</a></iframe><p>Once the sub-function available, it’s time to create the primary function named createWatermark. The function call readImage twice and then process steps 3 and 4. Lastly, the function call writeImage to write the output file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be66673d5929e1c4ff1ff477e0537658/href">https://medium.com/media/be66673d5929e1c4ff1ff477e0537658/href</a></iframe><p>The code commented by step 3 is showing where the Adding watermark process. In the code sample above, the App aligns the Logo in the center. You can adjust the position by modifying x and y value.</p><pre>offset := image.Pt(x, y)<br>x ==&gt; distance from left<br>y ==&gt; distance from top</pre><pre>image.Pt(0, 0) ==&gt; watermark at the very top-left</pre><p>Also, pay attention to code commented by step 4. You can change the opacity to match the product requirements.</p><pre>image.NewUniform(color.Alpha{255}) ==&gt; 100% solid<br>image.NewUniform(color.Alpha{128}) ==&gt; 50% opacity<br>image.NewUniform(color.Alpha{64}) ==&gt; 25% opacity<br>image.NewUniform(color.Alpha{0}) ==&gt; transparant</pre><p>The function createWatermark is working independently. Any package can import the function. In this sample to make a portable Go app, we need to create main function that reads the user inputs (as flags) and passes it to the function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d2b361b604474b8f9d84beda3ee3de7d/href">https://medium.com/media/d2b361b604474b8f9d84beda3ee3de7d/href</a></iframe><h3>Run the App</h3><p>Build the code into a Go app using the following Go Command.</p><pre>go build -o watermark</pre><p>Prepare two images files for the base image and the logo image. Named the files as base.jpg and mark.png respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLYArfjorVFNDU_414B_0g.png" /><figcaption>The base image at the left and logo image at the right.</figcaption></figure><p>Now, run the go app and pass the image filename to the right flag.</p><pre>./watermark -base=base.jpg -mark=mark.png -output=out.jpg</pre><p>The App creates the output with the name out.jpg in the same folder as the Go app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SOAKx66-mJRAkqypqJzjcw.png" /><figcaption>Watermarked image. Astronaut with a confidential label.</figcaption></figure><h3>Summary</h3><p>Implementation of watermark adds protection from content misuse and excellent auditing tool. Looking at the code above — the effort to implement a watermark is pretty simple. If your business/product is communicating with other parties, then the watermark is a must.</p><blockquote>Full Code: <a href="https://github.com/purnaresa/secureme/tree/master/watermark">Git Repository</a></blockquote><p>The sample in this article is to create a Go app. But the function itself is also able to be placed in any existing Go app.</p><p>What’s next? Do you also have a PDF that needs to have a watermark?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fb2a0d6%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fb2a0d6%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href">https://medium.com/media/0707f5c806284d01a4a13c7b13a91ce3/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80f7ee15003b" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/build-image-watermark-app-for-branding-or-security-purpose-in-go-80f7ee15003b">Build Image Watermark App For Branding or Security Purpose in Go</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>