Podcast Search

Under the Radar

Under the Radar 16: Designing for Misuse

Select a time to play from there. The line being spoken is highlighted as the audio plays.

0:00:00welcome to under the radar a show but

0:00:02independent iOS app development I'm

0:00:03Marco Arment and I'm David Smith under

0:00:05the radar is never longer than 30

0:00:07minutes so let's get started so today I

0:00:09wanted to talk about designing for

0:00:11misuse and and maybe abuse - and maybe

0:00:15some malicious use but you know just

0:00:16general categories of misuse of people

0:00:19trying to use your apps either

0:00:21maliciously or in ways that you didn't

0:00:23intend or consider when you design them

0:00:26and kind of how you can deal with that

0:00:28and how you can mitigate or minimize the

0:00:30the negative effects of that I mean so

0:00:34you you have a number of apps I'm

0:00:36thinking of things like my recipe book

0:00:37or audiobooks even where like somebody

0:00:41could potentially get a ton of data in

0:00:44there like a ton of Records or like a

0:00:46ton of audiobooks or stuff like that

0:00:48like like do you when you design things

0:00:50do you account for like very very heavy

0:00:53users who might be using the app to do

0:00:56or store way more than you designed it

0:00:59for I it's something i've definitely

0:01:02didn't do or what initially and had

0:01:05since have to had to learn a lot of

0:01:07lessons about doing like in preparation

0:01:09of this episode i took a look in my

0:01:11recipe sink system and i found I was

0:01:14like wonder how many recipes the biggest

0:01:16users have and the biggest user has 13

0:01:19thousand recipes like god in their in

0:01:24their sink account and they use the app

0:01:27how I also checked how often like are

0:01:28they actually still using it and it's

0:01:30like their last their the data their

0:01:32last one yesterday so they are still

0:01:35using it with 13 thousand recipes and I

0:01:37did not in any way design the app to

0:01:39scale for two thirteen thousand recipes

0:01:41so it's something that I've had to learn

0:01:43and I'll get the support requests from

0:01:45people who are like why won't it just

0:01:46like you know the sink seems really slow

0:01:49and I go and check their account and

0:01:51they have even if not the 13 thousand

0:01:53but even like two or three thousand

0:01:55recipes and I'm like yeah that's that's

0:01:58gonna be tough on an iPad 2 - so just

0:02:01move that amount of data around and

0:02:03quickly search it and things that I mean

0:02:05the numbers aren't massive in and of

0:02:07themselves but I think like you're

0:02:09saying it's you have to design your app

0:02:12and be adaptive to it

0:02:13in that way or otherwise the things just

0:02:15fall down horribly because like your apt

0:02:20if your app doesn't you know sort of

0:02:22scale well or gracefully it's gonna kind

0:02:25of fall apart and so now when I'm doing

0:02:27these kinds of things I always have to

0:02:28think in the back of my mind like how

0:02:30this it's not even how many how many

0:02:33records or how many entries could

0:02:34someone reasonably have it's like how

0:02:36many records could someone unreasonably

0:02:39have what is what like what's the limit

0:02:42here beyond which it would be completely

0:02:44impractical for them to even get there

0:02:46and it's also probably worth saying like

0:02:48that person who has 13 thousand recipes

0:02:51like they've been at inter entering into

0:02:53the system into the system for the think

0:02:55three years now like they've been using

0:02:57the app for three years and so even like

0:03:01you have to keep in mind that you things

0:03:03will just gradually grow and extend over

0:03:05time that it's not even just oh

0:03:08someone's being silly and just like

0:03:10creating a million entries in my system

0:03:11it's like no they could just use it a

0:03:13lot and over the course of several years

0:03:16because hopefully your app will be

0:03:18around for several years it'll get to a

0:03:20point that things are way beyond what

0:03:22you may have originally thought or

0:03:24expected oh yeah I mean like you know

0:03:27and this isn't that unreasonable of a

0:03:30thing to I could from the user point of

0:03:32view like you might you might think as a

0:03:34user oh I'm using everything as design

0:03:36but like there there's probably like one

0:03:37or two things in your in your setup

0:03:40either the apps you use or maybe like a

0:03:42giant folder on your computer or some

0:03:44giant database you have like oh I happen

