by ChrisMarshallNY · 5y ago · 0 comments
What I do, is have a file that aggregates my sensitive stuff (like server secrets and whatnot), and call that file something like "DoNotCheckThisIntoSourceControl.swift". I then add a git ignore line, on that name.
I'll also sometimes store it outside of the repo root (I use Xcode, so I can drag files in from anywhere).
I just make sure to have a single location for sensitive stuff, then ignore/move it.
I will store the contents of the file as an encrypted note in 1Password, so I do have a stored version controlled variant.
The best solution is to plan ahead.
When I write a line of code, I have an automatic "red team" approach. I think "I'm a blackhat hacker. How do I leverage this line?"
Not a 100% guarantee, but it sure does help the result to be more secure.
In my experience, 99% of security is good old-fashioned horse sense.