<?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 Doug Merrett on Medium]]></title>
        <description><![CDATA[Stories by Doug Merrett on Medium]]></description>
        <link>https://medium.com/@doug-merrett?source=rss-3872e40ff3f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Kple0kpovc-ijPplT_53ZA.png</url>
            <title>Stories by Doug Merrett on Medium</title>
            <link>https://medium.com/@doug-merrett?source=rss-3872e40ff3f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 23:16:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@doug-merrett/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[Salesforce Whole Database Encryption — Final Update]]></title>
            <link>https://doug-merrett.medium.com/salesforce-whole-database-encryption-final-update-30c518822d8e?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/30c518822d8e</guid>
            <category><![CDATA[salesforce-admin]]></category>
            <category><![CDATA[salesforce-architect]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <category><![CDATA[salesforce-encryption]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 04:24:36 GMT</pubDate>
            <atom:updated>2026-02-24T04:27:35.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A picture of Scrabble tiles spelling Encryption" src="https://cdn-images-1.medium.com/max/1024/0*L0KSoZ_PDuJsW6R5" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I wrote an article last year about the new capability rolling out across Hyperforce for customers who have Platform Encryption. I quoted from the release notes saying that if you use the feature, your old data will not be encrypted.</p><p>I spoke with the Salesforce Product Manager for Platform Encryption earlier this year, a great guy who I have known for many years going back to my Salesforce employee days, and he told me that the quote I highlighted was a mistake with the release notes. All the existing data <em>will </em>be encrypted, it just will take some time. The reason that it will take time is that when a record is updated, that database fragment that contains it will be encrypted on save. The same happens for new data, the fragment that contains it will be encrypted on save. Even without these updates, the old data will get encrypted as there is a background engine that will trawl through and update the older fragments over time. A Sync button is in the works and should be released this calendar year (safe harbour), so you will be able to control when this job kicks off. A percent complete value is also in the works, however may not make the first release of the Sync button.</p><p>Details here: <a href="https://help.salesforce.com/s/articleView?id=xcloud.security_shield_pe_tenant_level_encryption_process_flow.htm&amp;type=5">https://help.salesforce.com/s/articleView?id=xcloud.security_shield_pe_tenant_level_encryption_process_flow.htm&amp;type=5</a></p><p>So if you are interested in having your org completely encrypted, not just some fields, whole org encryption is the way to go.</p><p>Please see my previous post for more information: <a href="https://doug-merrett.medium.com/salesforce-platform-encryption-major-update-179543fade78">https://doug-merrett.medium.com/salesforce-platform-encryption-major-update-179543fade78</a></p><p>The reason I posted this correction as a new post as well as correcting the original post is that if you follow me to get updates, you would not have seen the updates to the previous post as Medium does not highlight when folks update posts…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30c518822d8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Connected Apps, API Access Control and SOAP API Login calls — The Final Update]]></title>
            <link>https://doug-merrett.medium.com/salesforce-connected-apps-api-access-control-and-soap-api-login-calls-the-final-update-f4a7a0711eb2?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4a7a0711eb2</guid>
            <category><![CDATA[salesforce-integration]]></category>
            <category><![CDATA[salesforce-api]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Wed, 19 Nov 2025 22:28:57 GMT</pubDate>
            <atom:updated>2025-11-19T22:30:53.445Z</atom:updated>
            <content:encoded><![CDATA[<h3>Salesforce Connected Apps, API Access Control and SOAP API Login calls — The Final Update (hopefully)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lol2Zj8vQVkGBTOE" /><figcaption>Photo by <a href="https://unsplash.com/@epicuros?utm_source=medium&amp;utm_medium=referral">Vasilis Caravitis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As I have mentioned for a while, I am a huge fan of the <strong>API Access Control</strong> feature of Salesforce as it controls all API access to your org — Connected Apps and SOAP Apps (External Client Apps are already protected). However, it is not activated by default in your org — you need to ask Salesforce Tech support to activate it for you.</p><p>Then you need to follow the best practice of <em>Installing </em>all your Connected Apps and changing their policy to only allow Admin approved users to use that app.</p><p>Salesforce released changes in September 2025 to stop any user from connecting any new Connected App to your org, which is a great boost to security; however, if you had API Access Control set up correctly, this would would have stopped that anyway.</p><p>The second benefit of API Access Control is that it blocks the SOAP <em>login </em>authentication flow, so if you had an app that needed to use SOAP to authenticate, you needed to give that integration user the <em>Use Any API Client</em> permission. This permission overrides the API Access Control’s blocking of SOAP login; however it also overrode the ability to stop that user from connecting any new Connected App to your org. Salesforce decided that the <em>Use Any API Client</em> permission had to go to prevent the connection of new Connected Apps to your org — however, this would have also meant that customers that had been using API Access Control to block SOAP <em>login </em>apps would have had to lose that feature as they would have to disable API Access Control for everyone to allow that one or two approved SOAP Apps to connect.</p><p>After a few folks (me included) raised the point that by deprecating the <em>Use Any API Client</em> permission actually decreased security, Salesforce paused the deprecation and yesterday (19th November 2025) Salesforce announced that the <em>Use Any API Client</em> permission will stay; however it will have the ability to allow new Connected Apps to connect removed.</p><p>This is a fantastic result as it now allows customers who want to block all SOAP <em>logins </em>except for approved SOAP Apps, to continue to use the API Access Control feature and the <em>Use Any API Client</em> permission override to do so.</p><p>Why is this a big issue? Microsoft Entra (aka Azure AD) SCIM integration that allows Entra to provision and deprovision users in Salesforce when they are added to or removed from certain groups in Entra uses SOAP to connect. This capability is used by many Salesforce customers so they would have been left in a less secure state if Salesforce just removed the <em>Use Any API Client</em> permission. Also, many corporate accounts have used SOAP in the past to connect to Salesforce for internal integration.</p><p>If you have SOAP Apps, you need to start to work towards migrating them to use OAuth to authenticate as Salesforce is removing the SOAP <em>login </em>capability from all supported API versions in mid 2027.</p><p>In the meantime, secure your org from rogue SOAP connections that just need a username and password (and security token) to connect by using the API Access Control feature; give approved SOAP App API users the <em>Use Any API Client</em> permission; restrict each SOAP App API user to just the bare minimum of object and field access as well as the minimum system permissions needed to do their job; use IP restrictions for that user to limit access from just the external server that is needing to call Salesforce’s SOAP API; and lastly use Mutual TLS handshakes for the external app (if supported). The last two mitigations add an important extra layer of security.</p><p>If you found this useful, please give it a <em>clap </em>or share it. If you have any comments, please let me know below. If you would like to chat with me around anything Salesforce security related or would like to discuss getting a security assessment of your Salesforce org, please reach out to me at doug@platinum7.com.au. Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4a7a0711eb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Connected Apps, API Access Control and SOAP API Login calls — An Update]]></title>
            <link>https://doug-merrett.medium.com/salesforce-connected-apps-api-access-control-and-soap-api-login-calls-an-update-b6e377f4c7ac?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6e377f4c7ac</guid>
            <category><![CDATA[salesforce-architect]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <category><![CDATA[salesforce-api]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Thu, 16 Oct 2025 11:03:23 GMT</pubDate>
            <atom:updated>2025-11-17T00:40:00.922Z</atom:updated>
            <content:encoded><![CDATA[<h3>Salesforce Connected Apps, API Access Control and SOAP API Login calls — An Update</h3><h4>What has recently changed regarding API Access to Salesforce and how to continue to protect your data</h4><figure><img alt="Chain links" src="https://cdn-images-1.medium.com/max/1024/0*KDSGvSKpa_j5VmSJ" /><figcaption>Photo by <a href="https://unsplash.com/@epicuros?utm_source=medium&amp;utm_medium=referral">Vasilis Caravitis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I have written before about API Access Control and how it is good for security as it is an auto block for unknown connected apps and it also blocks any apps that use the SOAP API <em>login </em>call authentication method.</p><p>The <em>Allow any API Client </em>permission allows the assigned integration user to use the SOAP API <em>login </em>call authentication method and also bypass the unknown connected apps restriction of API Access Control.</p><p>Salesforce is planning in early November 2025 to deprecate the <em>Allow any API Client </em>permission which is used by customers that have enabled API Access Control to allow SOAP API apps to connect. If you have enabled API Access Control and you have used the <em>Allow any API Client </em>permission to grant access to an integration user, you will need to disable API Access Control after the <em>Allow any API Client </em>permission is deprecated. This is generally not a great issue now, as the new standard Salesforce connected app security capabilities mean that your org is secure as you have already blocked or installed all connected apps and granted access via profiles and/or permission sets.</p><p>However, the challenge is how to block SOAP API <em>login </em>call authentication since Salesforce will not fully deprecate that until mid 2027.</p><p>Salesforce has deprecated the SOAP API <em>login </em>call for authentication in the current Winter 26 release (even though the Winter 26 API Version 65 WSDL still contains the <em>login </em>call) and will be deprecating the SOAP API <em>login </em>call for authentication in all existing API versions 31 to 64 inclusive in the Summer 27 release due mid 2027. Blocking the SOAP API <em>login </em>call for authentication is a good thing as you cannot control access as well as you can with connected apps that use OAuth authentication.</p><p><em>Allow any API Client </em>lets a user bypass the connected apps security as well as authenticate using the SOAP API <em>login </em>call, so it has negative side effects and is not perfect, however without it, customers will have to disable API Access Control and all valid SOAP API <em>login </em>calls will be accepted. This means that users with the <em>API Access </em>permission and Salesforce username/password credentials can connect any app that uses the SOAP API <em>login </em>call for authentication. The Salesforce Data Loader app has this capability as well as OAuth authentication.</p><figure><img alt="Salesforce Data Loader login screen showing Username Password authentication" src="https://cdn-images-1.medium.com/max/586/1*LYl6wMISnxvHO_PTXzgxOg.png" /></figure><p>At present, the only way to secure your org against users using SOAP API <em>login </em>authentication is to enable API Access Control; however if you have an approved app that uses SOAP API <em>login </em>authentication you will not be able to provide an override come early November — which only leaves a very few days for you to rewrite the authentication into an OAuth flow. I have documented one method in this <a href="https://doug-merrett.medium.com/java-wsc-jwt-and-connected-apps-for-salesforce-5c0446263f21">blog article</a>.</p><p>If you cannot update the app as it is an external one (Microsoft Entra aka AzureAD provisioning and deprovisioning of users is an example) which uses SOAP API <em>login </em>authentication, you’re out of luck and will have to allow all SOAP API <em>login </em>authentication moving forwards until mid 2027 by disabling API Access Control.</p><p>I have raised this concern with Salesforce and hope that they will create a new permission that just allows SOAP API <em>login </em>authentication which can be leveraged with API Access Control to block unapproved connections, however let approved ones authenticate. Updates on this to follow…</p><p>Update November 2025: The deprecation of the <em>Allow any API Client </em>permission has been delayed until Salesforce has a way to allow admins to block SOAP API <em>login </em>authentication with API Access Control while still allowing laggard applications to use it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6e377f4c7ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Platform Encryption-Major Update — Updated 24 Feb 2026]]></title>
            <link>https://doug-merrett.medium.com/salesforce-platform-encryption-major-update-179543fade78?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/179543fade78</guid>
            <category><![CDATA[salesforce-shield]]></category>
            <category><![CDATA[salesforce-architect]]></category>
            <category><![CDATA[salesforce-admin]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 06:46:52 GMT</pubDate>
            <atom:updated>2026-02-24T04:29:44.883Z</atom:updated>
            <content:encoded><![CDATA[<p>Whole Org Encryption is available in Winter ’26 release</p><figure><img alt="Scrabble tiles spelling Encryption" src="https://cdn-images-1.medium.com/max/1024/0*NmuUVgTyg0Wz2fZL" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=medium&amp;utm_medium=referral">Markus Winkler</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Why is this important? What was the issue before?</strong></h3><p>Salesforce has had Platform Encryption for many years; however, there has always been a thorny issue — encrypting fields causes capability loss. What do I mean? If you encrypt a field in Salesforce using Platform Encryption, you are no longer able to use it in a filter or to sort by (except in reports). You can allow for filtering (a <em>where </em>clause in SOQL in Apex or API and conditions in reports) by using the deterministic option when encrypting that field; however, it only allows for equality or inequality filters (= or !=). There is no way to fix the sorting issues in SOQL queries; however, reports do allow for sorting on encrypted fields as they first bring back the data from the database (to get the decrypted values) and then sort it.</p><h3><strong>What has changed?</strong></h3><p>In Salesforce’s Winter ’26 release (due in October 2025), the <em>Encrypt Your Entire Database </em>option is now GA and everyone on Hyperforce can use it (except for US Gov Cloud at the moment — the work to get this approved is underway). This new capability depends on the underlying Salesforce Database’s features. Replacing Oracle with Salesforce’s own database has had a lot of benefits and this is one of them!</p><p>Now you are able to encrypt the whole of your org’s data <strong><em>without </em></strong>any impact to capabilities at all — nothing will break.</p><p>S̶a̶l̶e̶s̶f̶o̶r̶c̶e̶’̶s̶ ̶d̶a̶t̶a̶b̶a̶s̶e̶s̶ ̶h̶a̶v̶e̶ ̶b̶e̶e̶n̶ ̶e̶n̶c̶r̶y̶p̶t̶e̶d̶ ̶a̶t̶ ̶r̶e̶s̶t̶ ̶f̶o̶r̶ ̶q̶u̶i̶t̶e̶ ̶a̶ ̶w̶h̶i̶l̶e̶;̶ ̶h̶o̶w̶e̶v̶e̶r̶,̶ ̶n̶o̶w̶ ̶y̶o̶u̶ ̶a̶r̶e̶ ̶i̶n̶ ̶c̶h̶a̶r̶g̶e̶ ̶o̶f̶ ̶t̶h̶e̶ ̶k̶e̶y̶ ̶m̶a̶t̶e̶r̶i̶a̶l̶ ̶t̶h̶a̶t̶ ̶w̶i̶l̶l̶ ̶e̶n̶c̶r̶y̶p̶t̶ ̶t̶h̶e̶ ̶d̶a̶t̶a̶b̶a̶s̶e̶.̶</p><p><strong>Clarification 15 Jan 2026:</strong> Salesforce’s databases have been encrypted at rest for a while; in Hyperforce by the infrastructure encryption at rest and in Salesforce datacentres by the SAN Encryption. Now with Hyperforce and Salesforce’s own database, you can encrypt the entire transactional database with key material you control.</p><h3>S̶o̶u̶n̶d̶s̶ ̶t̶o̶o̶ ̶g̶o̶o̶d̶ ̶t̶o̶ ̶b̶e̶ ̶t̶r̶u̶e̶!̶</h3><p>I̶t̶ ̶i̶s̶ ̶a̶ ̶g̶r̶e̶a̶t̶ ̶f̶e̶a̶t̶u̶r̶e̶;̶ ̶h̶o̶w̶e̶v̶e̶r̶ ̶t̶h̶e̶r̶e̶ ̶a̶p̶p̶e̶a̶r̶s̶ ̶t̶o̶ ̶b̶e̶ ̶o̶n̶e̶ ̶c̶a̶t̶c̶h̶ ̶a̶t̶ ̶t̶h̶e̶ ̶m̶o̶m̶e̶n̶t̶.̶ ̶A̶t̶ ̶t̶h̶e̶ ̶b̶o̶t̶t̶o̶m̶ ̶o̶f̶ ̶t̶h̶e̶ ̶r̶e̶l̶e̶a̶s̶e̶ ̶n̶o̶t̶e̶,̶ ̶i̶t̶ ̶s̶a̶y̶s̶:̶</p><blockquote>S̶a̶l̶e̶s̶f̶o̶r̶c̶e̶ ̶b̶e̶g̶i̶n̶s̶ ̶e̶n̶c̶r̶y̶p̶t̶i̶n̶g̶ ̶a̶l̶l̶ ̶n̶e̶w̶ ̶d̶a̶t̶a̶.̶ ̶E̶x̶i̶s̶t̶i̶n̶g̶ ̶d̶a̶t̶a̶ ̶i̶s̶ ̶n̶o̶t̶ ̶e̶n̶c̶r̶y̶p̶t̶e̶d̶.̶ ̶Y̶o̶u̶r̶ ̶o̶t̶h̶e̶r̶ ̶e̶n̶c̶r̶y̶p̶t̶i̶o̶n̶ ̶s̶e̶t̶t̶i̶n̶g̶s̶ ̶(̶F̶i̶e̶l̶d̶s̶ ̶a̶n̶d̶ ̶F̶i̶l̶e̶s̶,̶ ̶S̶e̶a̶r̶c̶h̶ ̶I̶n̶d̶e̶x̶e̶s̶,̶ ̶a̶n̶d̶ ̶E̶v̶e̶n̶t̶ ̶L̶o̶g̶ ̶D̶a̶t̶a̶)̶ ̶a̶r̶e̶ ̶u̶n̶c̶h̶a̶n̶g̶e̶d̶.̶</blockquote><p>I̶ ̶d̶o̶ ̶h̶o̶p̶e̶ ̶t̶h̶a̶t̶ ̶t̶h̶e̶r̶e̶ ̶i̶s̶ ̶a̶ ̶c̶a̶p̶a̶b̶i̶l̶i̶t̶y̶ ̶o̶f̶f̶e̶r̶e̶d̶ ̶s̶o̶o̶n̶ ̶t̶o̶ ̶a̶l̶l̶o̶w̶ ̶y̶o̶u̶ ̶t̶o̶ ̶r̶e̶t̶r̶o̶s̶p̶e̶c̶t̶i̶v̶e̶l̶y̶ ̶e̶n̶c̶r̶y̶p̶t̶ ̶e̶x̶i̶s̶t̶i̶n̶g̶ ̶d̶a̶t̶a̶ ̶a̶s̶ ̶t̶h̶e̶r̶e̶ ̶i̶s̶ ̶f̶o̶r̶ ̶f̶i̶e̶l̶d̶ ̶l̶e̶v̶e̶l̶ ̶e̶n̶c̶r̶y̶p̶t̶i̶o̶n̶.̶ ̶W̶h̶e̶n̶ ̶t̶h̶a̶t̶ ̶i̶s̶ ̶o̶f̶f̶e̶r̶e̶d̶,̶ ̶y̶o̶u̶ ̶w̶i̶l̶l̶ ̶b̶e̶ ̶a̶b̶l̶e̶ ̶t̶o̶ ̶u̶n̶e̶n̶c̶r̶y̶p̶t̶ ̶t̶h̶e̶ ̶f̶i̶e̶l̶d̶s̶ ̶y̶o̶u̶ ̶h̶a̶v̶e̶ ̶e̶n̶c̶r̶y̶p̶t̶e̶d̶,̶ ̶d̶o̶ ̶a̶ ̶s̶y̶n̶c̶ ̶a̶n̶d̶ ̶g̶e̶t̶ ̶t̶h̶e̶ ̶f̶i̶l̶t̶e̶r̶i̶n̶g̶ ̶a̶n̶d̶ ̶s̶o̶r̶t̶i̶n̶g̶ ̶c̶a̶p̶a̶b̶i̶l̶i̶t̶i̶e̶s̶ ̶b̶a̶c̶k̶!̶</p><h3><strong>Update 15th Jan 2026: </strong>Yes — All your existing data will be encrypted as well!</h3><p>I spoke with the Salesforce Product Manager for Platform Encryption, a great guy who I have known for many years now going back to my Salesforce employee days, and he told me that the quote I highlighted was a mistake with the release notes. All the existing data <em>will </em>be encrypted, it just will take some time. The reason that it will take time is that when a record is updated, that database fragment that contains it will be encrypted on save. The same happens for new data, the fragment that contains it will be encrypted on save. Even without these updates, the old data will get encrypted as there is a background engine that will trawl through and update the older fragments over time. A Sync button is in the works and should be released this calendar year (safe harbour), so you will be able to control when this job kicks off. A percent complete value is also in the works, however may not make the first release of the Sync button.</p><h3>Update 24th Feb 2026</h3><p>Here is a link to a Salesforce Help article the PM has written explaining the process: <a href="https://help.salesforce.com/s/articleView?id=xcloud.security_shield_pe_tenant_level_encryption_process_flow.htm&amp;type=5">https://help.salesforce.com/s/articleView?id=xcloud.security_shield_pe_tenant_level_encryption_process_flow.htm&amp;type=5</a></p><h3><strong>How to use it</strong></h3><p>If you would like to encrypt all new data in your org (after the Winter ’26 release) and you have Platform Encryption, go to the Encryption Settings page and choose the <strong>Encrypt the Transactional Database</strong> toggle. This will enable the feature.</p><h3>For more information</h3><p>The information on this capability is in the Winter ’26 release notes: <a href="https://help.salesforce.com/s/articleView?id=release-notes.rn_258_security_pe_de_ga.htm&amp;release=258&amp;type=5">https://help.salesforce.com/s/articleView?id=release-notes.rn_258_security_pe_de_ga.htm&amp;release=258&amp;type=5</a>.</p><p>If you are interested in a detailed Salesforce Security Assessment, or general Salesforce Security Consultancy, please reach out to me at doug@platinum7.com.au.</p><p>All comments welcome! I look forward to reading them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=179543fade78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is the Salesforce API Access Control feature and why is it very good for security?]]></title>
            <link>https://doug-merrett.medium.com/what-is-the-salesforce-api-access-control-feature-and-why-is-it-very-good-for-security-dd527174b92e?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd527174b92e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <category><![CDATA[salesforce-api]]></category>
            <category><![CDATA[block-salesforce-api]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 02:14:23 GMT</pubDate>
            <atom:updated>2025-07-14T01:19:33.475Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Bundle of fibre optic cables" src="https://cdn-images-1.medium.com/max/1024/0*cLYwydTCIt-2uSqC" /><figcaption>Photo by <a href="https://unsplash.com/@comparefibre?utm_source=medium&amp;utm_medium=referral">Compare Fibre</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TL;DR; Get the API Access Control feature enabled in your org, <em>Install</em> all your Connected apps, change their app policies to <em>Admin approved users are pre-authorized</em> and add an “allow access” permission set to all users who need access and then turn on API Access Control. This will prevent rogue apps connecting to your org.</p><p>How do you stop employees from connecting unknown OAuth apps or even SOAP/REST apps to your Salesforce org? A little known Salesforce capability called <strong>API Access Control</strong>.</p><p>With Salesforce’s API Access Control, you are able to stop unapproved OAuth connected apps from connecting and unapproved users from using approved connected apps.</p><figure><img alt="A screenshot of the API Access Control feature of Salesforce" src="https://cdn-images-1.medium.com/max/629/1*0X0x569xu7GI_pLaZdhEKA.png" /></figure><p>The highlighted options, when enabled, will block access to internal and external users accessing unapproved apps.</p><p>You have probably now gone to see what your current settings are for API Access Control, however it is most likely not activated in your org. My guess why Salesforce has not activated it by default is because just turning API Access Control on without configuring other parts of Salesforce will stop most, and maybe all of your API integrations from working.</p><p>You need to raise a case with Salesforce Technical Support to get the feature activated in your org. When it has been activated in your production org, you are able to get it into your Sandbox orgs, without refreshing them, by using the <em>Matching Licences</em> facility in the <em>Company Information</em> section of Setup in the sandbox.</p><p>Do not rush in and click the two highlighted checkboxes as this could cause all your currently connected apps to fail — you need to do some other work first — and preferably in a sandbox to make sure it works as you expect.</p><p><strong>Either <em>Install </em>or <em>Block </em>all current Connected Apps.</strong></p><p>The first step is to go to <em>Connected Apps OAuth Usage</em> in Setup and click either <em>Install </em>(for apps you approve) or <em>Block </em>(for apps you do not approve). Install is a bit of a misnomer as the apps are already connected to your org — installing them just gives you the ability to manage policies on who can use them. Here is a picture of my org with Dataloader.io highlighted as it is the only app that is not installed or blocked. I will install it as I want to allow some users in my org permission to run it.</p><figure><img alt="A screenshot of the connected apps oauth usage page in Salesforce showing that the dataloader.io app has not been installed or blocked." src="https://cdn-images-1.medium.com/max/975/1*1mS70J3s4Xq4yBKtQztVrg.png" /></figure><p><strong>Edit the App Policies to limit access to just the users you want</strong></p><p>For each application that is now installed, click the <em>Manage App Policies</em> link. This will take you to this page:</p><figure><img alt="The Salesforce connected app page" src="https://cdn-images-1.medium.com/max/856/1*hl-vQjvO66oaEfL_mxvYxQ.png" /></figure><p>The <em>Permitted Users</em> will be set to <em>All users may self-authorize</em>. This is not what we want — we want to limit access to the app to only a few users in this case. If you want to allow all users access, then you can leave it as it is. You may want to do this for <em>Salesforce for Android</em> for example.</p><p>When you click on Edit Policies, you can change the <em>Permitted Users</em> to <em>Admin approved users are pre-authorized</em>. You may also want to change the <em>Refresh Token Policy</em> to <em>Expire refresh token after 7 Days </em>to force users to re-authenticate every 7 days (or whatever timeframe you prefer).</p><p>Now that you have limited access to approved users only, you need to configure which users these are. There are two ways to do this — either by profile or by permission set (or both). In this case, I want all System Administrators to be able to access <em>Dataloader.io</em> as well as one super user. To do this I will create a permission set called <em>Allow Dataloader.io</em> and add it to our super user. The permission set does not need to have any permissions, it just needs to exist. I use the naming convention of <em>Allow</em> followed by the Connected App’s name. Add the Profile and/or Permission Set to the related lists that have now appeared lower down the page.</p><p>The ability to grant a Permission Set for a limited timeframe is very handy in this use case — you could give our super user access to <em>Dataloader.io</em> for a week and then automatically remove that access by having the Permission Set time out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*i1KZ2rXdGs-ThFl2qgTDLg.png" /></figure><p>Now you have Installed or Blocked every connected app and configured the allowed users for each Installed app, you are ready to enable the API Access Control checkbox(es).</p><figure><img alt="A screenshot showing the “For admin-approved users, limit API access to only allowlisted connected apps” enabled for this org." src="https://cdn-images-1.medium.com/max/464/1*JuOsCqsjlR-pPpFXDDB3bg.png" /></figure><p>And that is it. Now any time someone tries to connect an unapproved connected app, it will fail. And if someone who is not authorised to use an approved app tries to connect, it will also fail.</p><p>As mentioned, this will also block users from using standard SOAP API Access using username and password. For example, developers using SoapUI to assist in developing integrations. In this case, you can add the <em>Use Any API Client</em> permission to their user via a Permission Set. Be very careful with this though, as it bypasses the <em>API Access Control</em> setting as well… Another excellent use of a time-limited Permission Set.</p><p>If you have found this useful or have any comments, please reach out. To have an in-depth security assessment of your Salesforce org (<a href="https://links.platinum7.com.au/assessments">datasheet available</a>), please get in touch. I give discounts for Not For Profit and Charitable institutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd527174b92e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce now allows you to keep Event Monitoring Logs for a year]]></title>
            <link>https://doug-merrett.medium.com/salesforce-now-allows-you-to-keep-event-monitoring-logs-for-a-year-81454efc0f8e?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/81454efc0f8e</guid>
            <category><![CDATA[event-monitoring]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 00:32:30 GMT</pubDate>
            <atom:updated>2024-06-25T00:54:48.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>Salesforce now allows you to keep Event Monitoring Logs for a year [UPDATED — 25 June 2024]</h3><figure><img alt="List of text (unreadable) on a computer monitor" src="https://cdn-images-1.medium.com/max/1024/0*Za_0EPNG2U_V-o41" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The Event Monitoring product is an amazing one from Salesforce as it allows you to see exactly what is going on inside your Salesforce org as well as proactively protecting your data! I am writing another blog about that which will be out soon!</p><p>Event Monitoring will show you every record that a user has seen — either by going to the record itself, or the record was on a list view the user viewed, or that the record was in a report that the user previewed, ran, exported or was delivered by the Scheduled Report capability, or that the record was exported via the API by the user, or that they clicked on the record in a global search result.</p><p>Event Monitoring is also be very useful for seeing “business as usual” things which you cannot easily see in other ways — that there was an uncaught exception in the Apex Code running in the system or a user tried to access a record when they did not have access rights to.</p><p>The <em>EventLogFile </em>events (over 60 event types) are a pain to access as they are a CSV (or TSV) file stored as a BASE64 encoded blob in a field on the <em>EventLogFile </em>record — and they are only kept for 30 days. The accessing of these files in the Summer 24 release has been massively improved with the inclusion of the <em>Event Log File Browser</em>.</p><p>Whereas the Real Time Events are stored in their own objects and can be accessed using standard SOQL — all of these are stored for, at least, 180 days. <em>IdentityVerificationEvent </em>and <em>LoginEvent </em>are stored for 10 years.</p><p>Now (as of Summer 24 release : June 2024), Salesforce has allowed admins of orgs with Event Monitoring to enable storage of all these logs for 365 days. All you need to do is check the box!</p><p><strong>UPDATE: 25 June 2024</strong> — only the <em>EventLogFile </em>events are able to be stored for 365 days. Real Time Events are as they were.</p><figure><img alt="The Salesforce Setup area for Event Monitoring showing the checkbox that is needed to be set to allow for storing events for 1 year." src="https://cdn-images-1.medium.com/max/826/1*UZW-yuoPDCOrwlCCHztT1Q.png" /></figure><p>If you do not check the box, then the standard storage for your events will remain.</p><p>There is a way to change the setting to be less than 1 year if you would like — this can only be done via the Salesforce Metadata API and involves setting the eventLogRetentionDuration value in the Events section of the Settings metadata. The Salesforce documentation does not currently (June 22, 2024) explain what this is, however this has been raised and will be corrected.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81454efc0f8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java, WSC, JWT and Connected Apps for Salesforce]]></title>
            <link>https://doug-merrett.medium.com/java-wsc-jwt-and-connected-apps-for-salesforce-5c0446263f21?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c0446263f21</guid>
            <category><![CDATA[salesforce-security]]></category>
            <category><![CDATA[salesforce-wsc]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[salesforce-integration]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 05:18:13 GMT</pubDate>
            <atom:updated>2025-10-17T05:39:42.969Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Java, WSC, JWT, OAuth and Connected Apps for Salesforce</strong></h3><p>What do all these acronyms mean and why should you be worried?</p><p>During my security assessments I perform on customer’s Salesforce environments, the most common critical issue I see is integrations that are running with System Administrator permissions.</p><p>This is very bad for security as the tool on the other end has complete control over your org. It can delete, corrupt and/or export <em>ALL</em> your data, deactivate <em>ALL</em> your users and effectively lock you out. If you use standard SOAP (or REST) with Username/Password, you have to give an external entity credentials which could be misused. Using the Web Browser OAuth flow for standard Connected Apps and REST is also dangerous because if the user is a System Administrator, then the external app again has full permissions.</p><p>This post is about what I consider to be best practice when it comes to integration with Salesforce using Java. The reasons I consider this to be best practice is that you are not sharing a password with the external party, you have granular control over what they getting access to and it uses one of Salesforce’s very low cost Integration User Licences.</p><p>I have spoken about the Integration User licence <a href="https://doug-merrett.medium.com/salesforces-new-integration-user-licence-and-why-it-s-good-for-security-5095186d1f88">before</a> and this is the exact use case for it — an external Java application logging into Salesforce to extract, create or update data.</p><p>To clear up the acronyms in the title — WSC is the Salesforce Web Services Connector, JWT is a JSON Web Token — a standards-based approach to sharing authentication between a client and a server, and Connected Apps are Salesforce’s approach to controlling access to Salesforce by external applications — this supports OAuth for authorisation and JWT as an authentication method.</p><p>As an aside, I am not a modern programmer — I do not use IDEs as I find they hide a lot of simple things behind complicated configuration. You will find I use batch files (which can easily map to .sh files in *nix) for compilation and running the code. This is easier for me to understand and I hope you also. If you use an IDE, it will also hopefully make moving my code into the IDE easier.</p><p>We are going to go through the four main steps I take to get the application running: Generate the WSC library, Create a simple app to make sure all is working well, Create the Connected app and associated files/settings and lastly modify the simple app to use the Connected App/JWT for authentication. Within those main steps, I show all the individual steps to get it to work. Explanations along the way will, I hope, assist with making it clear. I welcome feedback on the content and explanations.</p><p>The application I am writing is a very simple query of the Account object. However in the real world, you will be integrating your version of SAP or another application with your Salesforce instance and needing to transfer data either one way or bi-directionally. You may also need to update or delete data. The WSC library makes this pretty easy, however I will not be going into the complexities as I am, in this post, just covering the authentication process.</p><p>For the entire demo, I am using the <em>C:\TMP\WSC and JWT and Connected App</em> directory as the top directory.</p><p>If you do not have a Salesforce developer org to play with, you can sign up for one at <a href="https://developer.salesforce.com/signup">https://developer.salesforce.com/signup</a>. Use something like your email address followed by .jwtdemo for the username as these need to be unique across all of Salesforce. For myself, I used doug@platinum7.com.au.jwtdemo. You can have many users in many orgs with your email address; however, the username for each needs to be globally unique…</p><h3>Step 0 — Get an appropriate JDK</h3><p>I am assuming that since you are looking at this you should have a JDK that works for you. If not, I am using the Azul JDK version 21 LTS which is open source and does not need any commercial licencing. <a href="https://www.azul.com/downloads/#zulu">https://www.azul.com/downloads/#zulu</a></p><p>For Windows, download the ZIP file into <em>JDK </em>under the top directory and then uncompress it into the same directory, then rename the directory <em>jdk21.0.2</em> to get this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/0*D63g137pFyd5tmsJ.png" /></figure><p>You can then delete the ZIP file if you wish.</p><h3>Step 1 — Generate the WSC jar file</h3><p>This is the Salesforce Web Services Connector which makes all the hard work of using the Salesforce API go away. The source code is hosted at <a href="https://github.com/forcedotcom/wsc">https://github.com/forcedotcom/wsc</a> and is updated regularly.</p><p>To get the package prebuilt, go to <a href="https://mvnrepository.com/artifact/com.force.api/force-wsc">https://mvnrepository.com/artifact/com.force.api/force-wsc</a> and click on the most recent version. Create a directory for the <em>WSC </em>under the top directory, I tend to version it, so I have <em>WSC</em>, then I have <em>60.1.1</em> (in this case) as a directory inside — all the following files need to be stored in there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*GWkZFOUZos54vBz9.png" /></figure><p>From there click on the View All to allow you to see all the files in the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*i41pp_Eiv_pjIWTY.png" /></figure><p>We need the force-wsc-XXXXX-uber.jar and force-wsc-XXXXX.jar files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*YjJfFQlJ_u1IDuoT.png" /></figure><p>Now, go back one page and get all the <em>Compile</em> and <em>Provided</em> dependencies jar file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*Pbg17s7a7AFHlQj5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*7vULHFMY89gjnm4h.png" /></figure><p>After all this, you should have a directory with these files (in the version you downloaded).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*I04XHUv9sBRNOII3.png" /></figure><p>Now, we need to get the Salesforce Partner WSDL file. To do this, go to Setup area in your org, search for API by using the Quick Find box in the top left. Click the <em>Partner WSDL</em> link and save this file as PartnerXX.wsdl, where XX is the current version number, into the same directory. The version number is near the top of the wsdl file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*neCSgxMmiI4SxREF.png" /></figure><p>Now it is time to create the compile script. Use your favourite editor to create _compile.bat, the content of mine is below. Yours may be different depending on the versions you are using.</p><pre>set PATH=..\..\JDK\jdk21.0.2\bin;%PATH%<br>java -cp . -jar force-wsc-60.1.1-uber.jar Partner60.wsdl partner60.jar<br>pause</pre><p>Now run it and you should get something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*1Co0gVDyQP8Bytm0.png" /></figure><p>Now, you have generated the Java classes we will be calling from our code from the WSDL file, and these are now in the partner60.jar. You can leave it as it is; however, there are a lot of .java files in the partner60.jar file which take up space and are not needed at run time. Keep a copy of the original partner60.jar file as you can learn how things work by looking at the Java files. I use WinRAR which will natively read JAR files and allow me to delete the .java files. The open source 7Zip application also does this, however you cannot sort by extension so it takes a lot longer to choose each .java file to delete.</p><h3>Step 2 — Simple Application using the WSC</h3><p>This application is going to query the Account object using username and password. I am only doing this to make sure it works and to demo some simple code.</p><pre>// Needed for WSC<br>import com.sforce.soap.partner.Connector;<br>import com.sforce.soap.partner.PartnerConnection;<br>import com.sforce.ws.ConnectionException;<br>import com.sforce.ws.ConnectorConfig;<br>import com.sforce.soap.partner.sobject.SObject;<br>import com.sforce.soap.partner.QueryResult;<br><br>// Needed for code<br>import java.util.Scanner;<br><br>public class QueryAccount<br>{<br> static PartnerConnection connection;<br> public static void main (String [] args)<br> {<br>  QueryResult queryResults;<br>  int numResults;<br><br>  // Get the input from the user<br>  Scanner inScanner = new Scanner (System.in);<br>  System.out.print (&quot;Username: &quot;);<br>  String username = inScanner.nextLine ().trim ();<br>  System.out.print (&quot;Password: &quot;);<br>  String password = inScanner.nextLine ().trim ();<br>  System.out.println (&quot;\n&quot;);<br><br>  // Connect to Salesforce using username and password<br>  // The version in the URL below should be the same as the<br>  // WSC major version you used which is the same as the<br>  // partner.wsdl you used...<br>  ConnectorConfig config = new ConnectorConfig ();<br>  config.setUsername (username);<br>  config.setPassword (password);<br>  config.setAuthEndpoint (&quot;https://login.salesforce.com/services/Soap/u/60.0&quot;);<br>  config.setCompression (true);<br><br>  try<br>  {<br>   connection = Connector.newConnection (config);<br>  }<br>  catch (ConnectionException ce)<br>  {<br>   System.err.println (&quot;Could not connect to Salesforce.&quot;);<br>   System.err.println (&quot;Please make sure the username and password are correct.\n&quot;);<br>   System.err.println (ce);<br>   ce.printStackTrace ();<br>   System.exit (1);<br>  }<br><br>  try<br>  {<br>   System.out.println (&quot;Querying for all Accounts&quot;);<br>   <br>   // Get the fields that I want<br>   queryResults = connection.query (&quot;SELECT Id, Name, BillingState FROM Account&quot;);<br>   numResults = queryResults.getSize ();<br>   System.out.println (&quot;There are &quot; + numResults + &quot; Account records\n&quot;);<br>   <br>   for (SObject acct: queryResults.getRecords ())<br>   {<br>    System.out.print   (&quot;Id: &quot; + acct.getField (&quot;Id&quot;).toString () + &quot; &quot;);<br>    System.out.println (&quot;Name: &quot; + acct.getField (&quot;Name&quot;).toString ());<br>    Object fieldValue = acct.getField (&quot;BillingState&quot;);<br>    System.out.println (&quot;BillingState: &quot; + (fieldValue == null ? &quot;NULL&quot; : fieldValue.toString ()) + &quot;\n&quot;);<br>   }<br>  }<br>  catch (Exception e)<br>  {<br>   System.err.println (&quot;Could not query Salesforce.&quot;);<br>   System.err.println (e);<br>   e.printStackTrace ();<br>   System.exit (1);<br>  }<br>  System.out.println (&quot;\nFinished.&quot;);<br> }  // main<br>}  // QueryAccount</pre><p>Create an <em>Application </em>directory under the top level directory. Put the above code into a file into the <em>Application </em>directory called QueryAccount.java. Now copy the force-wsc-60.1.1.jar and partner60.jar from <em>WSC\60.1.1</em> directory to the Application directory as well. These are all that are required to run the Java code — the other .jar files are not needed as they were just for creating the partner60.jar file.</p><p>Now we need to create the _compile.bat and _run.bat script files in the <em>Application </em>directory. They are as below:</p><p>This is the _compile.bat file:</p><pre>set PATH=..\JDK\jdk21.0.2\bin;%PATH%<br>javac -classpath ./partner60.jar;./force-wsc-60.1.1.jar;. QueryAccount.java<br>pause</pre><p>This is the _run.bat file:</p><pre>@echo off<br>cls<br>set PATH=..\JDK\jdk21.0.2\bin;%PATH%<br>java -classpath ./partner60.jar;./force-wsc-60.1.1.jar;. QueryAccount<br>pause</pre><p>Now let’s compile and then run the code. Just double click on the _compile.bat file in the <em>Application </em>directory. When it has compiled successfully, double click on the _run.bat file and enter your details. It should end up like the picture below. You may need to use your Security Token appended to your password if the connection fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*yoTwRtVPbfyY3b0wujUZWA.png" /></figure><p>See <a href="https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm&amp;type=5">https://help.salesforce.com/s/articleView?id=sf.user_security_token.htm&amp;type=5</a> for information on how to reset your Security Token. (If you are not using a System Administrator account [you are if you created a developer org], you may get a runtime error about permissions.)</p><p>So now we have proven that the WSC library is working and we can run code to connect to Salesforce. Onto the next steps — setting up the JWT, Connected App and then modifying the code to suit…</p><h3>Step 3 — Connected App JWT setup</h3><p>We need to create the certificate for the Connected App, then create the Connected App in Salesforce and then create the Integration user and add their permissions. This looks like a lot of work; however, it is not that tricky when you have done it a few times.</p><p>The following instructions on creating the certificate came from <a href="https://www.apexhours.com/salesforce-oauth-2-0-jwt-bearer-flow/">https://www.apexhours.com/salesforce-oauth-2-0-jwt-bearer-flow/</a>; however, the instructions were not totally correct — my version below works.</p><p>We will use OpenSSL to generate the keys, etc. For Windows, I used this <a href="https://slproweb.com/products/Win32OpenSSL.html">https://slproweb.com/products/Win32OpenSSL.html</a> version. Please download the <em>Win64 OpenSSL v3.2.1 Light</em> (or later) version and install it. For *nix, look for the most recent OpenSSL version for your distribution.</p><p>Go to the Start Menu in Windows and select <em>Win64 OpenSSL Command Prompt</em>, then change directory to <em>C:\TMP\WSC and JWT and Connected App</em> and create the <em>Connected App</em> directory where we will be doing all the work and then change directory into that directory.</p><ul><li>Generate an RSA private key by typing this command. The <em>x</em> below is the password that will be for the server.pass.key file. You can leave it as <em>x</em> if you like, however you may want to use a password without spaces. We do not need to share this private key; we share a certificate based on this key.</li></ul><pre>openssl genrsa -des3 -passout pass:x -out server.pass.key 2048</pre><ul><li>Create a key file from the server.pass.key file. The server.key is our RSA private key. Again, the <em>x</em> is the password from the previous step. If you changed it, please replace <em>x</em> with your password.</li></ul><pre>openssl rsa -passin pass:x -in server.pass.key -out server.key</pre><ul><li>Create a request for the generation of the certificate needed for the JWT. This command will ask a number of questions, I used these answers, however you should use answers appropriate to yourself. If you do not have an Organisation Name, you can use Self.</li></ul><pre>openssl req -new -key server.key -out server.csr</pre><pre>Country: AU<br>State or Province: Victoria<br>Locality Name: Melbourne<br>Organisation Name: Platinum7<br>Organisational Unit Name: &lt;blank&gt;<br>Common Name: &lt;blank&gt;<br>Email Address: doug@platinum7.com.au<br>For the challenge password and company name I left them blank.</pre><ul><li>Now generate the certificate using the request from the previous step. The number of days validity does matter, so you will have to refresh the keystore for the code and the server certificate in the Connected App when this expires.</li></ul><pre>openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt</pre><ul><li>We now need to create a Java Key Store as this is the format that Java needs for importing keys into our code. Copy the server.key as server.pem.</li></ul><pre>copy server.key server.pem</pre><ul><li>And now create the key store in pkcs12 format. You will need to enter a password — please remember it!</li></ul><pre>openssl pkcs12 -export -in server.crt -inkey server.pem -out keystore.p12</pre><ul><li>Now it is time to use the Java Keytool program to create the Java Key Store for your Java code. Enter a password for the destination keystore and the password you created in the previous step for the source keystore. The destination keystore password will be used in your Java code to extract the private key from the keystore.</li></ul><pre>..\JDK\jdk21.0.2\bin\keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore servercert.jks -deststoretype pkcs12</pre><p>We now have the information to allow Salesforce to use JWT flows for authentication. Now it is time to create the connected application and the user with permissions that will be used to connect…</p><ul><li>Login into your org as a System Administrator and go to Setup.</li><li>Go to the <em>App Manager.</em></li><li>In the top right, click on <em>New Connected App.</em></li><li>Enter <em>Query Accounts</em> as the Connected App Name.</li><li>Tab through to the Contact Email field and the API Name will be set automatically.</li><li>Enter your email address as the Contact Email.</li><li>Enter your phone number as the Contact Phone.</li><li>Choose a logo and icon URL from Salesforce’s library by clicking the <em>Choose one of our sample logos</em> link below the field to see what is there. I used <a href="https://login.salesforce.com/logos/Standard/custom/logo.svg">https://login.salesforce.com/logos/Standard/custom/logo.svg</a> and <a href="https://login.salesforce.com/logos/Standard/custom/icon.png.">https://login.salesforce.com/logos/Standard/custom/icon.png.</a> Or upload your own choices.</li><li>Enter <em>Sample JWT App</em> in the Description field.</li><li>Click the <em>Enable OAuth Settings</em> checkbox to open the area below.</li><li>Enter <a href="https://localhost:9876/OauthRedirect"><em>https://localhost:9876/OauthRedirect</em></a> into the Callback URL field (it is never used and can be any port number, not just 9876, however you will need to modify the code if you use a different value).</li><li>Click the <em>Use digital signatures</em> checkbox.</li><li>Click the <em>Choose File</em> button under the <em>Use digital signatures</em> checkbox and choose the server.crt file from the Connected App directory.</li><li>In the <em>Selected OAuth Scopes</em> area, add the following scopes<em>.</em></li></ul><pre>Access the identity URL service (id, profile, email, address, phone)<br>Manage user data via APIs (api)<br>Perform requests at any time (refresh_token, offline_access)</pre><ul><li>Leave the rest of the settings as they are.</li><li>It should look like this image before you click <em>Save.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*KWHQC1NJW4jBaI03.png" /></figure><ul><li>Click <em>Save</em> if it looks correct, then click <em>Continue</em>.</li><li>We need to get the Consumer Key and the Consumer Secret for later, so click on the <em>Manage Consumer Details</em> button. You will get an MFA alert, so approve this.</li><li>Copy the Consumer Key and Consumer Secret into a text file, remembering which is which, and keep for later when we are making changes to the code to use the Connected App.</li></ul><p>It is now time to create the user and add their permissions:</p><ul><li>Go to <em>Permission Sets</em> in Setup and create a new one with the label set to <em>Allow Query Accounts</em> then press tab to get to the API field and it will create the correct value. Leave everything else as is.</li><li>When it has been created, click on the <em>Object Settings</em> link in the Apps area as we need to allow access to the Account object and the appropriate fields.</li><li>Click on the <em>Accounts</em> link, click the <em>Edit</em> button then click on the checkbox beside <em>View All</em>, then scroll down and check the tickbox beside the <em>BillingAddress</em> field and click <em>Save.</em></li><li><em>In the real world outside this demo, you will need to access different data and possibly, delete and update data. What this step does is limit the access to only the fields and objects chosen. If you need to update or delete data, then choose those options for the appropriate fields and objects. This is why this is best practice for security — you are using the principal of least privilege. This is exactly why you should </em><strong><em>not</em></strong><em> use System Administrator profile users for API access…</em></li><li>Create a new user to be used exclusively for the App (as you should do for best practice security) by going to <em>Users</em> in the Setup area and clicking the <em>New</em> button. Use your email address and a username like <em>queryaccounts@yourcompany.com.jwtdemo</em> and use the <em>Salesforce Integration </em>licence type and the <em>Minimum Access — API Only Integrations </em>profile, uncheck all the tickboxes in the <em>General Information</em> area (to minimise access) and then check the <em>No MRU Updates</em> tickbox to enhance performance.</li><li><em>For other apps, create other users and other permission sets with just the correct access rights and limit it to one user per Connected App — that way you are totally aware of what that user is doing to your data. If you have one API user for more than one app, then you are never sure which app changed which data…</em></li><li>Scroll down to the bottom and click <em>Save</em>. It will now create the user and return you to the User page.</li><li>On the User page, on the top middle of the page, hover over the <em>Permission Set License Assignments</em> and then click the <em>Edit Assignments</em> button on the pop up.</li><li>Enable the <em>Salesforce API Integration</em> permission set license and click <em>Save</em>.</li><li>Again, on the User page, on the top left, hover over the <em>Permission Set Assignments</em> and then click the <em>Edit Assignments</em> button on the pop up.</li><li>Add the <em>Allow Query Accounts</em> permission set to the <em>Enabled Permission Sets</em> and click <em>Save.</em></li><li>You will have received an email with the Verify Account for the new user. If you use Gmail and Chrome, right click on the <em>Verify Account</em> button in the middle of the email and then choose Open Link in Incognito Window. If not, get the link from the button and paste it into an Incognito/Private/… window and hit Enter.</li><li>Fill in the user’s password and security question. You will not be using this password, however keep it safe.</li></ul><p>Now we have the Java Key Store for the code, we have the User with the appropriate permissions, and the Connected App, it is now time to configure the Connected App to allow this new user to connect to it.</p><ul><li>If you have <em>API Access Control</em> set up in your org, disable it temporarily so you are able to connect an OAuth App.</li><li>We are now going to limit access to the Connected App to just the user with the permission set we created. Go to the <em>App Manager</em> section of Setup and click on the dropdown arrow on the far right of the <em>Query Accounts</em> app and choose <em>Manage</em>.</li><li>Click on <em>Edit Policies</em> at the top of the page.</li><li>Change the Permitted Users to <em>Admin approved users are pre-authorized </em>and click <em>OK</em> on the warning popup and then click <em>Save</em>.</li><li><em>What this does is stop everyone in your org from using the app. It will just be the users with the appropriate permission sets and/or profiles listed in the related lists below. You should do this for all Connected Apps — especially “dangerous” ones like Salesforce’s Workbench or </em><a href="http://dataloader.io/"><em>Dataloader.io</em></a><em>, because without limiting access, anyone in your org can connect these to your org and export all the data they can see…</em></li><li>Scroll down the page and you will see a <em>Permission Sets</em> related list. Click the <em>Manage Permission Sets</em> button and make sure that there is a check mark against the <em>Allow Query Accounts</em> permission set and no other permission sets are checked. Click <em>Save</em> and we are done with the configuration.</li><li>If you disabled <em>API Access Control</em>, please re-enable it.</li></ul><p>That is now it! Time to change the code to use the JWT flow. For more info on <em>API Access Control</em> and why it is important, please see my blog on <a href="https://doug-merrett.medium.com/">https://doug-merrett.medium.com</a> which will be released mid-April 2024.</p><h3>Step 4 — Change the code to use JWT to connect</h3><p>We are going to replace the authentication code in the initial Java application we wrote as we will be using JWT to do the connection, however lets discuss what a JWT looks like as we will be building one in the Java code — you may want to follow along in the code as we go through this. The new code is in a ZIP file referenced below.</p><p>There is a lot of detailed information on the format on <a href="http://jwt.io/">jwt.io</a>’s site: <a href="https://jwt.io/introduction">https://jwt.io/introduction</a>. The JWT flow is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_65iJO4hzf20GIlDbHtlTg.png" /></figure><p>In a nutshell, the JWT is made up of three parts separated by full stops; the header, the payload and the signature. These are JSON data structures.</p><p>The header we need is just the algorithm used: {“alg”:”RS256&quot;} as we do not need the type.</p><p>The payload we need is a <em>registered claims</em> type with these claims: iss (issuer), sub (subject), aud (audience), and exp (expiration time). The issuer is the Consumer Key from the Connected App, the subject is the username of our user, the audience is the login URL (either <a href="https://login.salesforce.com/">https://login.salesforce.com</a> for production, <a href="https://test.salesforce.com/">https://test.salesforce.com</a> for sandboxes or <a href="https://xxxx.my.salesforce.com/">https://XXXX.my.salesforce.com</a> if you have blocked API access to using the standard login URLs), and the expiration time is now plus two minutes. The format of the expiration time is the Unix Timestamp format which is the number of seconds since January 1st 1970.</p><p>The signature is how the receiver knows that this message has not been compromised. It uses this algorithm to generate a cryptographical signature:</p><pre>HMACSHA256 (base64UrlEncode (header) + &quot;.&quot; + base64UrlEncode (payload), PrivateKey)</pre><p>We will need to use the Java security libraries to provide the HMACSHA256 function and the ability to use keys from the Java keystore. The Base64 functions will be provided by an Apache library.</p><p>Now we have the JWT, we need to login to Salesforce by HTTPS POST-ing the JWT, the Consumer Key and the Consumer Secret from the Connected App to the /services/oauth2/token endpoint of the login URL we are going to use. (The Access Token Request from the diagram above.) If the planets align and we haven’t made a mistake, then we will receive a JSON response which will contain the Session ID and the Identity URL. The Session ID is used as the authentication token for further access and the Identity URL is used to get the Partner URL for the WSC framework to use when querying the Salesforce API. (The Access Token Response from the diagram above.)</p><p>We get the Partner URL from Salesforce by doing an HTTPS GET of the Identity URL passing the API version number and the Session ID. This returns a JSON payload with all the URLs and we just grab the Partner one.</p><p>After all that, we now have authenticated using the JWT, received the Session ID from the oauth2 endpoint and have the Partner URL, we can replace the login code from before with these values. See below for the before and after code:</p><pre>// Connect to Salesforce [Username/Password Code]<br>ConnectorConfig config = new ConnectorConfig ();<br>config.setUsername (username);<br>config.setPassword (password);<br>config.setAuthEndpoint (&quot;https://login.salesforce.com/services/Soap/u/60.0&quot;);<br>config.setCompression (true);</pre><pre>// Connect to Salesforce [JWT Code]<br>ConnectorConfig config = new ConnectorConfig ();<br>config.setSessionId (sessionId);<br>config.setCompression (true);<br>config.setServiceEndpoint (partnerURL);</pre><p>The code after that is the same.</p><p>We need to get a JSON library and the Base64 encoding library to make all this work. The JSON library is available here (<a href="https://mvnrepository.com/artifact/org.json/json">https://mvnrepository.com/artifact/org.json/json</a>) and the Base64 library is here (<a href="https://mvnrepository.com/artifact/commons-codec/commons-codec">https://mvnrepository.com/artifact/commons-codec/commons-codec</a>). Get the most recent JAR file of these in the same we did earlier for the WSC dependencies. For those curious as to why we are not using the inbuilt Java Base64 library, it is because it pads the Base64 data whereas the Apache commons does not and JWT needs unpadded data.</p><p>Put these files in the <em>Application </em>directory under the top-level directory we used before and overwrite the previous code, _compile.bat and _run.bat files with the contents of this ZIP file: <a href="https://links.platinum7.com.au/JWTCode">https://links.platinum7.com.au/JWTCode</a>. You may need to modify the _compile.bat and _run.bat files as you may have newer library JAR files. You will need to modify the code to have the appropriate username, Java Keystore password, and the Consumer Key and Consumer Secret from the Connected App you created earlier. Copy the servercert.jks file from the <em>Connected App</em> directory to the <em>Application </em>directory as the code needs it to be in the same directory as the Java app. Compile and run and you get the same as before, except with a better approach to security.</p><p>Please let me know if you have any questions or comments.</p><p>Doug Merrett — <a href="/service/mailto:doug@platinum7.com.au">doug@platinum7.com.au</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c0446263f21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Communities Security Issue — Update]]></title>
            <link>https://doug-merrett.medium.com/salesforce-communities-security-issue-update-5b313289acb5?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b313289acb5</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[salesforce-communities]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Sat, 09 Dec 2023 01:02:39 GMT</pubDate>
            <atom:updated>2024-04-02T00:36:48.419Z</atom:updated>
            <content:encoded><![CDATA[<h3>Salesforce Communities Security Issue — Update</h3><figure><img alt="A screenshot showing dense code — simulating what a hacker would see…" src="https://cdn-images-1.medium.com/max/1024/0*S17uYrod63z597_e" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TL;DR; <strong>Do not use Public Read or Public Read/Write as the Sharing Setting for External users or use sharing rules to do the same thing</strong></p><p>You may have read my previous <a href="https://doug-merrett.medium.com/salesforce-communities-security-issue-abe2b1c09973">story</a> about security issues surrounding Salesforce Communities (aka Digital Experiences, Portals, …) where I cover how to stop a simple hack allowing external, authenticated users to see all other user’s data.</p><p>The reason the hack even works is that the objects in the Salesforce environment have Public Read or Public Read/Write sharing settings for External users and are included in the profile/permission sets for the users.</p><p>The solution I gave to prevent the simple hack does not really solve the issue — there is a more complex hack that bypasses every bit of UI security you try to put into place and will allow the hacker access to every record in every object that has Public Read or Public Read/Write sharing settings for External users, or has sharing settings that grant the same permissions and are included in the profile/permission sets for the users.</p><p>I am not going to cover how this hack works, however details of how to do it is out in the public domain and is most likely being used in the wild.</p><p>To solve this issue, <strong><em>please just stop using Public Read or Public Read/Write sharing settings for External users and do not use sharing rules to do the same thing.</em></strong> If you have this set now, fix it in your next release cycle. Changing the sharing settings is technically very easy to do; however, the issue will be in making sure the community still functions the way it should and this will, more than likely, need code/configuration changes to correct. But do not put it aside —<strong> if you have Public Read or Public Read/Write sharing settings for External users, your data is unsafe! It is also unsafe if you have used sharing rules to do the same thing — grant access to all external users.</strong></p><p>Yes, you need to have the object in the profile/permission set for the external users for the breach to occur; however, if you rely on this, you are accepting a huge risk. Defence in depth is the way forward — do not have the sharing set incorrectly, do not have these objects in the profile/permission set of external users. Now you have two layers of protection. As I said above, your data is unsafe if you have permissive sharing. Relying on a just a profile or permission set to protect your data is very unwise.</p><p>If you do not have Event Monitoring (and are not backing up the logs) you cannot tell if it has been used against you already.</p><p>To tell if you have this setting in your environment, please run the Salesforce Optimizer found in the Setup area of your Salesforce org.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b313289acb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Australian Government releases its response to the Privacy Act Review — The Salesforce Edition]]></title>
            <link>https://doug-merrett.medium.com/the-australian-government-releases-its-response-to-the-privacy-act-review-the-salesforce-edition-f71cf9ed8989?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f71cf9ed8989</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[australia-privacy-act]]></category>
            <category><![CDATA[salesforce-security]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Thu, 28 Sep 2023 04:50:14 GMT</pubDate>
            <atom:updated>2023-09-28T04:50:14.649Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Australian Government releases its response to the Privacy Act Review — The Salesforce Edition</h3><figure><img alt="An abstract picture meant to show Customer Data." src="https://cdn-images-1.medium.com/max/1024/0*twd3ChLnS0riU6sN" /><figcaption>Photo by <a href="https://unsplash.com/@purzlbaum?utm_source=medium&amp;utm_medium=referral">Claudio Schwarz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TL;DR; The New Privacy Act will impact all Salesforce customers as Small Businesses will no longer be exempt. There are lots of detail, however it looks to be similar to the GDPR. You will need to have a way to detect breaches (Event Monitoring) and be taking <em>reasonable steps</em> to protect the data where a security assessment will assist in highlighting any possible issues.</p><p>The Australian Government today has released its response to the Privacy Act Review Report which was released in February 2023.</p><p>The five focus areas are: Bring the Privacy Act into the digital age; Uplift protections; Increase clarity and simplicity for entities and individuals; Improve control and transparency for individuals over their personal information; and Strengthen enforcement.</p><p>Of the proposals made, the vast majority were agreed or agreed in-principal.</p><p>The ones which will affect most Australian Salesforce customers are:</p><ul><li>The definition of ‘collection’ should be amended to expressly cover <strong><em>information obtained from any source and by any means, including inferred or generated information</em></strong> (proposal 4.3).</li><li>The Government agrees in-principle that the <strong><em>small business exemption should be removed</em></strong> in light of the privacy risks applicable in the digital environment (proposal 6.1).</li><li>The Government agrees in-principle that privacy settings for online services should reflect the ‘<strong><em>privacy-by-default</em></strong>’ framework of the Privacy Act, as determined by what is fair and reasonable in the circumstances, and be clear and easily accessible for users (proposal 11.4).</li><li>The Government agrees the Privacy Act’s existing security obligations should be enhanced by specifying that ‘<strong><em>reasonable steps</em></strong>’ in the context of APP 11 include both technical and organisational measures (proposal 21.1), and agrees in-principle that entities should be required to comply with a set of baseline privacy outcomes, aligned with relevant outcomes of the Government’s 2023–2030 Australian Cyber Security Strategy (proposal 21.2). The Government agrees the <strong><em>OAIC should provide additional guidance to entities about what reasonable steps an entity should take to keep personal information secure</em></strong> (proposal 21.3), and what reasonable steps an entity should take to destroy or de-identify personal information (proposal 21.5).</li><li>The Government agrees in-principle that entities should be required to establish their own maximum and minimum retention periods for personal information they hold (proposal 21.7) and <strong><em>specify these retention periods in privacy policies</em></strong> (proposal 21.8). Retention periods should take into account the type, sensitivity and purpose of the information being retained as well as the entity’s organisational needs and any obligations they may have under other legal frameworks.</li><li>The Government agrees in-principle that entities should be required to (proposal 28.2): <strong><em>notify the Information Commissioner as soon as practicable, and not later than 72 hours, after becoming aware that there are reasonable grounds to believe there has been an eligible data breach</em></strong>, but will further explore appropriate timeframes with stakeholders and alignment with other relevant reporting frameworks; notify individuals as soon as practicable, including providing information to individuals in phases if it is not practicable to provide the information at the same time; and take <strong><em>reasonable steps to implement practices, procedures and systems</em></strong> to respond to a data breach.</li><li>The Government agrees in-principle that <strong><em>entities should be required to determine and record the purposes for which they will collect, use and disclose personal information at or before the time they collect it and record secondary purposes at or before the time of undertaking the secondary use or disclosure</em></strong> (proposal 15.1). Determining and recording the primary and secondary purposes for which personal information is collected, used and disclosed will assist entities with internal measures to assess the adequacy of current practices and comply with new obligations. To improve information management governance processes and systems, the Government agrees in-principle that <strong><em>entities should be required to appoint or designate a senior employee as having specific responsibility for privacy within the organisation</em></strong> (proposal 15.2). The Government also agrees in-principle that <strong><em>entities should be required to take reasonable steps to ensure personal information collected by third parties was collected lawfully</em></strong> (proposal 13.4)</li><li>The Government agrees in-principle that <strong><em>targeting (for marketing)</em></strong> should be subject to the following requirements (proposal 20.8): <strong><em>targeting individuals should be fair and reasonable in the circumstances, and targeting individuals based on sensitive information should be prohibited</em></strong>, with an exception for socially beneficial content.</li><li>To prevent individuals from losing control of their information, the Government agrees in-principle that <strong><em>an individual’s consent should be required in order to trade their personal information</em></strong> (proposal 20.4), subject to refining the scope of what is considered to constitute ‘trading’.</li><li>The Government agrees in-principle that individuals should have greater transparency and control over their personal information through the creation of new individual rights which would enable them to: <strong><em>request an explanation of what personal information is held and what is being done with it through an enhanced right to access (proposal 18.1); challenge the information handling practices of an entity and require the entity to justify how its information-handling practices comply with the Act (proposal 18.2) ; require an entity to delete (or de-identify) personal information through a right to erasure (proposal 18.3) </em></strong>; request correction of online publications over which an entity has control (proposal 18.4), and require search engines to de-index certain online search results (proposal 18.5).</li><li>The Government agrees in-principle that <strong><em>individuals should have more direct access to the courts to seek remedies for breaches of the Act</em></strong> through a direct right of action (proposal 26.1).</li><li>the Government agrees section 13G of the Privacy Act which deals with ‘serious or repeated’ breaches of privacy should be amended to remove the word ‘repeated’ and clarify that a <strong><em>‘serious’ inference can include repeated interferences with privacy </em></strong>(proposal 25.2). The Government agrees <strong><em>a new mid-tier civil penalty provision should be introduced</em></strong> to cover interferences with privacy which do not meet the threshold of being ‘serious’ and <strong><em>a new low-level civil penalty provision for specific administrative breaches of the Act and APPs</em></strong> should be introduced with attached infringement notice powers for the Information Commissioner with set penalties (proposal 25.1).</li></ul><p>So, in a nutshell, if you are storing customer data in Salesforce (and that would be close to all Salesforce customers), you need to take security and privacy of data seriously.</p><p>The exemption for small business will mean all Salesforce customers need to comply with the Privacy Act.</p><p>The requirement for you to protect data, even if you bought it, following the OAIC (Office of the Australian Information Commissioner) guidelines on the reasonable steps to protect. You will also will need to verify that the data you bought was collected legally. It will be interesting to see what these reasonable steps are…</p><p>Marketers need to be very aware of the greater transparency and control over their personal information that consumers will get, including the ability to request deletion of their data, as well as the retention period of data collected or bought.</p><p>And every company will need to have a Privacy Officer…</p><p>If you are a company that has looked at becoming GDPR compliant as you are working in the EU/UK, then you are pretty much there with the proposed changes. However, technology may be required for you to be aware of breaches and the ability to understand what data was taken is key. This capability is only available with Salesforce’s Event Monitoring and you will need to keep these logs for a reasonable timeframe.</p><p>And getting an assessment of the security of your Salesforce environment will highlight any data privacy issues and technical shortcomings which would need to be addressed to be compliant with the Act.</p><p>Please let me know your thoughts below and please reach out if you have any questions on how to protect your Salesforce data.</p><p>References:</p><ul><li><a href="https://security.salesforce.com/general-data-protection-regulation">https://security.salesforce.com/general-data-protection-regulation</a></li><li><a href="https://www.ag.gov.au/sites/default/files/2023-09/government-response-privacy-act-review-report.PDF">https://www.ag.gov.au/sites/default/files/2023-09/government-response-privacy-act-review-report.PDF</a></li><li><a href="https://www.ag.gov.au/sites/default/files/2023-09/fact-sheet-government-response-privacy-act-review-report.PDF">https://www.ag.gov.au/sites/default/files/2023-09/fact-sheet-government-response-privacy-act-review-report.PDF</a></li><li><a href="https://www.platinum7.com.au/assessments">https://www.platinum7.com.au/assessments</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f71cf9ed8989" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APRA Cyber security stocktake exposes gaps — the Salesforce edition]]></title>
            <link>https://doug-merrett.medium.com/apra-cyber-security-stocktake-exposes-gaps-the-salesforce-edition-afbd68edd81c?source=rss-3872e40ff3f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/afbd68edd81c</guid>
            <category><![CDATA[salesforce-security]]></category>
            <dc:creator><![CDATA[Doug Merrett]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 01:53:06 GMT</pubDate>
            <atom:updated>2023-07-06T02:06:15.477Z</atom:updated>
            <content:encoded><![CDATA[<h3>APRA Cyber security stocktake exposes gaps — the Salesforce edition</h3><figure><img alt="drawing of 4 padlocks in front of binary data with one of the padlocks open" src="https://cdn-images-1.medium.com/max/1024/1*6pFI8ECEC7Wjje5pu3G0fA.jpeg" /><figcaption><a href="https://www.stockvault.net/photo/174251/cyber-security-concept">https://www.stockvault.net/photo/174251/cyber-security-concept</a></figcaption></figure><h3>TL;DR;</h3><p>Salesforce customers that are APRA regulated need to focus on their Salesforce environment to be compliant with APRA’s CPS234 as APRA found that there were major failings in compliance in a recent survey. Salesforce and partners have products and services to assist with this.</p><h3>Introduction</h3><p>The Australian Prudential Regulation Authority (APRA) has done a stocktake on about 25% of their regulated financial institutions in Australia and found that there were major issues in compliance with CPS234. The <a href="https://www.apra.gov.au/news-and-publications/cyber-security-stocktake-exposes-gaps">report</a> was published 6th July 2023.</p><p>Even though this is specific to Australian Financial companies regulated by APRA, the recommendations are valid for any Salesforce customer in any vertical.</p><p>These were the most common failings when it came to CPS234 compliance:</p><ol><li>incomplete identification and classification for critical and sensitive information assets;</li><li>limited assessment of third-party information security capability;</li><li>inadequate definition and execution of control testing programs;</li><li>incident response plans not regularly reviewed or tested;</li><li>limited internal audit review of information security controls; and</li><li>inconsistent reporting of material incidents and control weaknesses to APRA in a timely manner.</li></ol><p>So let’s go through each of these in turn and see what an APRA regulated financial institution that uses Salesforce needs to do to correct these shortcomings:</p><h3><em>Incomplete Classification</em></h3><p>In the Salesforce environment, each field can have it’s own classification for security and compliance. The data elements are <em>Data Sensitivity Level</em> (Public, Internal, Restricted, …) and <em>Compliance Categorization</em> (PII, PCI, …) These data elements can be customised to your requirements and the <em>Compliance Categorization</em> can have multiple selected values.</p><p>This allows financial services companies to classify all their data and these classifications can also be used in data loss prevention polices that are able to be created using <a href="https://help.salesforce.com/s/articleView?id=sf.enhanced_transaction_security_policy_types.htm&amp;type=5">Salesforce’s Event Monitoring — Transaction Security</a> capability.</p><p>To do the classification, you can use the Salesforce Object Manager, or to make it a lot easier, the <a href="https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G0yjiUAB">OwnBackup Secure</a> product has a very quick and easy to use tool that assists in creating this classification data.</p><p>When it comes to free text fields and document attachments, making sure that these do not contain information that should not be there, credit card numbers for example, requires more proactive assistance. <a href="https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000EcvUUUAZ">Blackthorn.io</a> have a compliance product that will check these and highlight when there is noncompliant information in this data.</p><p>I published a blog on the <a href="https://medium.com/@doug-merrett/the-5-knows-of-cyber-security-the-salesforce-edition-18ce59b12d66">Five Knows of Cyber Security — the Salesforce edition</a>, in which I go into detail on the classification of data in Salesforce.</p><h3><em>Limited Assessment of 3rd party information security capability</em></h3><p>Salesforce publishes a very comprehensive list of compliance documentation that customers can use to satisfy their 3rd party information security assessment requirements. I have covered this site and the documents I think are important in an earlier blog post — <a href="https://medium.com/@doug-merrett/salesforce-compliance-documentation-site-how-to-722d88219872">Salesforce Compliance Documentation Site — A “How To” Guide</a>.</p><h3><em>Inadequate testing of controls</em></h3><p>Information control assurance programs were not in place for key controls like user access reviews and data loss prevention controls, and testing was not performed by functionally independent testers.</p><p>Creating and monitoring data loss prevention controls is relatively simple with Salesforce as there is an inbuilt capability for data loss prevention, namely <a href="https://help.salesforce.com/s/articleView?id=sf.enhanced_transaction_security_policy_types.htm&amp;type=5">Salesforce’s Event Monitoring — Transaction Security</a> capability. As mentioned above, the classification of the data can be used to create tailored policies that will fire only when certain thresholds are breached for certain types of data. For example, if credit card data is being stored, then it is not able to be added to reports at all so that there can not be a way for users to get a list of card details, and you can block the access to the card number field via API unless the API user is marked as allowed access.</p><p>User access reviews can now be more easily done in Salesforce as there is a free, open source tool <a href="https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FYkDDUA1">Authenticated and Guest User Access Report and Monitoring</a>. This tool can be used to understand how much and which data a user (including the Guest user) can see.</p><p>The functionally independent testers is a bit harder as there are not many independent Salesforce security assessors, and few partners have the capabilities to do a deep dive security analysis of Salesforce environments. In-house testing could be conducted by the customer’s security team, however how many of these folks have Salesforce skills?</p><h3><em>Inadequate incident response plan review/test</em></h3><p>Some of the findings were that incident response plans were not in place, not reviewed and/or not tested regularly and that incident response playbooks have limited plausible disruption scenarios.</p><p>When it comes to getting incident response plans sorted out, first you need to know that you have had an incident (see paragraph 23 in the <a href="https://www.apra.gov.au/sites/default/files/cps_234_july_2019_for_public_release.pdf">CPS234 standard</a>), in Salesforce this means you need to have <a href="https://help.salesforce.com/s/articleView?id=sf.real_time_event_monitoring_overview.htm&amp;type=5">Salesforce’s Event Monitoring</a> otherwise it is “impossible” to know what is going on inside your Salesforce environment. These logs will give exquisite detail into the goings on in your org — tracking users through the system highlighting which records and files the user has <em>looked at</em>, not necessarily edited; which records appeared on a list view; which records appeared on a report preview; and lastly which records were exported via an API or report export. Salesforce does not provide any alerting tool that will do analysis of this data, so a partner, <a href="https://www.imprivata.com/platform/risk-analytics-and-intelligence/cloud-solutions-intelligence">FairWarning</a>, has built a tool that will absorb the log files and provides prebuilt rules for many alert types. A new player in the community is using learning algorithms to provide alerts without the need to write rules at all — <a href="https://www.reveal.security/solutions/revealsecurity-for-salesforce/">Reveal Security’s TrackerIQ</a>.</p><p>After you have found the issue, then you need to run the analysis and respond to the incident. FairWarning has a prebuilt tool for this, however you may want to use your standard SOC processes.</p><p>The second finding where there were limited plausible disruption scenarios being planned for, APRA gives a great range of scenarios, however the one that leapt out at me was Data Breach and without the information gathered from Event Monitoring, you will not know what data/files has been exposed. Even with these controls in place, data may still leak and how do you know if it has leaked? <a href="https://www.seedata.io/">Seedata.io</a> is a company that has a tool to put seed data into your environment and then is able to detect it in the wild and alert you to a leak.</p><h3><em>Inadequate internal audit of infosec controls</em></h3><p>APRA’s findings that the internal audit teams of the regulated companies had limited review of 3rd party infosec controls and also the internal audit teams lacked the necessary information security skills. Independent Salesforce security consultants can assist internal audit to make sure that the Salesforce environment has been assessed and any findings highlighted.</p><h3><em>Inconsistent reporting of incidents and weaknesses to APRA</em></h3><p>There is no direct relevance of this control to Salesforce customers as such, however a workflow as part of an incident response could easily alert the user to notify APRA. Salesforce’s platform is extremely flexible and an incident response system could be easily and quickly prototyped then moved into production.</p><p>Thanks for reading — if you have any questions or comments, please let me know.</p><p>My company, <a href="https://www.platinum7.com.au/assessments">Platinum7</a> is an independent Salesforce Security consultancy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afbd68edd81c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>