Office Hours — Today, October 9

Saturday, October 6

Oct 9
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
Ed T.
has entered the room
Mark M.
hello, Ed!
how can I help you today?
Ed T.
Good Morning Mark
9:00 AM
Ed T.
I've got a wild question this morning... I'll try to keep it focused. It's around security.
Looks like you Open Sourced some cool libraries. Thanks for doing that.
Mark M.
I don't know if I'm ready for a wild security question in the morning
Ed T.
lol
Mark M.
you're welcome!
Ed T.
So if I had a Flicker account app or a Google Office app on Android
and the user wanted to save those credentials
what would be the best way to do this?
Mark M.
in those two scenarios, you wouldn't control the server -- is that the case in the real scenario, or is it your server that the Android client is connecting to?
Ed T.
while true, most apps have a 'save account' option
or have the ability to 'save credit card' for later purchases option
Jovica P.
has entered the room
Ed T.
it's so small, it is hard to justify bring a DB to the table
Mark M.
if your concern encompasses "save credit card", then that changes my line of thinking a bit
(BTW, hello Jovica -- I will be with you shortly!)
Ed T.
it's not a credit carc
but it is that type of scenario
if the user has typed in account credentials and they want to use biometric to login for example...
Jovica P.
Hi threre. No specific agenda, just dropped by to see what's happening. :-)
Mark M.
Ed: well, that's completely different
9:05 AM
Mark M.
let's set aside biometrics for the moment
for most things, internal storage (getFilesDir()) should be sufficient
Ed T.
biometrics is being used in my app. if that helps/hurts your answer
and I leveraged your RxJava example... which was excellent... by the way. :-)
Mark M.
thanks!
if you wanted to encrypt the data on internal storage, with an eye towards biometrics, that's fine
that might be overkill for some things, but if you're already doing it...
Ed T.
I'm trying to avoid someone using adb on their phone and sniffing around in the file system
Mark M.
really, the question is: what is the risk and what are the threat vectors?
Ed T.
so to encrypt so I don't have clear txt strings... is pretty easy
I used to do that at the bank
and most banks have policies about 'PAN' data that it can't sit in a DB without being encrypted
Mark M.
are you implying that the user is the threat, or is your concern that the user leaves the phone at the bar and an attacker gets access to the hardware?
"user is the threat" is a DRM scenario, in effect
Ed T.
I know someone who got hacked on Android... and I was asked to do due diligence to prevent anything like that happening
9:10 AM
Ed T.
sorry, hard to be detailed when I'm in a recorded chat session... ;-)
Mark M.
understood, but at the same time, it is difficult to give you concrete advice with a steadily-changing scenario
Ed T.
I'm not trying to change it... sorry... I don't know as much as you. :-)
Mark M.
internal storage is the baseline for secure storage, as the only things that can access it are your app, users who root their device, or app bugs that wind up disclosing the data to malware
the fourth scenario is when an attacker gets physical access to the device
encrypted storage helps with that scenario
at least somewhat
Ed T.
it's really trivial to run adb
then say run-as 'app package name'
Mark M.
then you should be looking at device policies and forcing the user to have a secure lockscreen
Ed T.
and do 'ls -la'
Mark M.
the only people who can use adb are the people with access to the device: a user or a lost-device attacker
Ed T.
that isn't possible... assume your mother-in-law is using this app. ;-)
9:15 AM
Ed T.
I'm just trying to use good practice for those types of scenarios
Mark M.
"these type of scenarios" run the gamut from script kiddies to the NSA
I mean, we can ratchet the level of paranoia up as high as you like
Ed T.
I'm not wasting time on the NSA or the Masad
I know who wins that one... they have bigger computers... and could brute force in feeble thing I try
Mark M.
if your threat vector is "attacker gets physical access to the hardware", and the data is of sufficient concern to the user, encrypted data on internal storage is a reasonable choice
Ed T.
who am I protecting it from? what am I protecting? how long do I need to protect it?
Mark M.
that's the questions that I would need answered
Ed T.
those are basic three I focus on
Mark M.
and that's a fine starting point
Ed T.
I'm protecting a text string of less than 30 chars
I'm protecting that string from as many people as possible, within reason.
Mark M.
does "as many people as possible" include the user?
Ed T.
I need to protect it for the life of the app.
Mark M.
(BTW, Jovica, if you have a question, chime in, and I can give you a turn!)
Ed T.
yes, if it is in reason
I'm finished after this....
Mark M.
then don't put it on the device
Jovica P.
I have an app that stores username and password to our site in shared prefereces.
Ed T.
are SSL messages considered 'safe'
9:20 AM
Ed T.
or https
Jovica P.
Wanted to avoid it being trivially accesible so ended up using the solution descrbed here: https://www.codeproject.com/Articles/549119/Enc...
Mark M.
Ed: if the server is well-configured, yes, for data in transit
Ed T.
thanks guys!
it's hard to keep up with Android... without having to think about something as dynamic as security
Jovica P.
You can still find the ey hardcoded in the app, but at least it's good enough for 'script kiddie' type of attacker.
Ed T.
I'm done... cheers
Mark M.
sure, and security is one of those subjects for which a semi-public chat is not great
Jovica: I think you under-rate the modern script kiddie :-)
Ed T.
Mark, I'm in violent agreement with you. :-)
Mark M.
could you be in less-violent agreement? I bruise easily
Ed T.
lol
cheers
Thanks Jovica for the link.
Mark M.
Jovica: if the key is hardcoded in the app, a script kiddie probably could get it without much problem, though this is probably sufficient for "disgruntled ex-boyfriend" scenario
Ed's approach of using biometric-based AndroidKeyStore encryption avoids the hardcoded key and would be a fair bit stronger
Jovica P.
Well, yes, the threat profile we had in mind is definitely more of a casual snooper than a hard phisher.
9:25 AM
Mark M.
in which case, what you have is probably fine, though I haven't looked at that implementation specifically
Ed T.
Any idea on how many Android devices in the US have the biometric reader?
It's a hard one to determine.... imho
Jovica P.
Sure, if I had to do it again today, I'd probably go with boimetrics, too.
Mark M.
I'd venture that fingerprint scanners are reasonably common on Android 7.0+ hardware
Ed T.
Jovica, that link you sent is very close to what I did at a bank.
Hard thing about 2-tier apps is they need to connect to a DB and that requires credentials.
Mark M.
two-tier on mobile? I wish Campfire supported emoji, as I think there'd be a "scream" one that would be appropriate here
Ed T.
The banking app was 2-tier
old school
Mark M.
still, eek
Ed T.
You do realize they still have COBOL doing work... right? :-)
Mark M.
fortunately, not on Android in any significant degree
Ed T.
Jovica P.
Ok guys, I'm off now, just wanted to check things out a bit. See you around.
Ed T.
that is the best way to do it imho
ssh key
and ironically... it is what GitHub and GitLab use
9:30 AM
Ed T.
just don't lose your key AND your computer.... at the same time. ;-)
Mark M.
Jovica: have a pleasant day!
Jovica P.
has left the room
Ed T.
no way to issue something like that on Android
Mark M.
if you mean SSH-based communications, yeah, I don't recall there being a decent up-to-date client library
Ed T.
they keep you from knowing any traceable detail at the IP / MAC layer
because they don't want anyone leveraging Android to track people for add revenue.... they want it all to themselves...
lol
Mark M.
oh, somebody could create one -- it would not need to be part of the OS
not sure if anyone has tried creating a wrapper around libssh
Ed T.
that is an interesting thought
how are you today?
what can I help you with? Let's make is all about Mark now. lol
9:35 AM
Mark M.
so, I'm not sure if any of my ramblings in this chat were useful to you
anything else that I can help you with today?
9:45 AM
Ed T.
I'm good.
Thanks Mark
enjoy your day
Mark M.
you too!
10:00 AM
Ed T.
has left the room
Mark M.
turned off guest access

Saturday, October 6

 

Office Hours

People in this transcript

  • Ed Tidwell
  • Jovica Popovic
  • Mark Murphy