SlideShare uma empresa Scribd logo
1 de 48
Static Analysis Security Tools
in
QIWI Secure Development Life Cycle
Ivan Elkin
Application Security Expert
Qiwi
~$ whoamI
- Qiwi, Application Security
- Developer
- Vulners.com team
- JBFC Member 😀
More than Two Years ago...
Qiwi Development Lifecycle
Business
QA
Support
ISEC
TASK
DEV
Testing
Regress
testing
Bug
Development
Functional
bug
New
TASK
Release
Qiwi OLD Development Lifecycle
Business
QA
Support
ISEC
TASK
DEV
Testing
Regress
testing
Release
Bug
Development
Functional
bug
New
TASK
ISEC
ISEC tests
Qiwi OLD Development Lifecycle
Testing
Regress
testing
Release
Functional
bug
New
TASK
ISEC
ISEC tests
First standard steps were:
- Periodical Pentests
- Bug bounty program
- Deep dive into code of each
release
- Some Fuzz scans on several
projects
- ….
- ….
- Lots of other standard sec-staff
Qiwi OLD Development Lifecycle
Testing
Regress
testing
Release
Functional
bug
New
TASK
ISEC
ISEC tests
But:
- Low test coverage
- Manual testing takes time
- You have no time
- Some functionality you didn’t
hear before bug found
- More than 30 big
projects/applications!
Sometimes it was like a fire
fighting…
- Hackerone
- Real Attacks
Qiwi OLD Development Lifecycle
First hours after BugBounty program open
Task:
- More than 30 projects and applications
- 6 main programming languages
- Horde of programmers
- Infinity of business tasks
- 1-2 AppSec specialist
…
How to protect the internet from ourselves?
Something should be changed… we want SDLC!
So we expected:
Secure Development Lifecycle by MS
Secure Development Lifecycle by MS
Secure Development Lifecycle by MS
Secure Development Lifecycle by MS
Automate all the things!!
Things we’ve done
QSDL
Business
QA
Support
ISEC
TASK
Refactoring
Testing
Regress
testing
Release
Bug
Development
Functional
bug
New
TASK
Scanners
ISEC
SDLC
SA
QA
TRBL
ISEC
TASK
Refactoring
QSDL - New Task
In case of new task
- Threat modeling
- First security review
- If task relates on side project, makes security
review and testing of it
Testing
Bug
Programming
QSDL - Design and Programming
- Now programmers know what does it mean:
XSS and so on, so design and development
with a concept of secure programming
- Trigger on TeamCity test-deploys will start
SAST after programmer merge pull request to
release-branch
- Emailing about new found vulnerabilities by
SAST
- Automotive tasks in Jira
- Anytime review of previous scans with detailed
inspection of scan alert
This concept is actual for project with short lifecycle (release several time in a week)
Testing
Regress
testingBug
Programming
QSDL - Pre-Release Cycle
- Verification by SAST, trigger on
TeamCity before release deploy
- Auto Fuzz-tests
- Manual pentests, extra scanners
- Security code-review
This concept is actual for project with long lifecycle (release one time in a two week)
QSDL - Release
- In the context of a short release cycle we check the
opportunity of release (the results of the intermediate
Autotest), and provides recommendations for changes
- Monitoring of releases by ourselves
Release
QSDL
SA
QA
TRBL
ISEC
TASK
Refactoring
Testing
Regress
testing
Release
Bug
Programming
Functional
bug
New
TASK
Scanner
ISEC
SD
SAST
Static code analysis tool:
- searching security
bugs by creating DOM-model of
program code calls
- one of key spec is
searching of second order
injections, stored injections and
so on by walking through DOM-
tree
- Some Vendors sells it
as a main tool of SDLC flow
Other good features
- Best Coding Practice
- Deprecated methods
- Syntax sugar
- Seraching of logic errors => performance improvement
- Infinite loop
- Switch without Break
- Inline If
- Buffer size which depends on user input
- Empty exceptions
- Syntax errors
- Bad Classcasts
Not so ideal...
CX
SAST Scanner - Under the hood
1. How to start scan
Vendor told:
“.. Scanner should receive only clear
code”
And he is right!
Ok, but what about
Libraries
Dependencies
Maven
Dynamic Code Injection
SAST Scanner - Under the hood
- source pulling
- compile
- code injecting
- custom flow
- monitoring
- mail
- tags
Control Server
SAST Scanner - Under the hood
Welcome! Project which compress project for another project to scan
second project!
Common process of deploy and scans
- Developer start task in TC (hook, or manual)
- TC build-agent start client-script which send request about branch to Control
Server (CVS, brunch, build-id)
- Control Server
- Fetch source from VCS
- Compile code
- Fetch dependency from VCS or Maven (if you have sources)
- Make own Dependency injection flow (if SAST not support it)
- Make own program langs flow
- Monitoring everything works
- Results
- TC tags for builds (if build is vulnerable, we can’t pass it to release)
- Email to ISEC and Developer
- Monitoring everything done
SAST Scanner - Under the hood
2. I want to see full flow from
client to server
So, I Expect
Vendor told:
“.. Each part of code should be
independent ..”
And he is right!
SAST Scanner - Under the hood
JS JAVA PLSQLJAVA
SAST Scanner - Under the hood
3. I want to write dynamic code!!!
All we are love a dynamic code with
Dependency Injections
Generics and so on
public interface FieldsChanger {
Collection<FormField> change(FieldsChangerDTO fieldsChangerDTO);
}
<bean id="fieldsChanger"
class="ru.mw.webui.person.form.changer.ExtendableFieldsChanger">
<constructor-arg>
<map key-type="ru.mw.webui.person.data.FieldSetRule">
<entry key-ref="mainFieldSetRule">
<bean class="ru.mw.webui.person.form.changer.PlaceHolderFieldsChanger"/>
</entry>
Vendor told:
“.. Not all code can be static analysed ..”
And he is right!
But we can do: dynamic -> static
public interface FieldsChanger {
Collection<FormField> change(FieldsChangerDTO fieldsChangerDTO);
}
public interface FieldsChanger1 {
Collection<DefaultFormField> change(DefaultFieldsChangerDTO fieldsChangerDTO);
}
SAST Scanner - Under the hood
4. I want to write on Scala, Go and use all
new Frameworks!
Vendor told:
“.. You are so modern
… everything for your money! ..”
And he is right!
SAST Scanner - Under the hood
5. It found only one XSS and 100500 strange
things!? What happen???
Vendor told:
“.. Each project is unique
and each has own bicycles! ..”
And he is right!
Be ready to read tons of code!
Bad news:
- while we set up scanner, some guys found two real good bugs first
:(
Remember:
- look into all types of bugs some could be signed as low-level
- some frameworks still not supported out of the box
So,
To start it
- Put all your libraries to own CDN
- Write 20k lines of code for Control Server and Client
- Invent your own compiling system
- Write your own monitoring system
To make code ‘scannable’
- Read kilometers of code
- Find each input and output points
- Write more than 100 own rules of scans
Achieved:
- Found about 25 bugs in main projects
- XXE, RCE, XSS, SQLi
- 32 projects were added to autoscan
- Full SDLC in you company!
- It was made by 2 people !!
Thanx!
Questions?
@vankyv3r

Mais conteúdo relacionado

Mais procurados

Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the serverArquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the serverLukáš Fryč
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test toolKnoldus Inc.
 
DBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse EngineeringDBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse EngineeringSahil Dhar
 
All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...
All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...
All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...DevOpsDays Tel Aviv
 
FRIDA 101 Android
FRIDA 101 AndroidFRIDA 101 Android
FRIDA 101 AndroidTony Thomas
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debuggerIulian Dragos
 
DAST in CI/CD pipelines using Selenium & OWASP ZAP
DAST in CI/CD pipelines using Selenium & OWASP ZAPDAST in CI/CD pipelines using Selenium & OWASP ZAP
DAST in CI/CD pipelines using Selenium & OWASP ZAPsrini0x00
 
Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.Future Processing
 
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...ZongXian Shen
 
PVS-Studio features overview (2020)
PVS-Studio features overview (2020)PVS-Studio features overview (2020)
PVS-Studio features overview (2020)Andrey Karpov
 
A Long-Awaited Check of Unreal Engine 4
A Long-Awaited Check of Unreal Engine 4A Long-Awaited Check of Unreal Engine 4
A Long-Awaited Check of Unreal Engine 4Andrey Karpov
 
Introduction to K6
Introduction to K6Introduction to K6
Introduction to K6Knoldus Inc.
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDISven Ruppert
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Testing JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumTesting JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumLukáš Fryč
 
Introducing Ghost Inspector
Introducing Ghost InspectorIntroducing Ghost Inspector
Introducing Ghost InspectorNeil Mansilla
 
Code Review with Sonar
Code Review with SonarCode Review with Sonar
Code Review with SonarMax Kleiner
 

Mais procurados (20)

Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the serverArquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test tool
 
DBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse EngineeringDBI-Assisted Android Application Reverse Engineering
DBI-Assisted Android Application Reverse Engineering
 
All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...
All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...
All you need is Zap - Omer Levi Hevroni & Yshay Yaacobi - DevOpsDays Tel Aviv...
 
FRIDA 101 Android
FRIDA 101 AndroidFRIDA 101 Android
FRIDA 101 Android
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
DAST in CI/CD pipelines using Selenium & OWASP ZAP
DAST in CI/CD pipelines using Selenium & OWASP ZAPDAST in CI/CD pipelines using Selenium & OWASP ZAP
DAST in CI/CD pipelines using Selenium & OWASP ZAP
 
Introduction to Frida
Introduction to FridaIntroduction to Frida
Introduction to Frida
 
Hello watchOS2
Hello watchOS2 Hello watchOS2
Hello watchOS2
 
Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.Jenkins – przyjaciel każdego testera.
Jenkins – przyjaciel każdego testera.
 
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
 
PVS-Studio features overview (2020)
PVS-Studio features overview (2020)PVS-Studio features overview (2020)
PVS-Studio features overview (2020)
 
A Long-Awaited Check of Unreal Engine 4
A Long-Awaited Check of Unreal Engine 4A Long-Awaited Check of Unreal Engine 4
A Long-Awaited Check of Unreal Engine 4
 
Introduction to K6
Introduction to K6Introduction to K6
Introduction to K6
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDI
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Testing JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumTesting JSF with Arquillian and Selenium
Testing JSF with Arquillian and Selenium
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
 
Introducing Ghost Inspector
Introducing Ghost InspectorIntroducing Ghost Inspector
Introducing Ghost Inspector
 
Code Review with Sonar
Code Review with SonarCode Review with Sonar
Code Review with Sonar
 

Semelhante a SAST_QSDL

Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsSylwester Madej
 
Analysis of merge requests in GitLab using PVS-Studio for C#
Analysis of merge requests in GitLab using PVS-Studio for C#Analysis of merge requests in GitLab using PVS-Studio for C#
Analysis of merge requests in GitLab using PVS-Studio for C#Andrey Karpov
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017Amazon Web Services
 
CI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesCI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesSysdig
 
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017Codemotion
 
Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)Yan Cui
 
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Christian Schneider
 
