WEBVTT

00:00:01.538 --> 00:00:01.912
Remember,

00:00:01.912 --> 00:00:05.003
we looked at requirement 6.4 ; that's the one concerned with

00:00:05.003 --> 00:00:06.673
change control in the previous module.

00:00:06.673 --> 00:00:08.831
So now we're at requirement 6.5,

00:00:08.831 --> 00:00:12.750
which demands that developers are trained to write secure code and they

00:00:12.750 --> 00:00:17.099
have secure coding guidelines or standards to follow.

00:00:17.099 --> 00:00:20.087
The requirement is actually quite specific in that the

00:00:20.087 --> 00:00:24.419
training and the standards have to address what PCI DSS

00:00:24.419 --> 00:00:26.708
terms common coding vulnerabilities,

00:00:26.708 --> 00:00:33.034
and so sub requirement 6.5 .1 through to 6.5 .10 lists these common

00:00:33.034 --> 00:00:36.166
coding vulnerabilities that need to be covered.

00:00:36.166 --> 00:00:38.991
It's the minimum number that need to be covered according to the standard,

00:00:38.991 --> 00:00:42.677
and if you look at the standard, it says that these 10,

00:00:42.677 --> 00:00:46.429
which are loosely based on the OWASP top 10 are what were

00:00:46.429 --> 00:00:50.157
the most common attacked vulnerabilities that were around

00:00:50.157 --> 00:00:52.057
when the standards were released.

00:00:52.057 --> 00:00:53.370
And because of that,

00:00:53.370 --> 00:00:57.377
PCI DSS wants you to do your own continual review of which

00:00:57.377 --> 00:01:00.653
vulnerabilities need to be addressed by your developers,

00:01:00.653 --> 00:01:03.861
either by consulting the OWASP Top 10 when a new version is released,

00:01:03.861 --> 00:01:10.641
or looking at other coding standards and guidelines such as the SANS CWE Top 25.

00:01:10.641 --> 00:01:13.884
To validate that developers have been trained in secure

00:01:13.884 --> 00:01:16.571
coding techniques and that training includes information

00:01:16.571 --> 00:01:18.410
about all common vulnerabilities,

00:01:18.410 --> 00:01:23.688
the QSA is going to look at policies and look at developer training records.

00:01:23.688 --> 00:01:27.374
I just want to mention here that there's no requirement for the QSA to

00:01:27.374 --> 00:01:31.893
actually observe the training content given to the developers.

00:01:31.893 --> 00:01:34.116
They may well ask to see the training,

00:01:34.116 --> 00:01:37.680
but if you can't let them because of legal or licensing reasons,

00:01:37.680 --> 00:01:39.128
that's okay.

00:01:39.128 --> 00:01:40.746
If you're not an expert of secure coding,

00:01:40.746 --> 00:01:43.253
but this is an activity your organization does,

00:01:43.253 --> 00:01:47.706
Pluralsight's got some great training courses to help you get up to speed.

00:01:47.706 --> 00:01:48.033
Personally,

00:01:48.033 --> 00:01:51.925
I really like this Play by Play with Troy Hunt and Andrew van

00:01:51.925 --> 00:01:55.562
der Stock that goes through the OWASP Top 10.

00:01:55.562 --> 00:01:56.020
Of course,

00:01:56.020 --> 00:01:58.787
Pluralsight also has lots of developer courses that can help you to

00:01:58.787 --> 00:02:01.277
meet this training requirement for your developers.

00:02:01.277 --> 00:02:06.361
The sub requirements in 6.5 list the 10 common coding vulnerabilities

00:02:06.361 --> 00:02:09.822
that the developers need to be trained to avoid.

00:02:09.822 --> 00:02:14.815
The first six of these in requirement 6.5 .1 through to

00:02:14.815 --> 00:02:18.114
6.5 .6 apply to all applications.

00:02:18.114 --> 00:02:19.996
I'm briefly going to look at each one,

00:02:19.996 --> 00:02:23.325
and the testing procedures for each one are basically the same so we'll

00:02:23.325 --> 00:02:26.912
talk about the testing procedures at the end of these six.

00:02:26.912 --> 00:02:30.627
So the first common coding vulnerability is an injection attack,

00:02:30.627 --> 00:02:35.258
and that's typically going to be an SQL or an OS Command Injection attack,