0:03:46to have I happen to be a Musical actor

0:03:48and have like a hundred thousand mp3s or

0:03:50happen to have a lot of photos or

0:03:51whatever else like almost everybody has

0:03:53the extremes of something you know like

0:03:55like we like I our friend Merlin man

0:03:57over it back to work has often talked

0:03:59about his trouble finding Dropbox text

0:04:01file markdown editors because like that

0:04:03whole category of app so there's a

0:04:04million of on the app store to edit

0:04:06Dropbox note text files because he has

0:04:09like thousands of them because he uses

0:04:10them in all sorts of ways that a lot of

0:04:12people don't consider or don't think of

0:04:13and a lot of times like he try out a new

0:04:16app and it'll just crash or it'll be a

0:04:19searching will be impossibly slow or

0:04:21something you know this this happens a

0:04:22lot like almost everybody has like one

0:04:24thing where they are pushing the bounds

0:04:26on like I have

0:04:27with overcast I have users that first

0:04:31started reporting like slow sync issues

0:04:33and I would get I dig in with them and I

0:04:36find out that they would have like 150

0:04:38podcast subscriptions and so most people

0:04:41have trouble keeping up with 3 to 5

0:04:43podcasts every week and this guy has 150

0:04:46but he's using them you know he's using

0:04:49the app like I'm not gonna like that's

0:04:50that's that's the you know that's these

0:04:52people's prerogative if they want to use

0:04:53the app that way if it's not like

0:04:54malicious against you in any way what's

0:04:56the problem so you know you have to

0:04:58design for these kind of extremes and

0:04:59yet to test for them like you'd be

0:05:02surprised like how how how quickly

0:05:04either your app or your server the

0:05:07server side process if you're syncing

0:05:09them to a server or dealing with server

0:05:10anyway how quickly you can hit memory

0:05:12limits because like a lot of these like

0:05:14like you know my back-end is all PHP and

0:05:15yes make fun of it as much as you want

0:05:17but almost every language that has on

0:05:18the server side some kind of memory

0:05:20limit that you can configure often it's

0:05:22set by default to something you know

0:05:24right in like the hundreds of megabytes

0:05:26usually at most so you know you might

0:05:28have like a PHP process might be able to

0:05:30max out it like 32 Meg's or 128 Meg's

0:05:34something in that range well if somebody

0:05:35has like 10,000 items that you're trying

0:05:37to sync and the server is trying to deal

0:05:38with that you actually might hit that

0:05:40like depending on the design of your

0:05:41system

0:05:42similarly on I on iOS like if you're

0:05:45trying to read all those records into

0:05:46memory to do some kind of batch

0:05:47operation or some kind of inefficient

0:05:50counting or something like that if

0:05:52you're if you have your own custom data

0:05:54interaction layer here and you are

0:05:57dealing with 10,000 records 100,000

0:05:59records and an app that you designed to

0:06:00have a few hundred records you might

0:06:02blow the memory limit on the iOS device

0:06:04and the app might get killed or crash so

0:06:06this is you know this is pretty pretty

0:06:08important stuff to at least deal with

0:06:10gracefully or as gracefully as you can

0:06:12you know your app should at least not

0:06:14crash you know if a heavy user uses it

0:06:16and so you should be as much as much as

0:06:18it's possible to you should be testing

0:06:20for this like if you have an app with

0:06:22any kind of user login system have a

0:06:24user that has you know way more content

0:06:28or data or records then you think is

0:06:30normal or that you even think anybody

0:06:32would ever have you know like I like

0:06:34during the velopment of breadth of

0:06:35vesper our friend Brent Simmons was was

0:06:39blogging here and there about how like

0:06:40they had

0:06:41they had a test data that was like

0:06:43thousands of notes and they knew that

0:06:44almost nobody would ever take thousands

0:06:46and thousands of notes but they wanted

0:06:48to make sure the app worked well and

0:06:51didn't crash and hopefully was fast and

0:06:53was still actually good and functional

0:06:54with way more data than they expected so

0:06:58like you know first first priority don't

0:07:01break you know don't crash don't make

0:07:03the UI like break in weird ways like

0:07:06it's like something overflowing it's

0:07:08bound or rendering in the wrong spot

0:07:09because like some assumption was broken

