SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Security Patterns
for Software Development
Narudom Roongsiriwong, CISSP
OWASP Meeting, July 30, 2020
WhoAmI
● Lazy Blogger
– Japan, Security, FOSS, Politics, Christian
– http://narudomr.blogspot.com
● Information Security since 1995
● Web Application Development since 1998
● SVP, Head of IT Security, Kiatnakin Bank PLC (KKP)
● Committee Member, Thailand Banking Sector CERT (TB-CERT)
● APAC Research Advisory Council Member at Cloud Security Alliance Asia Pacific
● Consultant, OWASP Thailand Chapter
● Committee Member, National Digital ID Project, Technical Team
● Chief Information Security Officer (CISO) of the Year 2017, NetworkWorld Asia
● Contact: narudom@owasp.org
What Is Security Patterns
Design patterns those can be applied to achieve goals
in the area of security
Classical design patterns have different instantiations
to fulfill some information security goal: such as
confidentiality, integrity and availability.
Additionally, one can create a new design pattern to
specifically achieve some security goal such as non-
repudiation
Approach to Software Development
UML/OCL
Models,
Security
Patterns
Model
Checking and
Composability
of Systems
Vulnerability
Analysis, Code
Examination,
Best Practices
Theoretical
Analysis of
Security
Model-
Driven
Security
Code Based
Security
Verification
Certification
Certification
Value of Patterns
● Reusable solutions, but maybe not directly, usually require
tailoring
● Encapsulate experience and knowledge of designers (best
practices)
● Free of errors after a while
● Need to be cataloged to be useful
● Used as guidelines for design
● Good to evaluate systems and standards
● Useful for teaching
Why Security Patterns
● Gaps in knowledge
● Gaps in coverage
● Risks that are complicated and subtle
● Broad range of issues
● Different kinds of expert knowledge
Basic Knowledge of Cryptography
● The following security patterns heavily based on
cryptography.
● Two cryptography categories
– Encryption
– Hashing
Types of Cryptography
Secret Writing
Confidentiality
Control
Masking
Overt
Covert
Encryption
Hashing
Steganography
Digital
Watermarking
Symmetric Asymmetric
Speed Very fast and efficient in encrypting
large volumes of data
Computationally intensive and much slower
Key Exchange &
Management
Both the sender and the receiver must
have a mechanism in place to share the
key without compromising its secrecy.
Exchange public key freely but management
including identification requires a public key
infrastructure (PKI) in some format such as
X.509 or blockchain
Scalability Not very scalable, the number of keys
required depends on the number of
users or parties involved in secure
transaction.
Only two keys needed per user: one that is
private and
held by the sender and the other that is
public
Nonrepudiation Does not provide proof
of origin
The sender cannot deny sending the
message when the message has been
encrypted using the private key of the
sender
Encryption
Two Usage of Asymmetric Encryption
Confidentiality assurance in asymmetric key cryptography
Encrypt
Decrypt
Plaintext PlaintextCipher Text
Bob’s Public Bob’s Private
Decrypt
Encrypt
BobAlice Alice’s Private Alice’s Public
Proof of origin assurance in asymmetric key cryptography
Encrypt
Decrypt
Plaintext PlaintextCipher Text
Bob’s Public Bob’s Private
Decrypt
Encrypt
BobAlice
Alice’s Private Alice’s Public
Accountability
● Condenses arbitrary
message to fixed size
– h = H(M)
● Usually assume hash
function is public
● Hash used to detect
changes to message
● Well-know hash functions:
SHA-1, SHA-2 (SHA-256,
SHA-512), SHA-3
Hashing
Examples of Security Patterns
Pattern#1: Sending Encrypted Message or File
Data
Encrypt key
using receiver’s
public key
RSA
Encrypted Message
Encrypt Decrypt
Encrypt data
using random
key
q4fzNeBCRSYqv
Encrypted Key
Generate
Random
Key
Data
TIakvAQkCu2u
Random Key
Encrypted Message
Data
q4fzNeBCRSYqv
Encrypted Key
Decrypt data
using key
Decrypt using
receiver’s
private key
RSA
TIakvAQkCu2u
Data
● Use OpenPGP Standard
● Combine strength of
symmetric (fast) and
asymmetric (recipient only)
cryptography
● For multiple recipients, each
of their public keys is used to
encrypt a copy of the same
secret (symmetric key)
● Support libraries
https://www.openpgp.org/soft
ware/developer/
Pattern#2: Microservice Architecture Access Control
● Problems
– Access control logic needs to be handled in each microservice
– A microservice only handles a single business logic thus the
global access control logic should not be placed in the
microservice implementation
– HTTP is a stateless protocol
– Access control schemes need to be considered to ensure the
security of the application
Pattern#2: Microservice Architecture Access Control
Microservices
API
Gateway
Service
Service
Service
Service
Identity
Provider
Log
TLS
Pattern#2: Microservice Architecture Access Control
:Client :API Gateway :Identity Provid... :Service
authenticate
return access token
authenticate
return access token
call { access token }
service response
validate token
return authentication
service response
call service
Viewer does not support full SVG 1.1
Pattern#3: Federation and Assertion
● Federation: a process that
allows for the conveyance
of authentication attributes
and subscriber attributes
across networked systems
● NIST SP800-63c
● Two types of assertion
presentation
– Back channel presentation
(recommended)
– Front channel presentation
IdP = Identity Provider, RP = Relying Party
Pattern#3: Federation and Assertion
Back Channel Assertion
● The subscriber is given an
assertion reference to
present to the RP, generally
through the front channel.
● The assertion reference
itself contains no
information about the
subscriber and SHALL be
resistant to tampering and
fabrication by an attacker.
Pattern#3: Federation and Assertion
NDID – Out of Band Assertion
● NDID – National Digital Identity
● The subscriber tells the RP
which IdP for assertion.
● The RP will send the request
message the IdP for assertion.
● The IdP will ask the subscriber
authentication/approval with
the request message
● If the subscriber confirms, the
assertion will be sent to the RP
Pattern#4: Strong Authentication
FIDO Protocol is one of this pattern implementation
But we can implement our own way
Pattern#4: Strong Authentication – Registration
Pattern#4: Strong Authentication – Authentication
Pattern#4: Strong Authentication – Transaction
Pattern#4: Strong Authentication – Deregistration
Pattern#5: Pinning
● What's the problem
– Applications expect end-to-end security on their secure channels,
but some secure channels are not meeting the expectation
● What Is Pinning
– The process of associating a host with their expected X.509
certificate or public key by associated or 'pinned' them to the host
● How Do You Pin
– To harden the channel, the program would take advantage of the
OnConnect callback offered by a library, framework or platform. In
the callback, the program would verify the remote host's identity
by validating its certificate or public key
Pattern#5: Pinning – What Should Be Pinned
Public
Certificate Public Key Hash of Certificate
Information
(full or partial)
Reference: https://owasp.org/www-community/controls/Certificate_and_Public_Key_Pinning
Security Patterns for Software Development

