Open API Security Maturity Model With an Emphasis on OPEN BANKING and Digital Payments
In the past few years, API security becomes a major concern to - pretty much - every industry using public internet to access application resources, however, i am focusing in today's article on the banking sector and digital payments, let alone, the relatively new concept of OPEN BANKING, which made APIs - specifically REST APIs- are exposed to the public internet. thus, the security architecture becomes extremely important
As a security Architect, i need to keep up with business demand for OPEN BANKING which in summary and for agreement's sake only, allowing API to be called over web developed links via public internet. when it comes to API security implementations, applying HTTPs Basic Authentication, API keys and secrets, or token-based authentication, are the easiest security controls that comes into mind. Neglecting some major concerns as identity theft, claim exposure, confidential data leakage, PII exposure. and off course OWASP top 10 API Security risks and its vulnerabilities.
Jacob Ideskog, VP at Curity invented the API Security Maturity Model, inspired by the Richardson Maturity Model, which outlines the levels of securing APIs and identifying who is calling those APIs, better yet, secure who doing what? (Authorization) and finally Applying API Zero Trust Architecture (ZTA) as stated in NIST SP 800-207. I know, I am going to explain this the APIs security model in the next few lines, this API security maturity model is presented in the following illustration.
At Level 0, we - or developers - use Basic Authentication or API keys and secrets to identify - an only identify - who is calling our APIs. So, we basically provided information about the user and give him pre-configured static API key and secret to apply whether in the header or the body of the URI of those API requests (calls).
Security shortfalls:
At Level 1 we just added a layer of security - just a thin layer - which - in short - whomever have access to the token can use the service by utilize Access Tokens for authentication within a token-based architecture.
these authentication Tokens delineate the type of user (machine, app, user, etc.). As this enables privileged access but again does not control what scope of privileged access is the person or the machine is allowed to execute.
Security shortfalls:
Level 2: Token-Based Authorization
Here we finally introduced the concept of SCOPES which is defined thoroughly in OAuth 2.0 framework (Please see RFC 6749)
Again, saving you form reading, in summary, SCOPES has the following specifications
This Level 2 Requires the introduction of IdP (Identity Provider Server or IAM) which will help in creating and validating scopes. it is also called OAuth 2.0 server RFC 8414. The permission can be anything really, when it comes to scope, i - personally- would like to classify permission into 4 main categories
Security shortfalls:
Back to OPEN BANKING domain, off course to secure the above types of tokens, information within the token should be encrypted and then signed- it is called payload encryption and digital signage - to prevent data leakage, insure information integrity, and to comply with the banking regulators and financial services such as PCI Security Standards Council (PCI-DSS v4.0), and GDBR, The federal regulators in USA like OCC and FDIC, and locally in KSA The Saudi Arabian Monetary Authority Cybersecurity Framework (SAMA CSF).
I will address token encryption and digital signature further on this article, keep reading!
Level 3: Centralized Trust Using Claims
in that level Jacob Ideskog has elevated the security of API calls to another level, architecturally, is this level we has the concept of Spaghetti of trust removed, as he is not going to trust any of the introduced IdP, rather than trust his own identity server, so the flow, will be as follows
Security shortfalls:
I would like to pause a little before explaining level 4 and take that chance to talk about token encryption and digital signing as i stated before in this article.
领英推荐
JWT, JWE, JWS and the difference between them.
in short, JOSN Web Tokens (JWTs) are compact, URL-safe means of representing claims or scopes to be transferred between API caller and API point of authority (IdP or IAM). The claims in a JWT are encoded as a JSON object in BASE64 format. which can be easily decoded by and BASE64 decoding tools can be found freely on the internet. decoding JWT will reveal a lot of information that could be sensitve or highly confidential specially in the OPEN BANKING domain. which reveling this information may result on lawsuits, penalties by the regulator, or even license temporarily or permanently being suspended. plus, JWT is subject to alteration, if i know JSON, i can intercept any JWT and modify it, for example as a client for Bank (A) my maximum credit limit in $5000.00 and i can change it $50,000.00. Thank God! it is not that easy.
Now, here it come JOSN Web Signature (JWS) Security experts (not me!) has developed a security control to protect for altering or modifying JWTs, i cannot longer change my credit limit. which is by digitally sign the JWT - so it becomes JWS- the digitally sign token can protect the integrity and the authenticity of token. A JWS represents content secured with digital signatures or Message Authentication Codes (MACs)
note: Digital Signature only provide integrity and authenticity of the token as described
Integrity: meaning the token payload never been changed or altered of MACs calculation will fail.
Authenticity: assurance that the issuer of the token, is what he/she/it claims to be (for example IdP). by have PKI infrastructure IdP can sign the JWT with its private key and the target endpoint can validate the signature by a shred previously public key, and if the signature failed to be validated, that it is not from the true issuer, thus, the token is market invalid. So, no one is able try A man-in-the-middle (MITM) attack.
Important note: Digital Signature has nothing to do with encryption, token payloads are in a clear text as they traverse the public internet (BASE64 encoded). so, any attack of data leakage is still can happened - witch is actually reported by 30% of the total attacks in 2024 API security market research report- see below
So, to provide confidentially (covering those sensitive 30% of excess data exposure) JSON Web Encryption (JWE) come into place as form of encrypted JWT, now, no one expect the token issuer and the entity that has the decryption key can actually read and validate the content of the JWT payload, which bring us to the final level of the API security maturity model, level 4 Claims - Highly evolved identity -based API security and the use of Opaque Token
Level 4: Claims – Highly evolved identity-based API Security?
This level is revolving on two main principles to achieve the highest security of your APIs and that is truly what you need when you are pushed by business to implement OPEN BANKING that is called Zero Trust Architecture (ZTA) which is called upon specifically for APIs by NIST SP 800-207
Trust Claims, NOT Attributes: in this first principle i would like to ease it out by giving a little example, if i may, Let's say I am " Samir Reyad " and you are a policeman who has a duty to verify my information. Let's start my me, I am subject, my name is an attribute, my age is also an attribute, my gender is also an attribute and on and on.
So, when i present to you the National ID or my Driving license you should verify claims and should not verify attributes, the claim in this example is my driving license issued by the National Traffic Bureau NOT my attributes form within. so, all they attribute within my driving license is asserted to be truthful by the police ONLY. i hope the below illustration explain this example of the first principle.
so, after the policeman checks my driving license, he can always say let go the traffic bureau main office to verify that claim in my hand, off course, that defeat the purpose of authorization and delay me as well - think of the data traversing- can you imagine for while that we reach the area which i will not be able to read my own driving license. When it was issued to me at the National Traffic Bureau, I have been instructed to just give it as is to the policeman on the street and he will take care of validating you. HOW COOL IS THAT ?! in terms of security OfCourse. this is what's happening in the Opaque Token architecture, Opaque tokens cannot be read by clients that hold them since they are undecodable strings (encrypted) clients just use them as is without knowing its content, the illustration below explain the concepts of Opaque token and level 4 of the API Security Maturity Model
Note: I have made an architecture Illustration for Level 4 only as it is the most secure and intended and recommended for OPEN BANKING services,
Important Note: it is recommended to use JWT for internal API calls within your origination and use Opaque Token for Publicly exposed API (over the Internet).
who do we trust? participants in trust: back to the API security, obviously the participants in trust are very few as listed below
Trust No one - Zero Trust: depending on the previous information, trust should be split between the Authoritative Point and the relying point, this approach will achieve the following security controls in addition to applying ZTA (Zero Trust Architecture).
Conclusion
Finally, this article was made to illustrate the API security maturity model and the benefit of reaching level 4 or the top level of security. especially when we talk about financial services and OPEN BANKING. let me tell you, level 4 of the API security maturity model it is not for everyone. and Opaque Token architecture is not easy to achieve. but if you are working at a bank as a security architect it worth a while to explore thoroughly and implement such architecture for your bank API most secure API Model. however, if your organization are not involved heavily in using online digital payment or wants to become a payment hub or have a plan to develop Digital wallets, then, Level 3 or Level 2 in the API security maturity model is the one recommended for you.
References
Cyber/Information Security, Risk Professional
2 个月Worth KB article. Keep it up Samir Reyad
Manager Training at Bahrain Institute of Technology
2 个月I agree
Senior Manager-Technology Strategy & Transformation
2 个月Great article, Samir