0:07:11but how long something would be and and

0:07:13try to not slow down

0:07:15noticeably so there's many strategies

0:07:17for this that it you know beyond the

0:07:19scope of this episode but you know

0:07:21generally you want to you know you want

0:07:22to have some kind of database back in

0:07:24you know not like a P list with 10,000

0:07:26entries in it like you want to have some

0:07:28kind of database if you use core data it

0:07:30will do a lot of this for you especially

0:07:31if you use like the the fetch results

0:07:33controller is right because it you use

0:07:34those here and there right yeah and then

0:07:36they handle that's how most of this gets

0:07:38done in my ABS it's like rely on

0:07:40problems that were solved at a different

0:07:43level like because core data was

0:07:45designed to scale from like 10 records

0:07:49to ten thousand or ten million records

0:07:51like it's intended to be able to do that

0:07:53and so if you use it that way you know

0:07:56it does all the nice batching for you

0:07:58and only pulling in like pointers to

0:08:01things rather than to hold their whole

0:08:03contents initially and all that kind of

0:08:05stuff like if you do it thoughtfully in

0:08:07that way then you know a lot of this

0:08:09work can sort of be done for you or at

0:08:11least the first pass at this kind of

0:08:13work can be done for you exactly so you

0:08:16know generally you know don't break

0:08:18under heavy usage like this if you can

0:08:20help it and then try it to slow down and

0:08:22so you know use this as appropriate make

0:08:24sure you know watch your memory limits

0:08:25it helps to like you know if you can run

0:08:27some testing where you can go into

0:08:29instruments and watch memory usage of

0:08:30your app and like see how it changes if

0:08:32somebody has ten rows versus ten

0:08:36thousand rows and you know the it should

0:08:38not be going up linearly with the amount

0:08:40of data that's being stored in your app

0:08:42you know your your your in memory set

0:08:44should not be scaling up your you know

0:08:46your on disk set obviously could but you

0:08:48know in memory should not so you know

0:08:51beyond the technical side of making sure

0:08:53it works

0:08:54and you know again that's not a small

0:08:56thing but if you be on the technical

0:08:58side of things there are things you can

0:09:00do in the design of the app to kind of

0:09:03help make this manageable for people and

0:09:07help help yourself out too with like the

0:09:08amount of load that you're placing on

0:09:09various parts of it and you know how

0:09:12something might break so well I think

0:09:14one of the one of the staples of iOS app

0:09:16usability and design is the table view

0:09:18you know the table view first of all

0:09:20it's designed in such a way especially

0:09:22when paired with core data or an

0:09:24intelligent other layer it's designed in

0:09:25such a way that it can scale

0:09:27ridiculously well we know when you

0:09:28combine the the way the cells are reused

0:09:31and only certain amounts of data or page

0:09:33in at once

0:09:33combine that with like the the

0:09:35estimations of cell Heights and the

0:09:38estimations of sections and numbers of

0:09:40things in sections and then you have

0:09:42like the the like first letter on the

0:09:44right side like and like in the phone

0:09:45contacts app you have like the letter

0:09:46jumping on the side where you can sort

0:09:48and that's also by the way helpful in

0:09:50different languages that you don't

0:09:51support use apples please just use

0:09:53apples thing and you'll be mostly okay

0:09:54you know stuff like that having like

0:09:57easy navigation intelligent sorting of

0:09:59long lists like you know you might have

0:10:01a list in your app that's sorted

0:10:02chronologically if there's no way to

0:10:05sort it alphabetically and somebody

0:10:07might have 10,000 items that might be

0:10:09problematic you know if it likes think

0:10:11about like how you're how you're sorting

0:10:12in your app works and if there's

0:10:14anything you can do in the design the UI

0:10:16design of the app to make it less

0:10:18cumbersome or impossible to use for

0:10:21somebody who is in your opinion grossly

0:10:23over using it or grossly over filling it

0:10:26because that will happen there will be

0:10:28good reasons for it and you know if

0:10:30possible don't break under that right

0:10:32and so other things also in that and in

0:10:35that category would involve Search

0:10:37Search is a big one here you know any

0:10:40kind of local search you can offer that

0:10:42doesn't use a server is is easy first of

0:10:45all almost every database supports