Mais conteúdo relacionado

Mais procurados

PHISHING DETECTION
PHISHING DETECTIONPHISHING DETECTION
PHISHING DETECTION
umme ayesha
 
Application Security
Application SecurityApplication Security
Application Security
florinc
 

Mais procurados (20)

Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017
 
Phishing detection & protection scheme
Phishing detection & protection schemePhishing detection & protection scheme
Phishing detection & protection scheme
 
IT Security Awareness-v1.7.ppt
IT Security Awareness-v1.7.pptIT Security Awareness-v1.7.ppt
IT Security Awareness-v1.7.ppt
 
Threat Modeling In 2021
Threat Modeling In 2021Threat Modeling In 2021
Threat Modeling In 2021
 
Network security
Network security Network security
Network security
 
Why upgrade your MFA to Adaptive Authentication?
Why upgrade your MFA to Adaptive Authentication?Why upgrade your MFA to Adaptive Authentication?
Why upgrade your MFA to Adaptive Authentication?
 
Incident Response in the age of Nation State Cyber Attacks
Incident Response in the age of Nation State Cyber AttacksIncident Response in the age of Nation State Cyber Attacks
Incident Response in the age of Nation State Cyber Attacks
 
Threat Modelling
Threat ModellingThreat Modelling
Threat Modelling
 
Cyber security
Cyber securityCyber security
Cyber security
 
PHISHING DETECTION
PHISHING DETECTIONPHISHING DETECTION
PHISHING DETECTION
 
ESP.ppt
ESP.pptESP.ppt
ESP.ppt
 
Topics in network security
Topics in network securityTopics in network security
Topics in network security
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 
Application Security
Application SecurityApplication Security
Application Security
 
