Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Threat_Modelling_Serverless_APIs.pdf

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Matt Gillard Matt Gillard
November 09, 2022
30

 Threat_Modelling_Serverless_APIs.pdf

Current events have put the unauthorised access of customer personal information in the spotlight like never before. A lot of these breaches should never have happened if basic security best practices are implemented.
In this session we will run through an overview of how to threat model a fictitious organisations API and describe ways to mitigate risk to stop unintentional access by third parties. While the title mentions Serverless, the techniques apply for Serverful architectures as well. The talk will use AWS as the cloud of choice, but the choice of cloud is just an implementation detail.

Avatar for Matt Gillard

Matt Gillard

November 09, 2022

Transcript

  1. Under the Notifiable Data Breaches (NDB) scheme any organisation or

    agency the Privacy Act 1988 covers must notify affected individuals and the OAIC when a data breach is likely to result in serious harm to an individual whose personal information is involved. https://www.oaic.gov.au/privacy/notifiable-data-breaches/about-the-notifiable-data-breaches-scheme#:~:text=Under%20the%20Notifiable%20Data% 20Breaches,whose%20personal%20information%20is%20involved.
  2. Problems with Enterprise Security Culture • Security by checkbox ◦

    CSPM tools implemented without context ◦ Treating all threats equally • Application teams want the app to “just work” • Cloud guardrails deployed inconsistently
  3. Requirements • Internet accessible API • User signs up and

    provides Name/Address/Identification information • Keep PII secure from unauthorized access • Delete data when no longer needed
  4. - Lateral network movement - Unintended external access from Internet

    - Unauthorised access to Database - Threat of data exfiltration - Unauthorised access to ec2 - Unauthorised access to api HIGH HIGH HIGH HIGH
  5. - Unauthorised API access - Unauthorised Lambda function execution -

    Unauthorised access to Database - Threat of data exfiltration LOW MEDIUM MEDIUM
  6. - Unauthorised API access - Unauthorised Lambda function execution -

    Unauthorised access to Database - Threat of data exfiltration MED LOW LOW LOW LOW (with field encryption)
  7. Example - Mitigate unauthorized data exfiltration with application encryption •

    A single encryption key for all data? • A single encryption key per customer? ❌ ✅ • Encrypt again with a service key! ✅
  8. Function Policy Definition Read Only Database permissions Read Only Secrets

    Manager permissions Decrypt Only KMS with RequestAlias condition key
  9. If the secrets manager key is deleted - not possible

    to decrypt field Otherwise pass in field to decrypt, KMS alias and secrets mgr key Store ciphertext in the DB as base64, so decode first First decrypt with KMS service key Second decrypt with unique user key
  10. Summary • Security is everyone’s responsibility • Everything should be

    least privilege ◦ This means you are not relying on any one control for protection • Complexity adds threats • Workshop threat modelling on your next project!
  11. Threat Modelling 4 Risk assess each threat and allocate owner

    Probability Impact High High Medium Medium Low Low