0:10:47sequel Lite supports it you know you can

0:10:50just write your own dumb one if you

0:10:51really want to but please use a search

0:10:52index it's much easier like using stuff

0:10:55like that can really help people who

0:10:57have tons and tons of of entries can

0:10:59really help them find their data and use

0:11:02your app and with search like you know

0:11:04the way it works with like basically a

0:11:07whole bunch of binary tree

0:11:08and everything like you can you could

0:11:10make a vast number of Records accessible

0:11:13via search without a ton of work and

0:11:15without a ton of CPU time being spent so

0:11:17you know if there's any possibility of

0:11:20somebody having a ton of data in your

0:11:22app offer a search if it makes sense to

0:11:25because it really does its ski it lets

0:11:28your apps scale well because all of this

0:11:31was really talking about app scaling

0:11:33it's like you know in kind of in the in

0:11:35the way that you know website scaling is

0:11:36really talking about like number of

0:11:37users or amount of traffic AB scaling

0:11:40for one person in this case is like

0:11:42talking about the amount of data they

0:11:44might store in your app and what kind of

0:11:46technical and organizational challenges

0:11:49that will present exactly and the nice

0:11:52thing too is that most of these changes

0:11:54these improvements these ways of like

0:11:56looking at your app at high usage

0:11:59whatever that might need mean for your

0:12:01app will almost always make it better

0:12:04for the typical case that like you avoid

0:12:08the like if your app does get Linney

0:12:11linearly worse every time the user adds

0:12:14a record like that's incredibly

0:12:16problematic when you have 10,000 records

0:12:18but it means that every single time the

0:12:21user is using the app they're making it

0:12:23slightly worse for themselves like

0:12:25that's your discouraging use yeah like

0:12:27what you want is to make sure that you

0:12:30know your app scales gracefully in this

0:12:32way but mostly because then that means

0:12:34that it's probably gonna be a lot better

0:12:36for you know your typical user like and

0:12:39obviously that's nothing you want to

0:12:40keep in the back of your mind that you

0:12:41don't want to be making changes that are

0:12:43only beneficial if you have 10,000 users

0:12:46or 10,000 records because very few users

0:12:49are gonna have that and so if it makes

0:12:50your app way more complicated then

0:12:52that's probably not good but looking at

0:12:54it in these ways you get these benefits

0:12:56I mean it's like you were saying with

0:12:57like UI tableview is really efficient

0:12:59and UI tableview is designed like for

0:13:02the original iPhone like as far as I

0:13:03know it's like that was built into you

0:13:05know iPhone OS 1 when things were

0:13:07incredibly constrained and tight and it

0:13:11made the an OS you know where a lot of

0:13:13things are just scrolling lists really

0:13:15perform it in powerful and so then as

0:13:17devices got more capable it got even

0:13:20better and in the same way it's like if

0:13:22you

0:13:22you are designing things so that they

0:13:23work when things are constrained in this

0:13:25case when they were constrained by

0:13:26having large numbers of things when you

0:13:29aren't constrained in that way suddenly

0:13:31everything's just better and faster and

0:13:33in the a--probably instantaneous for

0:13:36most of your users like if things only

0:13:38take a few seconds for your extreme

0:13:40users they're probably gonna be if you

0:13:42know instantaneous or you know momentary

0:13:46for your typical user and that's what

0:13:48you want and like that this exercise is

0:13:51helpful in that way of looking at your

0:13:53app and saying well where could I make

0:13:55this better like an easy obvious case

0:13:57it's just to say like well let me throw

0:13:59way more things into it than I need and

0:14:01see where I can make it better as a

0:14:03result exactly and you know and you're

0:14:06like you mentioned like you know trying

0:14:07to optimize for typical use you know

0:14:09versus versus the the kind of extremes

0:14:11and the fact is like when you're when

0:14:13you're talking about adding any kind of

0:14:14organizational system something like I'm

0:14:16thinking like you know like like one

0:14:18level of folders or tags which are

0:14:20basically folders like you know one

0:14:21level of organization to like abstract

0:14:24something away that can go a long way

0:14:26like if you have an app where people

0:14:29might often have more than about you

0:14:31know 20 to 50 records like they might

0:14:33want some kind of way to organize that

0:14:34and like having just one level of folder