00:02:35.258 --> 00:02:36.882
and to defeat such attacks,

00:02:36.882 --> 00:02:39.609
developers are going to need to understand how to sanitize

00:02:39.609 --> 00:02:43.917
input they receive and not just pass input that they get to

00:02:43.917 --> 00:02:45.057
something else to process.

00:02:45.057 --> 00:02:48.535
The next vulnerability that developers need to be able

00:02:48.535 --> 00:02:50.125
to address are buffer overflows.

00:02:50.125 --> 00:02:55.524
When the developer puts too much data into an area of memory that's too small,

00:02:55.524 --> 00:02:57.877
developers need to be trained to make sure that all input is

00:02:57.877 --> 00:03:00.859
checked for size before they write it anywhere.

00:03:00.859 --> 00:03:06.729
Requirement 6.5 .3 echoes really the whole of PCI DSS requirement 3.

00:03:06.729 --> 00:03:08.950
The developers make errors in how they use cryptographic

00:03:08.950 --> 00:03:12.121
functions and libraries so they need to be trained in the

00:03:12.121 --> 00:03:16.073
correct use of secure cryptographic storage.

00:03:16.073 --> 00:03:16.622
Following on from this,

00:03:16.622 --> 00:03:19.473
the next requirement is the same for PCI DSS requirement 4;

00:03:19.473 --> 00:03:22.678
to make sure that developers are able to use cryptography

00:03:22.678 --> 00:03:26.716
when they're using data in transit.

00:03:26.716 --> 00:03:29.114
And again, this is one area where there's been lots of compromises,

00:03:29.114 --> 00:03:31.595
because unlike your favorite web browser,

00:03:31.595 --> 00:03:34.738
most developers really struggle with checking certificates

00:03:34.738 --> 00:03:37.878
and how TLS connections are created.

00:03:37.878 --> 00:03:39.994
The next common coding vulnerability is error handling,

00:03:39.994 --> 00:03:44.626
and there are a couple of areas the standard is particularly keen on here.

00:03:44.626 --> 00:03:46.924
The first is to make sure that when an error condition happens,

00:03:46.924 --> 00:03:49.911
the system doesn't divulge information that an attacker

00:03:49.911 --> 00:03:53.400
will find useful such as an error message that gives more

00:03:53.400 --> 00:03:56.144
information away than it should,

00:03:56.144 --> 00:03:59.895
or an application that enters full debug mode when it encounters an error.

00:03:59.895 --> 00:04:03.737
The second error handling vulnerability is to make sure that if

00:04:03.737 --> 00:04:05.873
an attacker can make an application crash,

00:04:05.873 --> 00:04:09.847
then the attacker doesn't get the ability to start to control the

00:04:09.847 --> 00:04:12.750
application or the underlying operating system.

00:04:12.750 --> 00:04:15.971
Requirement 6.5 .6 is a bit of a strange one,

00:04:15.971 --> 00:04:20.202
and it aims to tie the vulnerability management process described in

00:04:20.202 --> 00:04:23.379
requirement 6.1 back to the developer process.

00:04:23.379 --> 00:04:24.125
So look,

00:04:24.125 --> 00:04:26.553
if the vulnerability management process discovers

00:04:26.553 --> 00:04:31.299
vulnerabilities in custom applications, let's think.

00:04:31.299 --> 00:04:32.743
Yeah, look, say it found,

00:04:32.743 --> 00:04:36.342
say there was a high vulnerability discovered in a software

00:04:36.342 --> 00:04:39.358
library that was included in our application,

00:04:39.358 --> 00:04:45.519
and the vulnerability management you were doing in 6.1 found this vulnerability.

00:04:45.519 --> 00:04:50.037
This requirement 6.5 .6 would require that that software library

00:04:50.037 --> 00:04:53.816
vulnerability was addressed in your coding standards to make sure that only

00:04:53.816 --> 00:04:56.745
secure versions of the library were used going forward.

00:04:56.745 --> 00:04:59.732
The testing procedures for all of these sub requirements are the same.

00:04:59.732 --> 00:05:03.147
The QSA will check policies and procedures and also interview

00:05:03.147 --> 00:05:05.761
developers to make sure they've been trained and understand how

