The Operationalisation
of Security
DevSecOps
What is DevOps?
• DevOps is a model that blurs the lines between
dev and IT operations & consolidates historically
segregated management functions to improve
efficiency and responsiveness.
• It allows dev teams to automate their build,
testing, and deployment processes.
• Often referred to as Continuous Integration (CI) &
Continuous Deployment (CD).
DevOps Security
What is DevSecOps?
Automate!!!
Automate!!!
Automate!!!
YOU FOOL!
It’s not about the
tools,it’s about the
CULTURE!
This Is Not DevSecOps
This Is Not DevSecOps
This Is DevSecOps
“It’s the concept of using tools and processes to facilitate
collaboration between the engineers who deliver the code /
systems and those who must maintain and secure it / them.”
“say cloud again,
i dare you!”
SAAS, SDN, ALM, CI, CD, Full
Stack, Virtualisation,
Cloud, hyper-segregation
Infrastructure As Code
Security as Code
Software Defined Security
ASVS 2014 Web Application Standard!
17!
!
V2: Authentication
Verification Requirements
The table below defines the corresponding verification requirements that apply for each of the verification
levels. Verification requirements for Level 0 are not defined by this standard.
AUTHENTICATION
VERIFICATION REQUIREMENT
LEVELS
1 2 3
V2.1
Verify all pages and resources require authentication except those
specifically intended to be public (Principle of complete mediation).
V2.2
Verify all password fields do not echo the user’s password when it is entered.
V2.4
Verify all authentication controls are enforced on the server side.
V2.5
Verify all authentication controls (including libraries that call external
authentication services) have a centralized implementation.
V2.6
Verify all authentication controls fail securely to ensure attackers cannot log
in.
V2.7
Verify password entry fields allow or encourage the use of passphrases, and
do not prevent long passphrases or highly complex passwords being
entered, and provide a sufficient minimum strength to protect against the
use of commonly chosen passwords.
V2.8
Verify all account identity authentication functions (such as registration,
update profile, forgot username, forgot password, disabled / lost token, help
desk or IVR) that might regain access to the account are at least as resistant
to attack as the primary authentication mechanism.
V2.9
Verify users can safely change their credentials using a mechanism that is at
least as resistant to attack as the primary authentication mechanism.
V2.12
Verify that all authentication decisions are logged. This should include
requests with missing required information, needed for security
investigations.
V2.13
Verify that account passwords are salted using a salt that is unique to that
account (e.g., internal user ID, account creation) and use bcrypt, scrypt or
PBKDF2 before storing the password.
ASVS 2014 Web Application Standard!
23!
!
V5: Malicious Input Handling
Verification Requirements
The table below defines the corresponding verification requirements that apply for each of the verification
levels. Verification requirements for Level 0 are not defined by this standard.
INPUT VALIDATION
VERIFICATION REQUIREMENT
LEVELS
1 2 3
V5.1
Verify that the runtime environment is not susceptible to buffer overflows, or
that security controls prevent buffer overflows.
V5.3 Verify that all input validation failures result in input rejection.
V5.4 Verify that a character set, such as UTF-8, is specified for all sources of input.
V5.5
Verify that all input validation or encoding routines are performed and
enforced on the server side.
V5.6
Verify that a single input validation control is used by the application for
each type of data that is accepted.
V5.7 Verify that all input validation failures are logged.
V5.8
Verify that all input data is canonicalized for all downstream decoders or
interpreters prior to validation.
V5.10
Verify that the runtime environment is not susceptible to SQL Injection, or
that security controls prevent SQL Injection.
V5.11
Verify that the runtime environment is not susceptible to LDAP Injection, or
that security controls prevent LDAP Injection.
V5.12
Verify that the runtime environment is not susceptible to OS Command
Injection, or that security controls prevent OS Command Injection.
V5.13
Verify that the runtime environment is not susceptible to XML External Entity
attacks or that security controls prevents XML External Entity attacks.
ASVS 2014 Web Application Standard!
19!
!
V3: Session Management
Verification Requirements
The table below defines the corresponding verification requirements that apply for each of the verification
levels. Verification requirements for Level 0 are not defined by this standard.
SESSION MANAGEMENT
VERIFICATION REQUIREMENT
LEVELS
1 2 3
V3.1
Verify that the framework’s default session management control
implementation is used by the application.
V3.2 Verify that sessions are invalidated when the user logs out.
V3.3 Verify that sessions timeout after a specified period of inactivity.
V3.4
Verify that sessions timeout after an administratively-configurable maximum
time period regardless of activity (an absolute timeout).
V3.5
Verify that all pages that require authentication to access them have logout
links.
V3.6
Verify that the session id is never disclosed other than in cookie headers;
particularly in URLs, error messages, or logs. This includes verifying that the
application does not support URL rewriting of session cookies.
V3.7 Verify that the session id is changed on login to prevent session fixation.
V3.8 Verify that the session id is changed upon re-authentication.
V3.10
Verify that only session ids generated by the application framework are
recognized as valid by the application.
V3.11
Verify that authenticated session tokens are sufficiently long and random to
withstand session guessing attacks.
V3.12
Verify that authenticated session tokens using cookies have their path set to
an appropriately restrictive value for that site. The domain cookie attribute
ASVS 2014 Web Application Standard!
21!
!
V4: Access Control
Verification Requirements
The table below defines the corresponding verification requirements that apply for each of the verification
levels. Verification requirements for Level 0 are not defined by this standard.
ACCESS CONTROL
VERIFICATION REQUIREMENT
LEVELS
1 2 3
V4.1
Verify that users can only access secured functions or services for which they
possess specific authorization.
V4.2
Verify that users can only access secured URLs for which they possess specific
authorization.
V4.3
Verify that users can only access secured data files for which they possess
specific authorization.
V4.4
Verify that direct object references are protected, such that only authorized
objects or data are accessible to each user (for example, protect against
direct object reference tampering).
V4.5 Verify that directory browsing is disabled unless deliberately desired.
V4.8 Verify that access controls fail securely.
V4.9
Verify that the same access control rules implied by the presentation layer
are enforced on the server side for that user role, such that controls and
parameters cannot be re-enabled or re-added from higher privilege users.
V4.10
Verify that all user and data attributes and policy information used by access
controls cannot be manipulated by end users unless specifically authorized.
V4.11 Verify that all access controls are enforced on the server side.
V4.12
Verify that there is a centralized mechanism (including libraries that call
external authorization services) for protecting access to each type of
protected resource.
http://benchmarks.cisecurity.org
CIS Amazon Linux 2014.09-2015.03
Benchmarkv1.1.0 - 07-06-2015
 
