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!
|
Mark M. |
how can I help you today?
|
Ed T. |
Good Morning Mark
|
Oct 9 | 9:00 AM |
Ed T. |
I've got a wild question this morning... I'll try to keep it focused. It's around security.
|
Ed T. |
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
|
Ed T. |
and the user wanted to save those credentials
|
Ed T. |
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
|
Ed T. |
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
|
Mark M. |
(BTW, hello Jovica -- I will be with you shortly!)
|
Ed T. |
it's not a credit carc
|
Ed T. |
but it is that type of scenario
|
Ed T. |
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
|
Oct 9 | 9:05 AM |
Mark M. |
let's set aside biometrics for the moment
|
Mark M. |
for most things, internal storage (getFilesDir()) should be sufficient
|
Ed T. |
biometrics is being used in my app. if that helps/hurts your answer
|
Ed T. |
and I leveraged your RxJava example... which was excellent... by the way. :-)
|
Mark M. |
thanks!
|
Mark M. |
if you wanted to encrypt the data on internal storage, with an eye towards biometrics, that's fine
|
Mark M. |
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
|
Ed T. |
I used to do that at the bank
|
Ed T. |
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?
|
Mark M. |
"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
|
Oct 9 | 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
|
Mark M. |
the fourth scenario is when an attacker gets physical access to the device
|
Mark M. |
encrypted storage helps with that scenario
|
Mark M. |
at least somewhat
|
Ed T. |
it's really trivial to run adb
|
Ed T. |
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. ;-)
|
Oct 9 | 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
|
Mark M. |
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
|
Ed T. |
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
|
Ed T. |
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
|
Ed T. |
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'
|
Oct 9 | 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!
|
Ed T. |
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
|
Mark M. |
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
|
Ed T. |
cheers
|
Ed T. |
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
|
Mark M. |
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.
|
Oct 9 | 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?
|
Ed T. |
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.
|
Ed T. |
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
|
Ed T. |
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
|
Ed T. |
ssh key
|
Ed T. |
and ironically... it is what GitHub and GitLab use
|
Oct 9 | 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
|
Ed T. |
because they don't want anyone leveraging Android to track people for add revenue.... they want it all to themselves...
|
Ed T. |
lol
|
Mark M. |
oh, somebody could create one -- it would not need to be part of the OS
|
Mark M. |
not sure if anyone has tried creating a wrapper around libssh
|
Ed T. |
that is an interesting thought
|
Ed T. |
how are you today?
|
Ed T. |
what can I help you with? Let's make is all about Mark now. lol
|
Oct 9 | 9:35 AM |
Mark M. |
so, I'm not sure if any of my ramblings in this chat were useful to you
|
Mark M. |
anything else that I can help you with today?
|
Oct 9 | 9:45 AM |
Ed T. |
I'm good.
|
Ed T. |
Thanks Mark
|
Ed T. |
enjoy your day
|
Mark M. |
you too!
|
Oct 9 | 10:00 AM |
Ed T. | has left the room |
Mark M. | turned off guest access |