0:14:38hierarchy could also scale to 10,000

0:14:41items fairly well like you don't have

0:14:43like a little goes a long way here you

0:14:45don't really have to go overboard with a

0:14:46cup with accommodating for these things

0:14:47in the UI because you know the the high

0:14:51end users any little bit will help them

0:14:54tremendously and it won't put too much

0:14:56of a burden on regular users exactly and

0:14:59obviously these are all like these are

0:15:00the kinds of things we're talking about

0:15:01are in the good case where things are

0:15:04people are using your app in the way

0:15:06that you intended it and just using it a

0:15:07lot but obviously they also they could

0:15:09talk use there could be problems that

0:15:11you could run into on the malicious side

0:15:12and we're about to talk about that

0:15:14before we do could you tell me about

0:15:15something that's awesome we are

0:15:17sponsored this week by dev mate go to

0:15:19dev mate dot-com slash radar to learn

0:15:22more dev mate is a single SDK with a set

0:15:24of advanced back-end features for Mac

0:15:27developers that allows them to easily

0:15:28integrate in app purchasing software

0:15:31licensing auto-updates crash reports

0:15:33user feedback and more

0:15:35all four Mac apps without being in the

0:15:38Mac App Store this is very useful stuff

0:15:40if you're a Mac developer because you

0:15:41don't have to handle all these things

0:15:42for you know all manually for yourself

0:15:44plus all the analytics for your app with

0:15:46sales and downloads are all available

0:15:48real time in dev mate's dashboard that's

0:15:51real-time sales analytics data Mac paw

0:15:53are very excited to announce that dev

0:15:55mates of rich functionality is now free

0:15:57for all and is instantly accessible

0:15:59after integration magpie use these tools

0:16:02themselves to help them build their own

0:16:03apps include and CleanMyMac and you

0:16:05can't and you can take a look at on

0:16:06their site to see examples than many

0:16:08other developers that also rely on dev

0:16:10mate there's some big names there these

0:16:12days more and more developers are eager

0:16:14to sell outside the Mac App Store having

0:16:16dev mate as an ultimate solution for

0:16:18independent OS 10 development is a great

0:16:20place to start you can find out more

0:16:22right now by going to dev mate comm

0:16:24slash radar once again that's dev mate

0:16:27comm slash radar if you're a Mac

0:16:29developer you got to check this out

0:16:30thank you very much to dev mate for

0:16:32sponsoring

0:16:32under-the-radar and all of real EFM all

0:16:35right so obviously if you you know

0:16:39people are just putting lots of data in

0:16:40your app like that's not really

0:16:41problematic it could be problematic if

0:16:43rep distance and a lit well but there's

0:16:46also cases where rather than just your

0:16:48users using the app and a positive like

0:16:51they just love it you know like this

0:16:52person just really loves baking and

0:16:54wants to put 13,000 recipes in their

0:16:56city and there's in in my sink system

0:16:58there can also be taking cases

0:17:00especially as your hep cats

0:17:02attention or popular or you get

0:17:05attention or become popular where people

0:17:07might want to misuse your application

0:17:09for whatever reason or in whatever way

0:17:11and so it's kind of important that you

0:17:13also think about it from those

0:17:15perspectives of what's the worst that

0:17:18people could do what could people be

0:17:20doing with my app with my back-end you

0:17:23know if someone ran like a Wireshark

0:17:25application and looked at all the

0:17:27network traffic between my app and my

0:17:29server are there things that I wouldn't

0:17:31want them to know or be able operations

0:17:34that they could do that would really

0:17:36hurt me and you kind of have to start

0:17:38thinking through these basic security

0:17:41things in order to make sure that your

0:17:42app is going to be stable and worthwhile

0:17:45and and also like in the same kind of

0:17:47way we were saying before

0:17:49if you do these things it can prevent

0:17:52misuse but it also will probably make

0:17:54basic use better because then your app

0:17:56is more secure your users data is more

0:17:58secure things are more reliable and so

0:18:01it does take a bit of work and a bit of

0:18:03thoughtfulness but these are things that

0:18:04are kind of basic things that are

0:18:06probably important if you want to get

0:18:08into any kind of thing that you stores

0:18:11or uses users data oh yeah and you know