Information Supplement:
Requirement 6.6 Code Reviews
and Application Firewalls Clarified
Release date: 2008-04-15
 
Standard: Data Security Standard (DSS)
Requirement: 6.6
Date: February 2008
Recipe
mysql_service 'default' do

version '5.7'

bind_address '0.0.0.0'

port '3306' 

data_dir '/data'

initial_root_password 'Ch4ng3me'

action [:create, :start]

end
class mysql (

root_password => 'Ch4ng3me',

port => '3306',

) {

package { 'mysql-server':

ensure => present,

}

service { 'mysql':

ensure => running,

}

[...]

}
Recipe
control_group 'Example' do

control 'SSH' do

it 'should be listening on port 22' do

expect(port(22)).to be_listening

end

it 'disables root logins over ssh' do

expect(file('/etc/ssh/sshd_config')).to
contain('PermitRootLogin no')

end

end

end
Recipe
Continous Integration
gauntlt / mittn / BDD-Security
Security test frameworks using gherkin/cucumber like syntax, they
use the concept of “behaviour driven / test driven development”.
They all use a natural language in a Given, When, Then format to
describe security requirements as a story.
Scenario: The app should not have XSS

Meta: @id scan_xss

Given a fresh scanner with all policies disabled

And the attack strength is set to High