Cybersecurity Basics.pptx
Cybersecurity Basics.pptxCybersecurity Basics.pptx
Cybersecurity Basics.pptx
 
Phishing Detection using Machine Learning
Phishing Detection using Machine LearningPhishing Detection using Machine Learning
Phishing Detection using Machine Learning
 
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRACYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
CYBER CRIME PRESENTATION PART 2 BY KRISHNAKNT ARUNKUMAR MISHRA
 
Two factor authentication 2018
Two factor authentication 2018Two factor authentication 2018
Two factor authentication 2018
 
Cyber Security 101: Training, awareness, strategies for small to medium sized...
Cyber Security 101: Training, awareness, strategies for small to medium sized...Cyber Security 101: Training, awareness, strategies for small to medium sized...
Cyber Security 101: Training, awareness, strategies for small to medium sized...
 
API Security Lifecycle
API Security LifecycleAPI Security Lifecycle
API Security Lifecycle
 

Semelhante a Security Patterns for Software Development

Encryption in Cryptography
Encryption in CryptographyEncryption in Cryptography
Encryption in Cryptography
Uttara University
 
Data security for any organization by using public key infrastructure compone...
Data security for any organization by using public key infrastructure compone...Data security for any organization by using public key infrastructure compone...
Data security for any organization by using public key infrastructure compone...
eSAT Journals
 

Semelhante a Security Patterns for Software Development (20)

An Identity-Based Mutual Authentication with Key Agreement
An Identity-Based Mutual Authentication with Key AgreementAn Identity-Based Mutual Authentication with Key Agreement
An Identity-Based Mutual Authentication with Key Agreement
 
Encryption in Cryptography
Encryption in CryptographyEncryption in Cryptography
Encryption in Cryptography
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
 
Single Sign-On & Strong Authentication
Single Sign-On & Strong AuthenticationSingle Sign-On & Strong Authentication
Single Sign-On & Strong Authentication
 
Ledingkart Meetup #3: Security Basics for Developers
Ledingkart Meetup #3: Security Basics for DevelopersLedingkart Meetup #3: Security Basics for Developers
Ledingkart Meetup #3: Security Basics for Developers
 
ZKorum: Building the Next Generation eAgora powered by SSI
ZKorum: Building the Next Generation eAgora powered by SSIZKorum: Building the Next Generation eAgora powered by SSI
ZKorum: Building the Next Generation eAgora powered by SSI
 
OpenId Connect Protocol
OpenId Connect ProtocolOpenId Connect Protocol
OpenId Connect Protocol
 
Alfresco DevCon 2019: Encryption at-rest and in-transit
Alfresco DevCon 2019: Encryption at-rest and in-transitAlfresco DevCon 2019: Encryption at-rest and in-transit
Alfresco DevCon 2019: Encryption at-rest and in-transit
 
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
 
Secure 3 kany-vanda
Secure 3 kany-vandaSecure 3 kany-vanda
Secure 3 kany-vanda
 
Cryptography
Cryptography Cryptography
Cryptography
 
Introduction of an SSL Certificate
Introduction of an SSL CertificateIntroduction of an SSL Certificate
Introduction of an SSL Certificate
 
What is digital signature or DSC
What is digital signature or DSCWhat is digital signature or DSC
What is digital signature or DSC
 
Security Best Practices for Your Ignition System
Security Best Practices for Your Ignition SystemSecurity Best Practices for Your Ignition System
Security Best Practices for Your Ignition System
 
Skyriver Communications – Fixed Wireless Security
Skyriver Communications – Fixed Wireless SecuritySkyriver Communications – Fixed Wireless Security
Skyriver Communications – Fixed Wireless Security
 
Cyber security workshop talk.pptx
Cyber security workshop talk.pptxCyber security workshop talk.pptx
Cyber security workshop talk.pptx
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
Design of Hybrid Cryptography Algorithm for Secure Communication
Design of Hybrid Cryptography Algorithm for Secure CommunicationDesign of Hybrid Cryptography Algorithm for Secure Communication
Design of Hybrid Cryptography Algorithm for Secure Communication
 
Development of Digital Identity Systems
Development of Digital Identity Systems Development of Digital Identity Systems
Development of Digital Identity Systems
 
Data security for any organization by using public key infrastructure compone...
Data security for any organization by using public key infrastructure compone...Data security for any organization by using public key infrastructure compone...
Data security for any organization by using public key infrastructure compone...
 