0:18:13like when you have any kind of you know

0:18:15if you just have a local app that has no

0:18:17web component that you at least that you

0:18:19run but you know it if you just have a

0:18:21local app there's only so much user can

0:18:23do to to hurt anyone else or you using

0:18:26the app but as soon as you have a

0:18:28service behind it or especially like a

0:18:30web interface there there are so much

0:18:33that people can do that you know the

0:18:35good thing is that web security is a

0:18:38pretty well-known field at this point I

0:18:40mean it's not solved it's not flawless

0:18:42but you know the the major categories of

0:18:45danger are well-known and many of them

0:18:49can be avoided you know without too much

0:18:51work these days because we you know

0:18:52we've had a long time to work on web

0:18:53security and so like you know like one

0:18:56of the basics is obviously to use SSL

0:18:58you know if you have any kind of API the

0:19:01running over HTTP use SSL this is not

0:19:04difficult these days in fact one tip

0:19:06I've come across recently is so I host

0:19:09all my stuff on Linode and they have

0:19:12these things called node balancers we're

0:19:13just like their own like kind of managed

0:19:15to load balancing things for 20 bucks a

0:19:17month and so I use I use node balance

0:19:20here is not only for load balancing but

0:19:21even when I only have one server behind

0:19:23them I use the node bouncer for SSL

0:19:26decryption and also to be kind of a

0:19:28front-end because then the actual IP of

0:19:30the machine is not you know being

0:19:32directly exposed to the users and also

0:19:35that is handling all the SSL decryption

0:19:37for me so that and and Linode keeps

0:19:39these maintaining keep C's updated so

0:19:41that whenever SSL changes whenever like

0:19:44people discover oh this old ciphers

0:19:45actually actually has a weakness that we

0:19:47did that we just learned about so nobody

0:19:48should use that everyone should upgrade

0:19:50to TLS one point whatever or do you know

0:19:52disabled a certain cipher or anything

0:19:53they do all that for you so you are

0:19:56always kept on top of it you just paste

0:19:58it in your certificate in your key into

0:19:59their admin panel and then your server

0:20:02talks regular

0:20:03HTTP to the load balancer and the load

0:20:05balancer to the node balancer excuse me

0:20:07the node balancer then is handling all

0:20:09security for you so that's I highly

0:20:10recommend if you're on Linode and you

0:20:12can spare another 20 bucks a month

0:20:13outsource your your SSL dealing with to

0:20:16a node balancer it's a lot easier and

0:20:19you know but even if you do it yourself

0:20:21you know just keep on top of it there's

0:20:22a there's a Qualis SSL test that you can

0:20:24you can kind of test your site and see

0:20:26how it does on the security thing just

0:20:28you know go test it every few months or

0:20:29whenever you hear any news about it just

0:20:31make sure you're on top of things but or

0:20:33you can just outsource it like I do

0:20:34excuse me

0:20:35or you just outsource it and it's a no

0:20:36big deal also for web pages consider

0:20:41using content security policy this is a

0:20:43relatively young web thing it's it's a

0:20:47header you put on on repot on responses

0:20:50CSP or content security policy it's a

0:20:52thing that it's basically a declaration

0:20:55you make in the headers that tells the

0:20:57browser where from what domains and what

0:21:01types of JavaScript and CSS and assets

0:21:04are permitted to be loaded by this page

0:21:06and what this is mostly useful for is to

0:21:10eliminate a whole category of

0:21:12vulnerabilities like cross-site

0:21:14scripting then there's tons of

0:21:16vulnerabilities that this just

0:21:17completely negates for browsers that

0:21:19support it and almost every modern

0:21:20browser will enforce it as far as I know

0:21:22so you know using content security

0:21:24policy with SSL and with HSTs strict

0:21:28Transport Security which will enforce

0:21:29SSL for basically everything for all

0:21:32modern browsers like using those things

0:21:34you are way more secure than the average

0:21:37service and you know Plus you know basic

0:21:39server security as we talked about last

0:21:41week or two weeks ago rather so that is

0:21:44that will get you a huge huge part of

0:21:46the way there and and I mean heck I even

0:21:50in my podcast app I even have SSL

0:21:52certificate pinning which is complete

0:21:54overkill for a podcast app but what that