00:05:05.761 --> 00:05:07.912
to avoid these vulnerabilities.

00:05:07.912 --> 00:05:13.032
The final four sub requirements of 6.5 are again more common coding

00:05:13.032 --> 00:05:15.772
vulnerabilities that developers need to avoid.

00:05:15.772 --> 00:05:16.207
However,

00:05:16.207 --> 00:05:20.605
these just apply to web applications and that's irrespective of

00:05:20.605 --> 00:05:24.727
whether the web application is a public facing application or an

00:05:24.727 --> 00:05:28.564
application that's just intended for internal use.

00:05:28.564 --> 00:05:33.477
Starting off with 6.5 .7, which is perhaps the most common web vulnerability,

00:05:33.477 --> 00:05:35.760
cross-site scripting.

00:05:35.760 --> 00:05:38.009
Developers need to be trained how to avoid this by

00:05:38.009 --> 00:05:39.995
sanitizing all input into their applications,

00:05:39.995 --> 00:05:42.290
whether that comes from a user, another system,

00:05:42.290 --> 00:05:44.531
or even the application's own database,

00:05:44.531 --> 00:05:49.043
because cross-site scripting can work in reverse where a system renders

00:05:49.043 --> 00:05:53.151
information that wasn't sanitized from a database on screen.

00:05:53.151 --> 00:05:56.535
The second web type of vulnerability is termed improper access control,

00:05:56.535 --> 00:06:00.206
effectively giving unauthorized users the ability to access

00:06:00.206 --> 00:06:03.703
resources over the web interface by something like changing the

00:06:03.703 --> 00:06:06.336
URL path or changing some parameters.

00:06:06.336 --> 00:06:10.547
The most common forms of this you hear are or you see are direct

00:06:10.547 --> 00:06:13.597
object reference and directory path reversal.

00:06:13.597 --> 00:06:15.708
Now one of the harder web vulnerabilities for

00:06:15.708 --> 00:06:20.295
developers to get their heads round, is cross-site request forgery or CSRF,

00:06:20.295 --> 00:06:24.055
which allows one web application to interfere with another web

00:06:24.055 --> 00:06:26.762
application or website by taking advantage of a user's current

00:06:26.762 --> 00:06:28.115
rites within their own website.

00:06:28.115 --> 00:06:31.131
It's pretty easy to protect against by using access

00:06:31.131 --> 00:06:33.480
tokens and checking for HTTP referrers,

00:06:33.480 --> 00:06:36.055
but your standard needs to include the ways to avoid this

00:06:36.055 --> 00:06:39.365
vulnerability and developers need to understand how to

00:06:39.365 --> 00:06:41.189
protect their web applications.

00:06:41.189 --> 00:06:45.247
The final web-only vulnerability is concerned with session management,

00:06:45.247 --> 00:06:48.246
making sure that attackers cannot steal or tamper with the

00:06:48.246 --> 00:06:50.036
user's session with a web application,

00:06:50.036 --> 00:06:52.328
and that's typically all about how sessions are

00:06:52.328 --> 00:06:54.643
recognized and how session cookies are used.

00:06:54.643 --> 00:06:58.858
You know, for instance, flagging them HTTPS or flagging them secure-only.

00:06:58.858 --> 00:07:00.712
Just as with the previous set of sub requirements,

00:07:00.712 --> 00:07:04.831
the QSA is going to check there are secure coding guidelines that tell

00:07:04.831 --> 00:07:07.389
developers how to avoid these common coding vulnerabilities,

00:07:07.389 --> 00:07:10.469
and they're also going to speak with the developers to make sure they

00:07:10.469 --> 00:07:13.144
both follow the guidelines and have been trained.

00:07:13.144 --> 00:07:17.259
If you are, I don't know if it's quite if you are lucky or if you are unlucky,

00:07:17.259 --> 00:07:20.386
but if your QSA comes from a software development background,

00:07:20.386 --> 00:07:23.675
they will spend quite a bit of time on this,

00:07:23.675 --> 00:07:25.633
and they'll ask your developers questions like how

00:07:25.633 --> 00:07:27.630
would stop cross-site request forgery?

00:07:27.630 --> 00:07:28.987
Can you explain it to me?

00:07:28.987 --> 00:07:39.265
So you need to make sure, it's a good thing to do is check your QSA's background.