Mais de Narudom Roongsiriwong, CISSP

Mais de Narudom Roongsiriwong, CISSP (20)

Biometric Authentication.pdf
Biometric Authentication.pdfBiometric Authentication.pdf
Biometric Authentication.pdf
 
Security Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdfSecurity Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdf
 
How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19
 
Secure Software Design for Data Privacy
Secure Software Design for Data PrivacySecure Software Design for Data Privacy
Secure Software Design for Data Privacy
 
Blockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for DummiesBlockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for Dummies
 
DevSecOps 101
DevSecOps 101DevSecOps 101
DevSecOps 101
 
National Digital ID Platform Technical Forum
National Digital ID Platform Technical ForumNational Digital ID Platform Technical Forum
National Digital ID Platform Technical Forum
 
IoT Security
IoT SecurityIoT Security
IoT Security
 
Embedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment IndustryEmbedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment Industry
 
Secure Your Encryption with HSM
Secure Your Encryption with HSMSecure Your Encryption with HSM
Secure Your Encryption with HSM
 
Application Security Verification Standard Project
Application Security Verification Standard ProjectApplication Security Verification Standard Project
Application Security Verification Standard Project
 
Coding Security: Code Mania 101
Coding Security: Code Mania 101Coding Security: Code Mania 101
Coding Security: Code Mania 101
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security Problems
 
OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)
 
Securing the Internet from Cyber Criminals
Securing the Internet from Cyber CriminalsSecuring the Internet from Cyber Criminals
Securing the Internet from Cyber Criminals
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
Secure Software Development Adoption Strategy
Secure Software Development Adoption StrategySecure Software Development Adoption Strategy
Secure Software Development Adoption Strategy
 
Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
 
Application Security: Last Line of Defense
Application Security: Last Line of DefenseApplication Security: Last Line of Defense
Application Security: Last Line of Defense
 