0:21:57means is it makes it a lot harder for

0:21:59anybody to not only snoop my traffic and

0:22:02break the app that way but also for like

0:22:03for you know creepy middlemen like like

0:22:06when you get on airplane Wi-Fi and it

0:22:07injects ads into everything you see now

0:22:09or you know like it it makes it

0:22:10impossible for those kind of things to

0:22:12interfere with my app and will protect

0:22:13me and it protects my users so it's it

0:22:16these kind

0:22:16things like they seem like overkill if

0:22:18you're just making an app for something

0:22:19basically playing podcasts but in in the

0:22:22modern era this really isn't overkill

0:22:24and it really isn't that hard I think

0:22:26that's the important thing to like a lot

0:22:27of these things like a little goes a

0:22:30long way like just does all these you

0:22:33know best practices and things you're

0:22:34talking about if like the different

0:22:35types of security and the different

0:22:37approaches you can take

0:22:38but doing anything is going to do a lot

0:22:42just to get started with and like if

0:22:43you're gonna do it fair enough do it

0:22:44properly but all of these things like

0:22:47any sigh if you just like you do there's

0:22:49no reason to be sending anything in

0:22:51plain text in like a modern app it's

0:22:54just it just doesn't make sense like

0:22:56maybe media maybe but in general like

0:22:59you missed you just may as well like

0:23:01things are it doesn't make your things

0:23:02slower or a little more expensive or

0:23:04those types of things like it just makes

0:23:06the app better and so if you can do it

0:23:09because you're just trying to minimize

0:23:10the things the directions that people

0:23:12can could you know be mischievous with

0:23:16your application exactly so moving on

0:23:19from now like direct security attacks I

0:23:21want to talk a little bit about spam if

0:23:24your app has any kind of user-generated

0:23:26content that could potentially be

0:23:29exposed to other users of the app or to

0:23:32the public on your website and it's some

0:23:33kind of like top ranked list or most

0:23:35popular content or anything like that

0:23:38that is a potential vector for spam for

0:23:41people to span your site of your service

0:23:42or your app in order to promote their

0:23:44own stuff or deface stuff or make people

0:23:46look at porn or whatever else there's

0:23:48you know so anything where

0:23:50user-generated content could be shown to

0:23:52a larger audience of your apps users you

0:23:55have to be very very careful about these

0:23:58kind of things that become possible it's

0:24:02you know it's one thing to just think oh

0:24:03well I'm gonna make you know suppose

0:24:05suppose you have like in overcast to

0:24:07have a recommendations thing suppose I

0:24:08would I was gonna show on the website

0:24:10top recommended things which I kind of

0:24:12do in the app but I'll get to that you

0:24:15have to think like how could somebody

0:24:16spam this in order to promote their own

0:24:19thing or show inappropriate content or

0:24:22something you know so somehow break it

0:24:24in a way that would be valuable to them

0:24:26or would you know deface the the whole

0:24:28thing and make everyone look bad

0:24:29and you might think oh I can just keep

0:24:31on top I'll just check it every day

0:24:33and I'll delete anything that looks

0:24:34wrong and it'll be fine the fact is you

0:24:37can't and you won't police it yourself

0:24:39like you you that is unless you have a

0:24:42very large dedicated staff doing this

0:24:44around the clock and you know and every

0:24:46different language around the world

0:24:47you're probably not gonna be able to

0:24:49police spam yourself hey you know you

0:24:52can you can look at the big services

0:24:53like like Twitter for instance where

0:24:55spam is a thing and it is not a small

0:24:58deal for a company like Twitter to to

0:25:02try to prevent and eliminate spam as it

0:25:04comes it that takes a huge staff so you

0:25:06probably won't have that luxury

0:25:07so my solution to this is to generally

0:25:11just avoid creating mechanisms that can

0:25:13be spammed so avoid creating global top

0:25:16lists you know any kind of like global

0:25:18rankings most popular lists I don't even

0:25:21have like you can't even review podcasts

0:25:23and overcast you can't like write

0:25:25written user reviews that are shown to

0:25:27anybody else because that's also spam

0:25:29you know promotional problems like

0:25:31defacing and everything legal problems

0:25:33so like just if you can avoid any area

0:25:36that can be spammed if you can't avoid