And the Cross-Site-Scripting policy is enabled

When the scanner is run

And false positives described in: tables/
false_positives.table are removed

Then no Medium or higher risk vulnerabilities should
be present
Sec Dev Tec Biz
DevSecOps
Secure is a possible state that is
probabilistically unachievable.
However the reward in the pursuit of the
state can be measured by your ability to
deter, minimise, detect, respond and
recover from adversaries.
Security Champion
exploit/multi/http/jenkins_script_console
auxiliary/scanner/http/jenkins_login
auxiliary/gather/jenkins_cred_recovery
auxiliary/scanner/http/jenkins_enum
auxiliary/scanner/http/jenkins_command
exploit/linux/misc/jenkins_java_deserialize
auxiliary/scanner/http/gitlab_user_enum.rb
auxiliary/scanner/http/gitlab_login.rb
exploit/multi/http/gitlab_shell_exec.rb
what are you doing Dave?
exploit/multi/http/splunk_upload_app_exec
exploit/multi/http/splunk_mappy_exec
auxiliary/scanner/http/splunk_web_login
SDN: OF, OVSDB, PCEP, I2RS, BGP-LS, OMI, XMPP, LISP, SNMP,
EEM, ACI
Each of these protocols has their own methods of securing
the communications to network elements:
DCI: NVGRE, STT, VXLAN, OTV, L2MP), TRILL-based protocols
(Cisco FabricPath, Juniper QFabric, Brocade VCS Fabric), SPB
API: Python, Java, C, REST, XML, JSON
Security
Engineering
DevSecOps
Security
Science
Experiment,
Automate & Test
Security
Operations
Compliance
Operations
Hunt,
Detect & Contain
Respond,
Manage & Train
Learn,
Measure & Forecast
DevSecOps is not just about tooling and
automation - culture is key to success
DevSecOps is reshaping security, for the better

It allows for security to be seen as an enabler, not
a blocker within your business 

Embracing DevSecOps can positively impact your
security culture 

It isn’t a silver bullet and it doesn’t ‘solve’ security
www.DevSecCon.com
www.DevSecOps.org
www.CodeAsCraft.com
@mwrlabs | @mwrinfosecurity