AnyID and Privacy
AnyID and PrivacyAnyID and Privacy
AnyID and Privacy
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Security Patterns for Software Development

  • 1. Security Patterns for Software Development Narudom Roongsiriwong, CISSP OWASP Meeting, July 30, 2020
  • 2. WhoAmI ● Lazy Blogger – Japan, Security, FOSS, Politics, Christian – http://narudomr.blogspot.com ● Information Security since 1995 ● Web Application Development since 1998 ● SVP, Head of IT Security, Kiatnakin Bank PLC (KKP) ● Committee Member, Thailand Banking Sector CERT (TB-CERT) ● APAC Research Advisory Council Member at Cloud Security Alliance Asia Pacific ● Consultant, OWASP Thailand Chapter ● Committee Member, National Digital ID Project, Technical Team ● Chief Information Security Officer (CISO) of the Year 2017, NetworkWorld Asia ● Contact: narudom@owasp.org
  • 3. What Is Security Patterns Design patterns those can be applied to achieve goals in the area of security Classical design patterns have different instantiations to fulfill some information security goal: such as confidentiality, integrity and availability. Additionally, one can create a new design pattern to specifically achieve some security goal such as non- repudiation
  • 4. Approach to Software Development UML/OCL Models, Security Patterns Model Checking and Composability of Systems Vulnerability Analysis, Code Examination, Best Practices Theoretical Analysis of Security Model- Driven Security Code Based Security Verification Certification Certification
  • 5. Value of Patterns ● Reusable solutions, but maybe not directly, usually require tailoring ● Encapsulate experience and knowledge of designers (best practices) ● Free of errors after a while ● Need to be cataloged to be useful ● Used as guidelines for design ● Good to evaluate systems and standards ● Useful for teaching
  • 6. Why Security Patterns ● Gaps in knowledge ● Gaps in coverage ● Risks that are complicated and subtle ● Broad range of issues ● Different kinds of expert knowledge
  • 7. Basic Knowledge of Cryptography ● The following security patterns heavily based on cryptography. ● Two cryptography categories – Encryption – Hashing
  • 8. Types of Cryptography Secret Writing Confidentiality Control Masking Overt Covert Encryption Hashing Steganography Digital Watermarking
  • 9. Symmetric Asymmetric Speed Very fast and efficient in encrypting large volumes of data Computationally intensive and much slower Key Exchange & Management Both the sender and the receiver must have a mechanism in place to share the key without compromising its secrecy. Exchange public key freely but management including identification requires a public key infrastructure (PKI) in some format such as X.509 or blockchain Scalability Not very scalable, the number of keys required depends on the number of users or parties involved in secure transaction. Only two keys needed per user: one that is private and held by the sender and the other that is public Nonrepudiation Does not provide proof of origin The sender cannot deny sending the message when the message has been encrypted using the private key of the sender Encryption
  • 10. Two Usage of Asymmetric Encryption Confidentiality assurance in asymmetric key cryptography Encrypt Decrypt Plaintext PlaintextCipher Text Bob’s Public Bob’s Private Decrypt Encrypt BobAlice Alice’s Private Alice’s Public Proof of origin assurance in asymmetric key cryptography Encrypt Decrypt Plaintext PlaintextCipher Text Bob’s Public Bob’s Private Decrypt Encrypt BobAlice Alice’s Private Alice’s Public Accountability
  • 11. ● Condenses arbitrary message to fixed size – h = H(M) ● Usually assume hash function is public ● Hash used to detect changes to message ● Well-know hash functions: SHA-1, SHA-2 (SHA-256, SHA-512), SHA-3 Hashing
  • 13. Pattern#1: Sending Encrypted Message or File Data Encrypt key using receiver’s public key RSA Encrypted Message Encrypt Decrypt Encrypt data using random key q4fzNeBCRSYqv Encrypted Key Generate Random Key Data TIakvAQkCu2u Random Key Encrypted Message Data q4fzNeBCRSYqv Encrypted Key Decrypt data using key Decrypt using receiver’s private key RSA TIakvAQkCu2u Data ● Use OpenPGP Standard ● Combine strength of symmetric (fast) and asymmetric (recipient only) cryptography ● For multiple recipients, each of their public keys is used to encrypt a copy of the same secret (symmetric key) ● Support libraries https://www.openpgp.org/soft ware/developer/
  • 14. Pattern#2: Microservice Architecture Access Control ● Problems – Access control logic needs to be handled in each microservice – A microservice only handles a single business logic thus the global access control logic should not be placed in the microservice implementation – HTTP is a stateless protocol – Access control schemes need to be considered to ensure the security of the application
  • 15. Pattern#2: Microservice Architecture Access Control Microservices API Gateway Service Service Service Service Identity Provider Log TLS
  • 16. Pattern#2: Microservice Architecture Access Control :Client :API Gateway :Identity Provid... :Service authenticate return access token authenticate return access token call { access token } service response validate token return authentication service response call service Viewer does not support full SVG 1.1
  • 17. Pattern#3: Federation and Assertion ● Federation: a process that allows for the conveyance of authentication attributes and subscriber attributes across networked systems ● NIST SP800-63c ● Two types of assertion presentation – Back channel presentation (recommended) – Front channel presentation IdP = Identity Provider, RP = Relying Party
  • 18. Pattern#3: Federation and Assertion Back Channel Assertion ● The subscriber is given an assertion reference to present to the RP, generally through the front channel. ● The assertion reference itself contains no information about the subscriber and SHALL be resistant to tampering and fabrication by an attacker.
  • 19. Pattern#3: Federation and Assertion NDID – Out of Band Assertion ● NDID – National Digital Identity ● The subscriber tells the RP which IdP for assertion. ● The RP will send the request message the IdP for assertion. ● The IdP will ask the subscriber authentication/approval with the request message ● If the subscriber confirms, the assertion will be sent to the RP
  • 20. Pattern#4: Strong Authentication FIDO Protocol is one of this pattern implementation But we can implement our own way
  • 22. Pattern#4: Strong Authentication – Authentication
  • 24. Pattern#4: Strong Authentication – Deregistration
  • 25. Pattern#5: Pinning ● What's the problem – Applications expect end-to-end security on their secure channels, but some secure channels are not meeting the expectation ● What Is Pinning – The process of associating a host with their expected X.509 certificate or public key by associated or 'pinned' them to the host ● How Do You Pin – To harden the channel, the program would take advantage of the OnConnect callback offered by a library, framework or platform. In the callback, the program would verify the remote host's identity by validating its certificate or public key
  • 26. Pattern#5: Pinning – What Should Be Pinned Public Certificate Public Key Hash of Certificate Information (full or partial) Reference: https://owasp.org/www-community/controls/Certificate_and_Public_Key_Pinning