Boost your productivity with Scala tooling!
Boost your productivity  with Scala tooling!Boost your productivity  with Scala tooling!
Boost your productivity with Scala tooling!MeriamLachkar1
 
Serverless in production, an experience report
Serverless in production, an experience reportServerless in production, an experience report
Serverless in production, an experience reportYan Cui
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Yan Cui
 
Serverless in production, an experience report (BuildStuff)
Serverless in production, an experience report (BuildStuff)Serverless in production, an experience report (BuildStuff)
Serverless in production, an experience report (BuildStuff)Yan Cui
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and LingvokotLingvokot
 
Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Yan Cui
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIAndrey Karpov
 
AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)Yan Cui
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Christian Schneider
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Yan Cui
 

Semelhante a SAST_QSDL (20)

Effective DevSecOps
Effective DevSecOpsEffective DevSecOps
Effective DevSecOps
 
Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and Jenkins
 
Analysis of merge requests in GitLab using PVS-Studio for C#
Analysis of merge requests in GitLab using PVS-Studio for C#Analysis of merge requests in GitLab using PVS-Studio for C#
Analysis of merge requests in GitLab using PVS-Studio for C#
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017
 
CI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in KubernetesCI / CD / CS - Continuous Security in Kubernetes
CI / CD / CS - Continuous Security in Kubernetes
 
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
Yan Cui - Serverless in production, an experience report - Codemotion Milan 2017
 
Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)Serverless in production, an experience report (codemotion milan)
Serverless in production, an experience report (codemotion milan)
 
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
Security DevOps - Staying secure in agile projects // OWASP AppSecEU 2015 - A...
 