SecDevOps - The Operationalisation of Security

  • 1.
  • 2.
    What is DevOps? •DevOps is a model that blurs the lines between dev and IT operations & consolidates historically segregated management functions to improve efficiency and responsiveness. • It allows dev teams to automate their build, testing, and deployment processes. • Often referred to as Continuous Integration (CI) & Continuous Deployment (CD).
  • 3.
  • 4.
  • 5.
  • 6.
    YOU FOOL! It’s notabout the tools,it’s about the CULTURE!
  • 7.
    This Is NotDevSecOps
  • 8.
    This Is NotDevSecOps
  • 9.
    This Is DevSecOps “It’sthe concept of using tools and processes to facilitate collaboration between the engineers who deliver the code / systems and those who must maintain and secure it / them.”
  • 11.
    “say cloud again, idare you!” SAAS, SDN, ALM, CI, CD, Full Stack, Virtualisation, Cloud, hyper-segregation
  • 12.
  • 13.
    Security as Code SoftwareDefined Security ASVS 2014 Web Application Standard! 17! ! V2: Authentication Verification Requirements The table below defines the corresponding verification requirements that apply for each of the verification levels. Verification requirements for Level 0 are not defined by this standard. AUTHENTICATION VERIFICATION REQUIREMENT LEVELS 1 2 3 V2.1 Verify all pages and resources require authentication except those specifically intended to be public (Principle of complete mediation). V2.2 Verify all password fields do not echo the user’s password when it is entered. V2.4 Verify all authentication controls are enforced on the server side. V2.5 Verify all authentication controls (including libraries that call external authentication services) have a centralized implementation. V2.6 Verify all authentication controls fail securely to ensure attackers cannot log in. V2.7 Verify password entry fields allow or encourage the use of passphrases, and do not prevent long passphrases or highly complex passwords being entered, and provide a sufficient minimum strength to protect against the use of commonly chosen passwords. V2.8 Verify all account identity authentication functions (such as registration, update profile, forgot username, forgot password, disabled / lost token, help desk or IVR) that might regain access to the account are at least as resistant to attack as the primary authentication mechanism. V2.9 Verify users can safely change their credentials using a mechanism that is at least as resistant to attack as the primary authentication mechanism. V2.12 Verify that all authentication decisions are logged. This should include requests with missing required information, needed for security investigations. V2.13 Verify that account passwords are salted using a salt that is unique to that account (e.g., internal user ID, account creation) and use bcrypt, scrypt or PBKDF2 before storing the password. ASVS 2014 Web Application Standard! 23! ! V5: Malicious Input Handling Verification Requirements The table below defines the corresponding verification requirements that apply for each of the verification levels. Verification requirements for Level 0 are not defined by this standard. INPUT VALIDATION VERIFICATION REQUIREMENT LEVELS 1 2 3 V5.1 Verify that the runtime environment is not susceptible to buffer overflows, or that security controls prevent buffer overflows. V5.3 Verify that all input validation failures result in input rejection. V5.4 Verify that a character set, such as UTF-8, is specified for all sources of input. V5.5 Verify that all input validation or encoding routines are performed and enforced on the server side. V5.6 Verify that a single input validation control is used by the application for each type of data that is accepted. V5.7 Verify that all input validation failures are logged. V5.8 Verify that all input data is canonicalized for all downstream decoders or interpreters prior to validation. V5.10 Verify that the runtime environment is not susceptible to SQL Injection, or that security controls prevent SQL Injection. V5.11 Verify that the runtime environment is not susceptible to LDAP Injection, or that security controls prevent LDAP Injection. V5.12 Verify that the runtime environment is not susceptible to OS Command Injection, or that security controls prevent OS Command Injection. V5.13 Verify that the runtime environment is not susceptible to XML External Entity attacks or that security controls prevents XML External Entity attacks. ASVS 2014 Web Application Standard! 19! ! V3: Session Management Verification Requirements The table below defines the corresponding verification requirements that apply for each of the verification levels. Verification requirements for Level 0 are not defined by this standard. SESSION MANAGEMENT VERIFICATION REQUIREMENT LEVELS 1 2 3 V3.1 Verify that the framework’s default session management control implementation is used by the application. V3.2 Verify that sessions are invalidated when the user logs out. V3.3 Verify that sessions timeout after a specified period of inactivity. V3.4 Verify that sessions timeout after an administratively-configurable maximum time period regardless of activity (an absolute timeout). V3.5 Verify that all pages that require authentication to access them have logout links. V3.6 Verify that the session id is never disclosed other than in cookie headers; particularly in URLs, error messages, or logs. This includes verifying that the application does not support URL rewriting of session cookies. V3.7 Verify that the session id is changed on login to prevent session fixation. V3.8 Verify that the session id is changed upon re-authentication. V3.10 Verify that only session ids generated by the application framework are recognized as valid by the application. V3.11 Verify that authenticated session tokens are sufficiently long and random to withstand session guessing attacks. V3.12 Verify that authenticated session tokens using cookies have their path set to an appropriately restrictive value for that site. The domain cookie attribute ASVS 2014 Web Application Standard! 21! ! V4: Access Control Verification Requirements The table below defines the corresponding verification requirements that apply for each of the verification levels. Verification requirements for Level 0 are not defined by this standard. ACCESS CONTROL VERIFICATION REQUIREMENT LEVELS 1 2 3 V4.1 Verify that users can only access secured functions or services for which they possess specific authorization. V4.2 Verify that users can only access secured URLs for which they possess specific authorization. V4.3 Verify that users can only access secured data files for which they possess specific authorization. V4.4 Verify that direct object references are protected, such that only authorized objects or data are accessible to each user (for example, protect against direct object reference tampering). V4.5 Verify that directory browsing is disabled unless deliberately desired. V4.8 Verify that access controls fail securely. V4.9 Verify that the same access control rules implied by the presentation layer are enforced on the server side for that user role, such that controls and parameters cannot be re-enabled or re-added from higher privilege users. V4.10 Verify that all user and data attributes and policy information used by access controls cannot be manipulated by end users unless specifically authorized. V4.11 Verify that all access controls are enforced on the server side. V4.12 Verify that there is a centralized mechanism (including libraries that call external authorization services) for protecting access to each type of protected resource. http://benchmarks.cisecurity.org CIS Amazon Linux 2014.09-2015.03 Benchmarkv1.1.0 - 07-06-2015   Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified Release date: 2008-04-15   Standard: Data Security Standard (DSS) Requirement: 6.6 Date: February 2008
  • 14.
    Recipe mysql_service 'default' do
 version'5.7'
 bind_address '0.0.0.0'
 port '3306' 
 data_dir '/data'
 initial_root_password 'Ch4ng3me'
 action [:create, :start]
 end
  • 15.
    class mysql (
 root_password=> 'Ch4ng3me',
 port => '3306',
 ) {
 package { 'mysql-server':
 ensure => present,
 }
 service { 'mysql':
 ensure => running,
 }
 [...]
 } Recipe
  • 16.
    control_group 'Example' do
 control'SSH' do
 it 'should be listening on port 22' do
 expect(port(22)).to be_listening
 end
 it 'disables root logins over ssh' do
 expect(file('/etc/ssh/sshd_config')).to contain('PermitRootLogin no')
 end
 end
 end Recipe
  • 17.
  • 18.
    gauntlt / mittn/ BDD-Security Security test frameworks using gherkin/cucumber like syntax, they use the concept of “behaviour driven / test driven development”. They all use a natural language in a Given, When, Then format to describe security requirements as a story. Scenario: The app should not have XSS
 Meta: @id scan_xss
 Given a fresh scanner with all policies disabled
 And the attack strength is set to High
 And the Cross-Site-Scripting policy is enabled
 When the scanner is run
 And false positives described in: tables/ false_positives.table are removed
 Then no Medium or higher risk vulnerabilities should be present
  • 21.
    Sec Dev TecBiz DevSecOps
  • 22.
    Secure is apossible state that is probabilistically unachievable. However the reward in the pursuit of the state can be measured by your ability to deter, minimise, detect, respond and recover from adversaries.
  • 25.
  • 28.
  • 29.
  • 30.
    what are youdoing Dave? exploit/multi/http/splunk_upload_app_exec exploit/multi/http/splunk_mappy_exec auxiliary/scanner/http/splunk_web_login
  • 31.
    SDN: OF, OVSDB,PCEP, I2RS, BGP-LS, OMI, XMPP, LISP, SNMP, EEM, ACI Each of these protocols has their own methods of securing the communications to network elements: DCI: NVGRE, STT, VXLAN, OTV, L2MP), TRILL-based protocols (Cisco FabricPath, Juniper QFabric, Brocade VCS Fabric), SPB API: Python, Java, C, REST, XML, JSON
  • 34.
  • 35.
    DevSecOps is notjust about tooling and automation - culture is key to success DevSecOps is reshaping security, for the better
 It allows for security to be seen as an enabler, not a blocker within your business 
 Embracing DevSecOps can positively impact your security culture 
 It isn’t a silver bullet and it doesn’t ‘solve’ security
  • 36.
  • 37.