0:25:39it try to outsource the control that

0:25:42spam or the decision on whether

0:25:43something is spam try to outsource that

0:25:45to some other larger authority so and

0:25:48I'm not I'm not talking about other spam

0:25:50filters I'm not talking about like you

0:25:51know a kismet or anything like that I'm

0:25:52talking about outsourcing it to some

0:25:54other authority that themselves would

0:25:56need to have spam get through in a

0:25:59significant way for it to be a problem

0:26:00for you so an overcast case I use iTunes

0:26:04IDs because iTunes reviews every podcast

0:26:06that goes in and I have never seen spam

0:26:09in the iTunes podcast directory I've

0:26:11seen bad podcast but I've never actually

0:26:13seen like you know what most people

0:26:14consider blatant spam in there and it

0:26:18also helps control like adult content

0:26:19and you know stuff like that because

0:26:20they also look for that so in overcast I

0:26:22won't show a podcast in search results

0:26:25unless I can match it to something in

0:26:26the iTunes directory and if I can't

0:26:29it stays private like you can still

0:26:30enter it by URL but it's not going to be

0:26:32shown to people who weren't looking for

0:26:33it so that basically eliminates any of

0:26:35any problems with spam or poor content

0:26:37and then also for the recommendations

0:26:40side of it I use your Twitter following

0:26:42graph

0:26:43so the only recommendations you will

0:26:45ever see an overcast are either from

0:26:47people you follow on Twitter so if

0:26:49they're spamming you can unfollow them

0:26:50and it's you know that's that's that's

0:26:52your choice

0:26:52you know so it's either from people you

0:26:54have chosen to follow on Twitter or it's

0:26:56from people if you don't have enough

0:26:58people who you follow on Twitter it's

0:26:59from people who are very popular on

0:27:01Twitter who have tons and tons of

0:27:02followers so the point where it would it

0:27:05would be very very unlikely for any spam

0:27:08to get in that way but for the most part

0:27:10it's based on people you follow only and

0:27:12so that way you know the combination of

0:27:14that plus the iTunes ID filtering means

0:27:17that it's basically impossible for this

0:27:19mechanism to to show spam in a

0:27:22meaningful way and so really the best

0:27:24thing you can do if you have something

0:27:25like this is like design it so that it

0:27:27can't be spammed and if it can be

0:27:29spammed outsource the authority over

0:27:31what a spam to somebody big exactly and

0:27:34I think it's probably a good way to like

0:27:36I personally just avoid situations that

0:27:39user-generated data would ever be shown

0:27:41to someone else like I can't think of an

0:27:44example in any of my my products where I

0:27:46do that like I look at that problem and

0:27:48I'm like that is big scary yes not

0:27:50something I want to touch I just don't

0:27:52and maybe there that means that there

0:27:54are some features in my apps that I

0:27:55could have that would be really cool but

0:27:57I don't but I just decided that you know

0:27:59what it's I'm one person I'm never going

0:28:02to be able to or it's gonna be really

0:28:04hard to stay on top of it so I just

0:28:06don't and that's okay and I think the

0:28:08important thing with like this whole

0:28:10episodes discussion is when you're

0:28:13thinking of that feature like when I've

0:28:14December I'm deciding not to add

0:28:15features that show user-generated

0:28:17content to someone else like the

0:28:19fundamental underlying thing that you

0:28:22have to be thoughtful of is when you're

0:28:23building it you have to be building it

0:28:25with like what's the worst-case scenario

0:28:27in mind yep that it's so easy when

0:28:30you're building something to think of it

0:28:31only from like the cool obvious like the

0:28:34way you would use it perspective but in

0:28:37order for you to have an app that is

0:28:38going to be go with like good for

0:28:40performance for your extreme users or

0:28:42have good security and avoid kind of

0:28:44user you know user-generated content

0:28:46problems you have to always be building

0:28:48it sort of with the worst case in mind

0:28:50and that can be the worst case person

0:28:52the worst case user the worst case

0:28:54device the worst case Network whatever

0:28:56it is

0:28:57if you build something with the worst

0:28:58case in mind its overall going to be

0:29:01better as a result exactly that's all

0:29:04the time we have this week thank you

0:29:06very much for listening and we will see

0:29:07you next week bye