Boost your productivity with Scala tooling!
Boost your productivity  with Scala tooling!Boost your productivity  with Scala tooling!
Boost your productivity with Scala tooling!
 
Serverless in production, an experience report
Serverless in production, an experience reportServerless in production, an experience report
Serverless in production, an experience report
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)
 
Automating the Quality
Automating the QualityAutomating the Quality
Automating the Quality
 
Serverless in production, an experience report (BuildStuff)
Serverless in production, an experience report (BuildStuff)Serverless in production, an experience report (BuildStuff)
Serverless in production, an experience report (BuildStuff)
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Gitlab and Lingvokot
Gitlab and LingvokotGitlab and Lingvokot
Gitlab and Lingvokot
 
Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)Serverless in production, an experience report (microservices london)
Serverless in production, an experience report (microservices london)
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCI
 
AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)
 
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
Security DevOps - Wie Sie in agilen Projekten trotzdem sicher bleiben // DevO...
 
Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)Serverless in production, an experience report (FullStack 2018)
Serverless in production, an experience report (FullStack 2018)
 

SAST_QSDL

  • 1. Static Analysis Security Tools in QIWI Secure Development Life Cycle Ivan Elkin Application Security Expert Qiwi
  • 2. ~$ whoamI - Qiwi, Application Security - Developer - Vulners.com team - JBFC Member 😀
  • 3. More than Two Years ago...
  • 5.
  • 6. Qiwi OLD Development Lifecycle Business QA Support ISEC TASK DEV Testing Regress testing Release Bug Development Functional bug New TASK ISEC ISEC tests
  • 7. Qiwi OLD Development Lifecycle Testing Regress testing Release Functional bug New TASK ISEC ISEC tests First standard steps were: - Periodical Pentests - Bug bounty program - Deep dive into code of each release - Some Fuzz scans on several projects - …. - …. - Lots of other standard sec-staff
  • 8. Qiwi OLD Development Lifecycle Testing Regress testing Release Functional bug New TASK ISEC ISEC tests But: - Low test coverage - Manual testing takes time - You have no time - Some functionality you didn’t hear before bug found - More than 30 big projects/applications!
  • 9. Sometimes it was like a fire fighting… - Hackerone - Real Attacks Qiwi OLD Development Lifecycle First hours after BugBounty program open
  • 10. Task: - More than 30 projects and applications - 6 main programming languages - Horde of programmers - Infinity of business tasks - 1-2 AppSec specialist … How to protect the internet from ourselves?
  • 11. Something should be changed… we want SDLC! So we expected:
  • 16. Automate all the things!!
  • 19. SA QA TRBL ISEC TASK Refactoring QSDL - New Task In case of new task - Threat modeling - First security review - If task relates on side project, makes security review and testing of it
  • 20. Testing Bug Programming QSDL - Design and Programming - Now programmers know what does it mean: XSS and so on, so design and development with a concept of secure programming - Trigger on TeamCity test-deploys will start SAST after programmer merge pull request to release-branch - Emailing about new found vulnerabilities by SAST - Automotive tasks in Jira - Anytime review of previous scans with detailed inspection of scan alert This concept is actual for project with short lifecycle (release several time in a week)
  • 21. Testing Regress testingBug Programming QSDL - Pre-Release Cycle - Verification by SAST, trigger on TeamCity before release deploy - Auto Fuzz-tests - Manual pentests, extra scanners - Security code-review This concept is actual for project with long lifecycle (release one time in a two week)
  • 22. QSDL - Release - In the context of a short release cycle we check the opportunity of release (the results of the intermediate Autotest), and provides recommendations for changes - Monitoring of releases by ourselves Release
  • 24. SAST
  • 25. Static code analysis tool: - searching security bugs by creating DOM-model of program code calls - one of key spec is searching of second order injections, stored injections and so on by walking through DOM- tree - Some Vendors sells it as a main tool of SDLC flow
  • 26. Other good features - Best Coding Practice - Deprecated methods - Syntax sugar - Seraching of logic errors => performance improvement - Infinite loop - Switch without Break - Inline If - Buffer size which depends on user input - Empty exceptions - Syntax errors - Bad Classcasts
  • 28. CX
  • 29. SAST Scanner - Under the hood 1. How to start scan
  • 30. Vendor told: “.. Scanner should receive only clear code” And he is right! Ok, but what about Libraries Dependencies Maven Dynamic Code Injection SAST Scanner - Under the hood
  • 31. - source pulling - compile - code injecting - custom flow - monitoring - mail - tags Control Server SAST Scanner - Under the hood Welcome! Project which compress project for another project to scan second project!
  • 32. Common process of deploy and scans - Developer start task in TC (hook, or manual) - TC build-agent start client-script which send request about branch to Control Server (CVS, brunch, build-id) - Control Server - Fetch source from VCS - Compile code - Fetch dependency from VCS or Maven (if you have sources) - Make own Dependency injection flow (if SAST not support it) - Make own program langs flow - Monitoring everything works - Results - TC tags for builds (if build is vulnerable, we can’t pass it to release) - Email to ISEC and Developer - Monitoring everything done
  • 33. SAST Scanner - Under the hood 2. I want to see full flow from client to server
  • 35. Vendor told: “.. Each part of code should be independent ..” And he is right! SAST Scanner - Under the hood JS JAVA PLSQLJAVA
  • 36. SAST Scanner - Under the hood 3. I want to write dynamic code!!!
  • 37. All we are love a dynamic code with Dependency Injections Generics and so on public interface FieldsChanger { Collection<FormField> change(FieldsChangerDTO fieldsChangerDTO); } <bean id="fieldsChanger" class="ru.mw.webui.person.form.changer.ExtendableFieldsChanger"> <constructor-arg> <map key-type="ru.mw.webui.person.data.FieldSetRule"> <entry key-ref="mainFieldSetRule"> <bean class="ru.mw.webui.person.form.changer.PlaceHolderFieldsChanger"/> </entry>
  • 38. Vendor told: “.. Not all code can be static analysed ..” And he is right!
  • 39. But we can do: dynamic -> static public interface FieldsChanger { Collection<FormField> change(FieldsChangerDTO fieldsChangerDTO); } public interface FieldsChanger1 { Collection<DefaultFormField> change(DefaultFieldsChangerDTO fieldsChangerDTO); }
  • 40. SAST Scanner - Under the hood 4. I want to write on Scala, Go and use all new Frameworks!
  • 41. Vendor told: “.. You are so modern … everything for your money! ..” And he is right!
  • 42. SAST Scanner - Under the hood 5. It found only one XSS and 100500 strange things!? What happen???
  • 43. Vendor told: “.. Each project is unique and each has own bicycles! ..” And he is right!
  • 44. Be ready to read tons of code!
  • 45. Bad news: - while we set up scanner, some guys found two real good bugs first :( Remember: - look into all types of bugs some could be signed as low-level - some frameworks still not supported out of the box
  • 46. So, To start it - Put all your libraries to own CDN - Write 20k lines of code for Control Server and Client - Invent your own compiling system - Write your own monitoring system To make code ‘scannable’ - Read kilometers of code - Find each input and output points - Write more than 100 own rules of scans
  • 47. Achieved: - Found about 25 bugs in main projects - XXE, RCE, XSS, SQLi - 32 projects were added to autoscan - Full SDLC in you company! - It was made by 2 people !!