<?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 S Poon on Medium]]></title>
        <description><![CDATA[Stories by S Poon on Medium]]></description>
        <link>https://medium.com/@shiufunpoon?source=rss-1957943d3262------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F1gPqCbPHC-PPwwvipzfIg.jpeg</url>
            <title>Stories by S Poon on Medium</title>
            <link>https://medium.com/@shiufunpoon?source=rss-1957943d3262------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:17:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shiufunpoon/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[Mutual TLS (mTLS) Isn’t Enough]]></title>
            <link>https://medium.com/@shiufunpoon/mutual-tls-mtls-isnt-enough-be5a67da470d?source=rss-1957943d3262------2</link>
            <guid isPermaLink="false">https://medium.com/p/be5a67da470d</guid>
            <dc:creator><![CDATA[S Poon]]></dc:creator>
            <pubDate>Fri, 20 Sep 2024 03:39:29 GMT</pubDate>
            <atom:updated>2024-09-20T03:39:29.125Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*MouwdcZKRMFu1oUO1VQz6Q.png" /><figcaption>Who are you shaking hands with?</figcaption></figure><p>In my previous two articles, I highlighted the strengths of mutual TLS (mTLS) for securing communication. However, mTLS alone isn’t sufficient to guarantee true security. Let’s break down why.</p><p>At its core, mTLS ensures both the client and the server participate in a secure handshake. During this handshake, each side presents its credentials, and once this is done, the communication is encrypted using a shared secret, known only to both parties. While this secures the data in transit, there’s a critical element missing: <strong>trust verification</strong>.</p><p>Imagine Alice and Bob — two common names. Alice from Canada is not the same as Alice from Mexico, and Bob from the USA is not Bob from Hong Kong. In the context of mTLS, when Alice from Mexico attempts to connect with Bob from the USA, both parties must verify each other’s credentials to ensure they’re communicating with the correct person. If Alice doesn’t verify Bob’s identity, and vice versa, they can’t be 100% certain of who they’re really talking to, even though the communication itself is encrypted.</p><p>Failing to verify these credentials means you’re blindly trusting the other party, leaving your system vulnerable to impersonation attacks. Here are two common methods for ensuring proper verification, both of which are sometimes overlooked:</p><h3>1. Verification at the Handshake Level</h3><p>During the TLS handshake, both parties can cross-check each other’s credentials using a trusted list or certificate authority. If either side’s credentials fail verification, the handshake is aborted. This method leverages built-in TLS protocols that are widely supported.</p><h3>2. Verification at the Application Level</h3><p>In some cases, it may not be feasible to perform verification during the handshake. Instead, verification can happen afterward at the application level. In this scenario, the handshake completes successfully, but the application itself enforces credential checks. If the verification fails, the application can terminate the connection.</p><p>Both methods have their pros and cons, depending on the use case. However, skipping the verification step altogether leaves your communication open to attack, despite the presence of mTLS. Always ensure that you’re validating the identity of the party you’re communicating with, whether during the handshake or within the application logic.</p><p>In summary, while mTLS provides encryption and protection for data in transit, it is only truly secure when coupled with proper peer verification. No matter which method you choose, ensuring that this step is in place is critical to securing your communication.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be5a67da470d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing Between mTLS and JWT over TLS: A Practical Guide For Securing IBM APIC Subsystems]]></title>
            <link>https://medium.com/@shiufunpoon/choosing-between-mtls-and-jwt-over-tls-a-practical-guide-for-securing-ibm-apic-subsystems-cf97aac8c1b0?source=rss-1957943d3262------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf97aac8c1b0</guid>
            <category><![CDATA[ibm-apic]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[options]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[tlm]]></category>
            <dc:creator><![CDATA[S Poon]]></dc:creator>
            <pubDate>Wed, 29 May 2024 03:24:01 GMT</pubDate>
            <atom:updated>2024-09-20T19:09:52.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*GX4g-XDCFMkvsC61gPYXeg.png" /></figure><p>In a previous article on <a href="https://medium.com/@shiufunpoon/secure-communications-between-components-in-ibm-api-connect-cb5a67684643">secure communication between subsystems in IBM API Connect (APIC)</a>, an interesting discussion emerged about when to use mutual TLS (mTLS) versus JSON Web Tokens (JWT) over TLS.</p><p>Both methods aim to verify the caller’s identity — the key difference lies in how this verification is accomplished.</p><p>For clarity, we won’t delve into how both methods enable the caller to verify the target’s identity, as this is common in both options above.</p><p>In this article, I’ll decipher the differences and considerations for these 2 options, mTLS vs JWT over TLS.</p><p>Before we start, let’s recap what each does.</p><p>mTLS builds on the standard TLS protocol by requiring the client and the server to present certificates for mutual authentication. This ensures both parties are who they claim to be, establishing a two-way authenticated connection. On a very high level, the following happens between APIc Manager, Gateway, and Analytics components with using mTLS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4O6BA-gNEx71yLI2-CC3A.png" /></figure><p>JWT over TLS, on the other hand, involves the sender sending a signed JWT token to the recipient over a secure TLS connection. The recipient will verify the JWT using the corresponding JSON Web Key (JWK) exposed by jwks_uri. (in IBM APIC, this will be a platform API /api/cloud/oauth2/certs). Let’s redraw the above scenario with JWT over TLS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etvb1ujbd3AJzbIZsPWWWQ.png" /></figure><p>There are pros and cons to each of the above options, and which option to choose will depend on the topology of the network and the company security guidelines.</p><p>Let’s talk about the pros and cons of mTLS.</p><p><strong>Pros:</strong></p><ul><li>mTLS provides strong, mutual authentication by requiring both parties to authenticate each other</li><li>mTLS ensures a high level of security and makes it suitable for scenarios where robust authentication is critical</li></ul><p><strong>Cons:</strong></p><ul><li>Managing certificates is complex: mTLS adds another layer of Public Key Infrastructure (PKI) management, including certificate issuance, renewal, and revocation</li><li>Certificates have expiration dates and require specific extensions (e.g., basicConstraints, keyUsage, extendedKeyUsage, and SAN — to name a few) to function correctly</li><li>Firewalls and load balancers can complicate mTLS setups. If a firewall or load balancer does not support passthrough, it must terminate the TLS connection, effectively breaking the mTLS and necessitating a new mTLS connection to the gateway. This breaks the direct trust relationship between the APIC Manager and the Gateway in the above example</li></ul><p>JWT over TLS has its pros and cons as below.<br><strong>Pros</strong>:</p><ul><li>Simplifies firewall and load balancer configurations: JWT tokens can be easily forwarded across different network segments without breaking the secure connection</li><li>Reduces the complexity of managing PKI since only the server’s certificate needs to be managed, not the client’s</li></ul><p><strong>Cons</strong>:</p><ul><li>The gateway and the analytics must access the JSON Web Key Set (JWKS) URI from the manager to retrieve the necessary keys for verifying the JWT. If either gateway or analytics cannot access the JWKS_URI, token verification will fail, potentially disrupting the application API traffic and causing an outage. In the mTLS scenario, gateway can communicate with analytics, without the manager, thus ensuring the continued handling of the application API traffic</li><li>Verification of the sender’s credential is on the application, not on the protocol layer, like TLS</li></ul><p>Either solution protects communication between the components, and it is up to you to decide what will work best. IBM APIC provides flexibility, and it is up to you to utilize the feature during the deployment of the gateway to ensure secure communication between the components. For more information, please refer to the latest product documentation on <a href="https://www.ibm.com/docs/en/api-connect/10.0.x?topic=subsystems-installing-datapower-gateway-subsystem">how to setup the gateway to be used by IBM API Connect</a>.</p><p>The next and last article in this series covers an interesting topic, is mTLS enough? In this series, I mentioned enabling mTLS. Within that enabling mTLS , there is a hidden assumption that the mTLS is configured correctly, without the proper configuration, mTLS is just an untrusted secure pipe allowing untrusted data to flow through. <a href="https://medium.com/@shiufunpoon/mutual-tls-mtls-isnt-enough-be5a67da470d">Mutual TLS Isn’t Enough</a> will cover this implied assumption that needs its callout.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf97aac8c1b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure communications between components in IBM API Connect]]></title>
            <link>https://medium.com/@shiufunpoon/secure-communications-between-components-in-ibm-api-connect-cb5a67684643?source=rss-1957943d3262------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb5a67684643</guid>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[trust]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[secure-communication]]></category>
            <dc:creator><![CDATA[S Poon]]></dc:creator>
            <pubDate>Sat, 25 May 2024 02:19:56 GMT</pubDate>
            <atom:updated>2024-09-20T19:08:32.405Z</atom:updated>
            <content:encoded><![CDATA[<p>In IBM API Connect (APIc), there are four main components: Manager, Portal, Analytics, and Gateway. Each plays a crucial role in the API ecosystem. The Manager is responsible for managing the environment, ensuring that all components function optimally. The Portal is where APIs are socialized, allowing developers to create applications that consume these APIs. Analytics gathers runtime data on API usage, performance, and issues, providing valuable insights for optimization. Finally, the Gateway is where the APIs are executed, acting as the entry point for all API traffic.</p><p>Given the critical functions of these components, it is essential to protect the communication between them. Ensuring secure communication is fundamental to maintaining the entire system&#39;s integrity, confidentiality, and reliability. Each component must be confident that it is communicating with the correct counterpart securely.</p><p>In IBM APIc, this security is achieved through Mutual TLS (Transport Layer Security) and/or JWT (JSON Web Token) over TLS communication. TLS ensures the data transmitted between components is encrypted, providing wire protection and server credential verification. Mutual TLS goes a step further by verifying the client’s credentials are verifiable, ensuring that both parties, client and server, are authenticated. Alternatively, JWT can be used to provide client credential verification within a TLS-protected channel, offering a flexible and robust method for securing communication between the 2 systems.</p><p>However, enabling mTLS or JWT is not sufficient if the certificate is not validated, or the JWT token is not verified. Proper certificate validation and token verification are crucial steps to ensure the security mechanisms are effective. To that end, I will dig deeper into this topic here.</p><p>The enterprise-grade DataPower is the gateway component for APIc. Customers can run DataPower by itself, as it is powerful and extremely capable, and can do more than protecting the API. IBM APIc Manager component can configure DataPower to be part of the IBM APIc API enforcement. This DataPower does not require to be a dedicated DataPower (imagine a physical DataPower appliance and part of its function is to be the enforcement gateway for IBM APIc)</p><p>As a security-conscious architect, it is imperative to ensure that the communication between systems is protected with mTLS or JWT over TLS.</p><p>The same rigorous security measures must be applied in this case to maintain the integrity and security of the APIc ecosystem.</p><p>It is a fair question to ask when this security must be ensured. Security must be ensured before the IBM APIc Manager registers the Gateway (i.e., DataPower). If the initial trust is not set up correctly, subsequent communications cannot be trusted.</p><p>This process is documented in detail <a href="https://www.ibm.com/docs/en/api-connect/10.0.x?topic=connect-configuring-datapower-api-gateway">here</a> (<a href="https://www.ibm.com/docs/en/api-connect/10.0.x?topic=connect-configuring-datapower-api-gateway">https://www.ibm.com/docs/en/api-connect/10.0.x?topic=connect-configuring-datapower-api-gateway</a>), specifically:</p><ul><li>Step 12, for mutual TLS.</li><li>Step 22, for enabling JWT. JWT is useful if mutual TLS is not feasible due to firewall constraints.</li></ul><p>For a production environment, it is vitally important that one of the protection methods, mutual TLS or JWT over TLS, is configured.</p><p>I would argue that for step 12, when setting up a production environment, do not disable the validation as suggested. The validation provides the verification of the caller’s identity between the two systems (Manager and Gateway). And a production system needs to ensure this.</p><p>For a test, staging, or a proof of concept environment, the ease of setting up the systems quickly will provide a more delightful experience. Disable the validation can be considered.</p><p>Personally, I do skip the validation if I am doing a proof of concept or setting up a test system. In this scenario, the goal is to demonstrate capabilities rather than handle real production traffic, and it is important to ensure a smooth and delightful demo and easy experience.</p><p>For a production system, however, it is crucial to ensure the system is set up securely from the beginning, validation must be enabled, and it is vital to set up mutual TLS and/or the JWT verification per the IBM APIc documentation.</p><p>Securing the deployment takes team effort, IBM API Connect provides the capability of allowing this to happen, and the rest is up to you to make the system secure. Let’s go TEAM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrY1WtAOTGG5LCrmRlhX9Q.png" /></figure><p>The author wants to thank Chris Phillips for pushing her on this topic, and for all the delightful discussions on this topic.</p><p>Update 5/25: I received a fair critique. The net is what if the initial trust is not set up for the production environment, and now the system is running faultlessly without the needed security — what then? In this unfortunate scenario, I recommend scheduling a time slot as you would have for a production environment upgrade, do plan for a downtime (like how you would when upgrading the system). During this time slot, enable either the mTLS or the JWKS_URI for JWT verification. And make sure the communication from the APIm to the Gateway is successful.</p><p>This turns out to be a series of articles all around the same area. If you are interested in deep dive into mTLS vs JWT (or both happily together), please see the next one, <a href="https://medium.com/@shiufunpoon/choosing-between-mtls-and-jwt-over-tls-a-practical-guide-for-securing-ibm-apic-subsystems-cf97aac8c1b0">Choosing between mTLS or JWT over TLS</a>. The next one uses IBM APIConnect as an example, the discussion is not limited to the IBM APIConnect.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb5a67684643" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thoughts about API Security]]></title>
            <link>https://medium.com/@shiufunpoon/thoughts-about-api-security-0eb08558541e?source=rss-1957943d3262------2</link>
            <guid isPermaLink="false">https://medium.com/p/0eb08558541e</guid>
            <dc:creator><![CDATA[S Poon]]></dc:creator>
            <pubDate>Mon, 13 May 2024 02:44:18 GMT</pubDate>
            <atom:updated>2024-09-20T15:14:35.368Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*Y0ILcZ0tnmqX6s6ok0uddQ.png" /></figure><p>APIs are integral to the digital infrastructure of any data-driven organization, facilitating smooth and effortless interaction between different software systems. However, the open and interconnected nature of APIs can expose them to various cyber threats. Effective API security measures are paramount for protecting sensitive data and maintaining operational integrity and customer trust.</p><p>In this article, I detail essential strategies and best practices for API security and explore the distinct challenges of <em>known</em> and <em>unknown</em> cybersecurity threats.</p><p>This article covers various phases of the API lifecycle, from development to runtime, highlighting the security implications at each phase. Additional insights are provided on how AI and LLMs can serve as powerful tools to enhance API protection.</p><p>Any feedback you have is welcome.</p><h3><strong>Development Phase</strong></h3><blockquote>The development phase is critical in establishing a secure foundation for APIs. During this stage, developers must implement a series of security measures designed to address known vulnerabilities and regulatory requirements effectively. Here are the <strong>7</strong> practices and strategies that should be integrated during the API development process.</blockquote><h4><em>Authentication and Authorization</em></h4><p>Securing API access begins with the appropriate level of authentication and authorization. OAuth and OpenID Connect (OIDC) are widely recognized standards that provide secure delegated access, allowing APIs to verify the identity of users and applications and determine the level of access they should be granted. These protocols help mitigate unauthorized access risks.</p><h4>Message Signing and Encryption</h4><p>To protect data integrity and confidentiality:</p><ul><li>Message Signing: Ensures that the messages have not been altered in transit. Implementing digital signatures helps in verifying the authenticity of the data received.</li><li>Encryption: Data should be encrypted both in transit and at rest. Transport Layer Security (TLS) should be enforced to secure data during transmission, while sensitive data stored should also be encrypted using strong encryption algorithms to protect it from unauthorized access.</li></ul><h4>Rate Limiting</h4><p>Rate limiting is essential for protecting APIs against Denial-of-Service (DoS/DDoS) attacks, which can overwhelm a system with a high volume of requests, leading to service disruption. By limiting the number of requests a user can make within a certain period, rate limiting helps maintain availability for all users. Rate Limiting must account for the complexity of execution of the APIs.</p><h4>Schema and Data Type Validation</h4><p>Validating input against a defined schema helps prevent common web vulnerabilities such as Cross-Site Scripting (XSS) and Cross-Site Request Forgery (CSRF). This involves checking that the data conforms to specified formats and types, ensuring that malicious input that could exploit vulnerabilities is blocked before processing.</p><h4>Data Redaction</h4><p>To prevent information leakage, sensitive data should be redacted from API responses when not necessary for the recipient. This practice is crucial in maintaining data privacy and is especially important in compliance with regulations like the General Data Protection Regulation (GDPR) and the Health Insurance Portability and Accountability Act (HIPAA), which require strict data handling procedures.</p><h4>Regulatory Compliance</h4><p>APIs that handle personal or sensitive information must comply with relevant legal and regulatory frameworks. During development, APIs should be designed to inherently support compliance features, such as data protection by default, audit trails for data access, and mechanisms for data deletion and portability as required by GDPR. Adhering to these regulations not only protects users’ data but also shields the organization from potential legal penalties.</p><h4>Ongoing Evolution and Maintenance</h4><p>The development phase does not conclude with the initial deployment of an API. Continuous development is necessary to address newly emerging threats and to incorporate additional features. Regular updates and patches are essential to fix vulnerabilities, and regression testing is crucial to ensure that new code changes do not reintroduce old vulnerabilities or create new security flaws. Furthermore, maintaining up-to-date documentation is vital for ensuring that all team members and users understand the API’s capabilities and security features.</p><h3>Hosting environment</h3><blockquote>The security of the hosting environment is a critical aspect of API runtime protection. This environment serves as the operational platform where APIs interact with applications, data, and users. Ensuring its security involves multiple layers of protection, from the physical infrastructure to the software and network configurations. Below are <strong>6</strong> key practices to secure the hosting environment effectively.</blockquote><h4>Secure Server Configuration</h4><p>The first step in securing the hosting environment is to ensure that all run-time environments are securely configured. This involves:</p><ul><li>Minimizing the Attack Surface: Removing or disabling unnecessary services, ports, and protocols that can be exploited. Each additional service increases the potential entry points for attackers.</li><li>Patch Management: Regularly updating all software to patch known vulnerabilities is crucial. This includes the operating system, application servers, and other software components that are part of the environment.</li><li>Hardening Security Settings: Apply security best practices to all components. This might include configuring proper access permissions, using secure configurations recommended by software vendors, and implementing strong password policies.</li></ul><h4>Network Security</h4><p>Protecting the network layer is essential for defending APIs from network-based attacks:</p><ul><li>Firewalls and Gateways: Deploying firewalls to filter incoming and outgoing traffic can help prevent unauthorized access. Properly configured firewalls ensure only traffic relevant to the API’s operation is allowed.</li><li>Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS): These systems monitor network traffic for suspicious activities and known attack patterns. IPS can also actively block attacks as they are detected.</li><li>Virtual Private Networks (VPN) and Secure Shell (SSH): For remote administration, using VPNs or SSH with strong encryption ensures that management operations are protected from interception.</li></ul><h4>Data Encryption</h4><p>To protect data in transit within the hosting environment and to external connections, encryption is indispensable:</p><ul><li>Transport Layer Security (TLS): Implementing TLS for all data transmitted over the network ensures that data cannot be intercepted or tampered with by malicious actors.</li><li>Encryption at Rest: Encrypting data stored on servers protects sensitive information from unauthorized access, even if physical security measures fail or if unauthorized access to the storage medium is obtained.</li></ul><h4>Environment Isolation</h4><p>Using virtualization and containerization technologies can significantly enhance the security of the hosting environment by isolating API services:</p><ul><li>Virtual Machines (VMs) and Containers: Running APIs in VMs or containers can isolate them from each other and the underlying host system. This isolation helps contain potential breaches to a single instance, preventing them from spreading to the entire network.</li><li>Management of Container Images: Ensure that container images are obtained from reputable sources, regularly scanned for vulnerabilities, and kept up to date.</li></ul><h4>Monitoring and Logging</h4><p>Continuous monitoring and comprehensive logging are crucial for detecting and responding to security incidents:</p><ul><li>Real-time Monitoring: Implementing tools that provide real-time insights into the system’s operation can help detect anomalies that may indicate a security breach.</li><li>Audit Logs: Maintaining detailed logs of all operations, including API access and administrative actions, allows for forensic analysis following an incident and helps in understanding the attack vectors.</li></ul><h4>Compliance and Best Practices</h4><p>Adhering to established security standards and compliance requirements is necessary for maintaining the integrity of the hosting environment. Regular security audits by internal teams or external security experts can help identify potential weaknesses and recommend improvement.</p><h3>Runtime Security</h3><blockquote>Run-time security for APIs is where carefully planned development best practices are truly tested against real-world scenarios. This phase is crucial because it involves active monitoring and defending of the APIs as they interact with users and systems, facing both anticipated and unanticipated threats. Effective run-time security must seamlessly integrate the foundational security practices established during the development phase, while also adapting to and mitigating unforeseen challenges and vulnerabilities.</blockquote><blockquote>On high level, I will separate this area in 4 buckets, known-knowns, known-unknowns, unknown knows, and unknown unknows, with 4 key practises to ensure the best outcome.</blockquote><ul><li><em>Known-Knowns</em>: These are threats with well-understood impacts and mitigations, such as DDoS attacks, which can be countered by implementing rate limiting and network traffic management.</li><li><em>Known-Unknowns</em>: Risks anticipated but not yet encountered, like zero-day exploits, can be mitigated through strategies like regular security audits and adopting a zero-trust architecture.</li><li><em>Unknown-Knowns</em>: These include vulnerabilities that exist within the system but not yet identified by the security team. Techniques like comprehensive logging and transaction monitoring can help uncover these hidden risks.</li><li><em>Unknown-Unknowns</em>: These represent a significant challenge because they are risks that are not anticipated or understood until they materialize. For API providers, this category is particularly perilous as it can lead to unexpected security breaches with potentially severe consequences.</li></ul><h4>Integration of Development Best Practices</h4><p>Run-time security is effectively the operational phase where the robustness of development practices such as authentication, authorization, data validation, and encryption is put to the test:</p><ul><li>Authentication and Authorization: Ensuring that OAuth and OIDC mechanisms are actively managing access rights and verifying user identities in real-time.</li><li>Data Encryption and Validation: Continuously enforcing encryption standards for data in transit and rigorously validating data against schemas to prevent injection attacks and data corruption.</li></ul><p>The effectiveness of these measures during run-time is indicative of the thoroughness of the development phase. Any weaknesses in these areas can lead to vulnerabilities during operation, emphasizing the need for rigorous development and regular updates.</p><h4>Addressing Unknowns with Advanced Technologies</h4><p>While development best practices can mitigate known threats, the “unknown unknowns” — those threats that are unforeseeable and uncharacterized — present a unique challenge during run-time. This is where advanced technologies, particularly AI, play a pivotal role.</p><ul><li>AI and Machine Learning for Anomaly Detection: AI technologies are increasingly being used to identify unusual patterns that deviate from normal API usage, which could indicate a security threat. Machine learning models can analyze vast amounts of transaction data in real-time to detect anomalies that signify potential attacks, such as unusual access patterns or spikes in data requests that could suggest a breach attempt. Example: An AI system might detect that an API endpoint that typically receives data requests from a specific geographic region or with a specific format, begins receiving a high volume of requests from an unusual location or with unexpected patterns, triggering an alert for potential malicious activity.</li><li>Automated Threat Response: AI can be used to automate responses to detected threats, enabling quicker mitigation and reducing the window of opportunity for attackers. This can include temporarily blocking suspicious IP addresses or automatically applying additional security checks.</li><li>Predictive Security Postures: Leveraging predictive analytics, AI can forecast potential vulnerabilities based on emerging trends and past incidents, allowing organizations to proactively adjust their security postures before an actual threat manifests.</li></ul><h4>Continuous Testing and Adaptation</h4><p>Given that new vulnerabilities can emerge after an API goes into production, continuous testing and adaptation are crucial:</p><ul><li>Integration of Security into CI/CD Pipelines: Continuous Integration and Continuous Deployment (CI/CD) pipelines should include automated security testing tools such as SAST and DAST to continuously assess the security of APIs even after deployment.</li><li>Penetration Testing: Regularly scheduled and on-demand penetration tests can help uncover vulnerabilities that might not be detected by automated systems, particularly in complex API ecosystems.</li></ul><h4>The Role of Security Simulations</h4><p>Security simulations, including red team exercises and breach attack simulations, can provide a dynamic testing environment to evaluate the effectiveness of all run-time security measures. These simulations help identify both strengths and weaknesses in the API security strategy, offering insights that can be used to fortify the API against both known and unknown threats.</p><h3>Discovery of Unknown APIs</h3><blockquote>Undocumented or rogue APIs represent a significant security vulnerability within an organization’s API ecosystem. These are APIs that have either been developed outside of standard governance and security protocols, have become obsolete and forgotten, or have been intentionally hidden. They pose a substantial risk because they may not adhere to the rigorous security standards applied to known and documented APIs and can provide backdoor access to sensitive systems and data. The role of automated discovery tools can mitigate this risk. The tools can provide the following 4 benefits, it can be used as an security auditing tools to give a comprehensive overview of a company’s environment.</blockquote><h4>Continuous Scanning</h4><p>Automated tools scan the network continuously to detect any active APIs that are operating within the IT environment. This includes those that are not documented in the API inventory.</p><h4>Behavior Analysis</h4><p>Some advanced tools use behavior analysis techniques to observe how APIs interact with other systems and data flows. This method helps in identifying unusual patterns that might suggest the presence of a rogue API.</p><h4>Integration with API Gateways</h4><p>Discovery tools can be integrated with API gateways to ensure that any API passing through the gateway is registered and documented. This helps in maintaining a complete and updated list of all APIs.</p><h4>Security Assessment</h4><p>Once an undocumented or rogue API is discovered, these tools can assess the API for vulnerabilities or misconfigurations and recommend or enforce immediate remedial actions.</p><h3>Governance and Compliance</h3><blockquote>Ensuring that API management aligns with organizational governance and regulatory compliance is essential. Regular audits and compliance checks should be integrated into the API lifecycle to address any discrepancies.</blockquote><h3>Security Posture Management</h3><blockquote>Security posture management is a crucial component of a robust API security strategy. It encompasses continuous monitoring, assessment, and enhancement of the security measures protecting APIs. This proactive approach is vital to maintaining a resilient defense against evolving cyber threats and ensuring that APIs remain secure throughout their lifecycle. This is a tedious process that emcompasses policy management, automated policy enforcement and incident response. AI is perfectly fit in helping companies address this challenges in the following 6 key areas</blockquote><h4>Enhanced Anomaly Detection</h4><p>AI algorithms excel at identifying patterns and anomalies in large datasets. In the context of API security, AI can analyze vast amounts of network traffic and API usage data to detect anomalies that may indicate a security threat, such as unusual access patterns, higher-than-normal data retrieval rates, or suspicious transactions from atypical geographic locations. This capability allows for early detection of potential security incidents before they escalate into serious breaches.</p><p>Example: AI systems can learn the normal behavior of each API endpoint and user interactions. Any deviation from these patterns, like access at odd hours or unusually large data transfers, can trigger alerts for further investigation.</p><h4>Predictive Threat Intelligence</h4><p>AI can be used for predictive analytics in security, where it helps predict potential attacks based on current trends and historical data. Analyzing historical security incidents and ongoing attack strategies, AI models can forecast likely future threats and suggest preemptive measures to mitigate these risks.</p><p>Example: If an AI system notices an increase in API calls that try to exploit a specific vulnerability across the industry, it can alert administrators to fortify defenses against this type of attack, even before it directly targets the organization’s APIs.</p><h4>Automated Incident Response</h4><p>AI can automate certain aspects of the incident response process. Upon detecting a potential threat, AI-driven systems can initiate predefined response protocols, such as temporarily restricting access to sensitive data, blocking IPs associated with malicious activities, or even rolling back transactions that appear fraudulent.</p><p>Example: In case of detection of a potential data breach, an AI system can automatically revoke access tokens, force logouts, and require password resets, significantly reducing the window for data exfiltration.</p><h4>Continuous Security Policy Enforcement</h4><p>AI can help enforce security policies across API usage by automatically applying security rules based on the context of the transaction and user behavior. This includes dynamic access controls, adaptive authentication, and more granular data protection measures based on real-time risk assessment.</p><p>Example: If an AI system detects that a session originates from a high-risk location or device, it can enforce additional authentication steps or limit the data visibility for that session.</p><h4>Security Optimization</h4><p>AI algorithms continuously learn from new data, which means they can help optimize security measures by identifying inefficiencies or outdated protocols in the current security framework. This ongoing learning process allows organizations to stay ahead of attackers by constantly evolving their security practices.</p><p>Example: AI-driven analysis might reveal that certain encryption techniques are consistently being bypassed by new malware. The system could then recommend more robust encryption methods or additional security layers.</p><h4>Scalability and Adaptability</h4><p>As API ecosystems grow, manually managing security at scale becomes impractical. AI systems can scale as the number of API endpoints and the volume of traffic increases, ensuring consistent security monitoring without requiring proportional increases in human resources.</p><p>Example: AI systems can manage thousands of endpoints simultaneously, applying uniform security measures and adjusting protections as new endpoints are added or existing ones are modified.</p><h3>Reconnaissance Threats</h3><blockquote>Reconnaissance activities by potential attackers involve probing APIs to discover their structure, functionalities, and vulnerabilities. This preliminary step is crucial for attackers as it helps them plan effective exploits. To safeguard APIs from such activities, organizations must strategically limit the information exposure and employ deception techniques. There are 2 typically well established strategies to address this and how AI can provide the additional capabilities for company to address this specific threats. The 3 strategies are:</blockquote><h4>Limiting Information Exposure in Error Messages</h4><p>Error messages can inadvertently provide attackers clues about the backend systems, the architecture, or even the security measures in place. For instance, a detailed error message could reveal database names, server types, or programming languages used, which could be exploited by an attacker.</p><p>A best practice is to use generic error messages, similar to “Your request could not be processed.”, but with a detailed internally logged message that does not expose sensitive data, for authorized users to review.</p><p>AI can be used to dynamically generate context-aware error messages and minimize information leakage. LLM can be trained to analyze the type of user and the behavior patterns to determine the level of detail in an error message, reducing potential information exposure to suspicious users. Using natural language processing, AI can understand the context of the error and tailor the message to be helpful to legitimate users while withholding information that could benefit attackers.</p><h4>Employing Deception Technologies</h4><p>Deception technologies, such as (static/dynamic) honeypots are designed to mislead attackers by mimicking real systems. These are typically isolated and monitored environments that look like part of the network but are, in fact, traps for capturing information about the attackers’ methods and intentions.</p><p>AI can transform honeypots from passive to active defense tools. By employing machine learning algorithms, honeypots can adapt to the attacker’s tactics, offering more realistic interactions that can mislead attackers more effectively and for longer periods, gathering extensive data about their strategies.</p><h4>Predictive Analysis for Threat Detection</h4><p>AI can predict potentially malicious activities by analyzing trends and patterns in API access logs. This can help identify reconnaissance activities early, even before any real attack is attempted.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0eb08558541e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Well, Chrome is doing the right thing, so let’s circumvent it]]></title>
            <link>https://medium.com/@shiufunpoon/well-chrome-is-doing-the-right-thing-so-lets-circumvent-it-cac362a837c9?source=rss-1957943d3262------2</link>
            <guid isPermaLink="false">https://medium.com/p/cac362a837c9</guid>
            <dc:creator><![CDATA[S Poon]]></dc:creator>
            <pubDate>Tue, 26 May 2020 23:47:54 GMT</pubDate>
            <atom:updated>2020-05-26T23:47:54.822Z</atom:updated>
            <content:encoded><![CDATA[<p>Working in the area of security, and also being an engineer doing active development, it is extremely helpful if I can by-pass the browser’s security during the development phase.</p><p>Chrome is a browser that I use a lot. And kudos to the team who develop Chrome, they no longer allow the user to bypass the security check if there is an issue with the TLS server credential.</p><p>As a user, I used to be able to click on Advanced , and trust the whole wide world — and I can give up the security, all in the name of development and testing.</p><p>But that is no longer possible with Chrome.</p><p>Today, we will see this warning if there an issue with the TLS server credential.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RKqU8kaOt4m0TI3o4Gtyw.png" /></figure><p>However, during the development phrase, using openssl to create a valid certificate chain for a server is really not a fun/quick exercise.</p><p>So here is a trick that you can use to by-pass the security check (other than switching to Firefox — which is also a valid option :-)).</p><p>Whenever you see the above, just type in ‘thisisunsafe’ at the browser — viola, you just bypass the excellent security check that Chrome has built.</p><p>Well, as a developer/architect, one has to do what one has to do, in order to make the deadline.</p><p>And be warned — only do the above if you know exactly what you are giving up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cac362a837c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS — It went wrong, now what]]></title>
            <link>https://medium.com/@shiufunpoon/tls-it-went-wrong-now-what-e4c9cd27dd0?source=rss-1957943d3262------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4c9cd27dd0</guid>
            <dc:creator><![CDATA[S Poon]]></dc:creator>
            <pubDate>Fri, 17 Apr 2020 01:09:30 GMT</pubDate>
            <atom:updated>2020-04-17T01:09:30.836Z</atom:updated>
            <content:encoded><![CDATA[<h3>TLS — It went wrong, now what</h3><p>Transport Layer Security (TLS) is amazing, when it works. When it is not working, it is painful to debug.</p><p>I will show you how to use OpenSSL as a testing tool.</p><p>If the communication is a one-way TLS, there is no need to provide the TLS client’s private and public key.</p><p>The command to use :</p><blockquote>openssl s_client -connect &lt;servername&gt;:&lt;port&gt; -tls1_2 -servername &lt;servername&gt;</blockquote><p>This will force the OpenSSL to use TLS 1.2, and with the Server Name Indication feature enabled.</p><p>Below is an example using cnn.com:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul9wUoWF7DopKEFtjNgytQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JQhLL8kg1LVLH6_6VkOd0w.png" /></figure><p>A successful handshake will put the terminal/session in a seemingly suspend state like the above.</p><p>However, if the TLS server is configured for mutual TLS, which means the server requires the client to send in the client’s credentials, the OpenSSL command must include additional parameters for the private key, public key and the issuer’s CA certificate(s). The following assumes the materials are all in pem format. If the key material is in a different format, you can add additional parameters to indicate what the format the file is in.</p><blockquote>openssl s_client -connect &lt;servername:port&gt; -tls1_2 -servername &lt;servername&gt; -key &lt;private_key&gt; -cert &lt;public_cert&gt; -CAfile &lt;ca-file&gt;</blockquote><p>Whether or not the one-way TLS or mutual TLS is used, the end result is the same, if the connection is successful, the terminal/session is in a suspend state.</p><p>If the connection terminates immediately, and you fall-back to the command prompt, the TLS communication is not established successfully. The below screenshot highlights this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*S2mXzBFvlUzDQlln1O3_Xw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4c9cd27dd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>