GitHub Advanced Security Book
GitHub Advanced Security Book
to developer-first
application security
T
WHREI TCT O
EMN PBLYE G
T EI TG
HUUIBD E
WTI TOH D❤
E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 1
Contents
3 Introduction
5 Executive summary
10 Part one: State of application
security today
16 Part two: Traditional vs.
end-to-end security
24 Part three: Developer-
first application security
with GitHub
33 Conclusion
Introduction
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 3
INTRODUCTION
--------
1: 2020 Open Source Security and Risk Analysis Report, Synopsys
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 4
Executive
summary
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 5
EXECUTIVE SUMMARY
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 6
EXECUTIVE SUMMARY
In this traditional gate approach, SAST, DAST, IAST, and SCA are the
most commonly observed security evaluation tools. Although having
security as a gate is better than having no application security at
all, this approach causes developer friction and delays in delivering
secure applications. Late security feedback causes confusion,
manual reviews lead to bottlenecks, and scan results have a high
noise-to-signal ratio—all of which lead to developer frustration and
disrupt developer velocity.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 7
EXECUTIVE SUMMARY
3. A
utomated tools don't solve the problem of false positives.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 8
EXECUTIVE SUMMARY
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 9
Part one: State
of application
security today
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 10
PA R T O N E : S TAT E O F A P P L I C AT I O N S E C U R I T Y T O D AY
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 11
PA R T O N E : S TAT E O F A P P L I C AT I O N S E C U R I T Y T O D AY
The process generates raw scan results which point out potentially
exploitable vulnerabilities, such as those made available via the user
interface. As a result, DAST tools identify a subset of the application
layer vulnerabilities reported by a SAST tool, which are known to be
exploitable. DAST tools can also find vulnerabilities SAST tools miss,
like those related to the running environment of the application
(server, frameworks, network). This is why SAST and DAST are used
as complementary methods to comprehensively understand the
risk posture of applications. DAST tools validate attack results with
server responses they receive, so scan results need to be manually
reviewed before fixes are planned.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 12
PA R T O N E : S TAT E O F A P P L I C AT I O N S E C U R I T Y T O D AY
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 13
PA R T O N E : S TAT E O F A P P L I C AT I O N S E C U R I T Y T O D AY
Fuzzing
Fuzzing (or fuzz testing) uses automated or manual methods to
provide invalid, unexpected, or random data as inputs to running
applications in a test environment. As these inputs are sent, the
target application is continuously monitored for exceptions which
may include crashes, abnormal behavior, or potential memory
leaks. Fuzzing can provide additional information about a target
application and serves as a complementary method for DAST.
Penetration testing
Penetration testing involves automated and manual tests that aim
to test the security controls of running applications. In most cases
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 14
PA R T O N E : S TAT E O F A P P L I C AT I O N S E C U R I T Y T O D AY
Bug bounties
Bug bounties are crowd-sourced security testing programs which
leverage individual security researchers who get paid based on
the vulnerabilities that they discover. Bug bounties serve as a
complementary solution to all of the methods noted above, but
don’t typically provide comprehensive coverage for the security
posture of applications.
Let’s take a look at these two approaches and what they mean for
your developers.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 15
Part two:
Traditional vs.
end-to-end
security
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 16
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
PR Code review
Commit
SAST
SCA
Merge CI / Testing
DAST
IAST
Project Project
Code / Test
inception configuration
CD
SAST
QA &
DAST
Ship Integration
testing SCA
IAST
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 17
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
1. L
ate security feedback causes confusion. Security feedback
that comes at a later stage in development (often weeks after
the code’s creation) means that developers have already moved
on to the following sprint or the next project, so the vulnerable
code in question is no longer top of mind. It can take a while for
developers to refamiliarize with the code and context, and the
fixes often require additional sprint planning, potentially delaying
current projects. “More than 70 percent of all flaws remain
one month after discovery and nearly 55 percent remain three
months after discovery” per the State of Software Security Report
Volume 10 by Veracode.3
2. S
can results have a high noise-to-signal ratio. Traditional
application security tools generate multiple false positives for
every true positive, so reviewing scan results is a challenging
task. These reviews are generally done by security teams who
have limited knowledge about the scanned projects, which
makes auditing scan results difficult and labor-intensive. Another
approach is to push raw scan results to developers without
reviews, but this puts the burden of evaluation onto developers,
deprioritizing their effort to actually fix the issue.
--------
3: State of Software Security Report Volume 10, Veracode
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 18
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
3. M
anual reviews cause bottlenecks. When scan results are
generated by automated tools, they still require manual review
to identify true positives and eliminate false positives. Security
teams are greatly outnumbered by developers and they simply
can’t keep up with the sheer volume of raw scan results that need
their attention. Manual reviews can take days and even weeks for
the average project, creating a bottleneck and delays in project
timelines. Delays can be even more frustrating in cases where
manual review results don’t meet expectations. In most cases,
delayed security results mean teams have to ship releases with
known vulnerabilities, with no time to fix these issues to meet
project timelines.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 19
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
End-to-end approach
SAST
PR Code review
SCA
IDE plugins
IAST
SCA Commit
SAST
SCA
Merge CI / Testing
DAST
IAST
Project Project
Code / Test
inception configuration
CD DAST
2. S
ecurity teams and development teams continue to
work in silos. Changing your tooling isn’t enough to change
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 20
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
Security teams also still act as reviewers for testing results. For
example, every commit on the main branch gets scanned and
new alerts are sent to the security team for review. The security
team still has to triage and send issues back to developers to
fix, and the team likely still has a gating process on release. This
is a better approach than having security tests as a gate since
some things get caught early, but these teams still lack common
processes and platforms to collaborate. With silos and poor
communication, issues are pushed back and forth between
teams, often leading to delays and sometimes conflict.
3. A
utomating traditional tools doesn’t solve the false positive
problem. It’s exciting to think about automated application
security tools. But in reality, automating scans and pushing
results to an issue tracker leads to a flood of non-actionable
issues. Here the problem is false positives and developers
becoming desensitized to noise. With too many alerts, developers
ignore test results (and mark them all as “false positives” or
“won’t fix”). Traditional security tools lack the customizability to
adjust sensitivity or improve results over time, so when results are
pushed into developer flows, developers switch these tools off.
4. T
raditional tools fail to keep pace with the software ecosystem.
Today’s software ecosystem consists of open source, new
programming languages, new frameworks, and emerging tools
that evolve at a breakneck pace. Since traditional commercial
tools are created, updated, and supported by small vendor teams,
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 21
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
--------
3: State of Software Security Report Volume 10, Veracode
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 22
PA R T T W O : T R A D I T I O N A L V S . E N D -T O - E N D S E C U R I T Y
With all of these challenges combined, it’s little surprise that web
applications have been reported as the main cause of security
breaches over the last five years.4
--------
3: State of Software Security Report Volume 10, Veracode
4: 2016, 2017, 2018, 2019 and 2020 Data Breach Investigation Reports, Verizon
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 23
Part three:
Developer-first
application security
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 24
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
There’s only one way to shift security left and succeed against
overwhelming technical debt: Putting developers front and
center for application security.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 25
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 26
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 27
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 28
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
Secure code
Custom code delivers application logic and unique capability for
projects. It’s developed by the developers or vendors on your project
team. Securing custom code within projects is another critical
step in shipping secure applications and preventing potential zero
day vulnerabilities.
Code scanning
Code scanning is a developer-first SAST product that’s built into
GitHub. After it’s configured, it scans every code change in your
repository for security vulnerabilities and flags them in the developer
workflow. This makes it easy to find security vulnerabilities in your
code before they ever reach production.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 29
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
With code scanning enabled, every `git push` is scanned for new
potential security vulnerabilities, and results are displayed directly
in your pull request. By default, code scanning uses CodeQL,
which has an unmatched record finding real vulnerabilities. It
includes 2,000-plus CodeQL queries written and open sourced by
the GitHub Security Lab and leading security researchers to find
potential vulnerabilities in your code with minimal configuration.
Secret scanning
GitHub has provided secret scanning for public repositories,
including API keys and authentication tokens, since 2018. Secret
scanning protects our partners and community from unauthorized
use of the services protected by those secrets.
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 30
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 31
PART THREE: D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y W I T H G I T H U B
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 32
Conclusion
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 33
CONCLUSION
T H E C O M P L E T E G U I D E T O D E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 34
Questions about application security?
Learn more at github.com/learn/security
or contact our Sales Team
T
WHREI TCT O
EMN PBLYE G
T EI TG
HUUIBD E
WTI TOH D❤
E V ELO P ER- F I R S T A P P L I C AT I O N S EC U R I T Y 35