(Network Security File Writer)
Generates you Network Security files for Android (network_security_config.xml) and the NSAppTransportSecurity part iOS via a simple cli.
Note
Info: Note that the Info.plist might not be "valid", since there is no header and it starts with a key tag
- ๐ฆ No external dependencies
- ๐ Output as file or as plain text
- ๐ Fetch certificate expiry time automaticaly
- ๐ Pin multiple websites in one go
- TODO
- Clone the repo
- Build using
go build
- Run
-websites
: Takes in a comma seperated list of domains e.g. https://www.test.com,https://test2.com (required)-output
: Takes in the output path for generated files (optional)-no-file
: Writes data tostdout
if set, otherwise toInfo.plst
&networks_security_config.xml
(optional)-platforms
: Specify for which platforms you want to generate the pinning files, comma sperated e.g. android,ios (optional)-help
: Returns help interface
nsfw -websites https://test.com -output ~/my-app/android/app/src/main/res/xml/ -platforms android
: Creates the androidnetwork_security_config.xml
in its folder for test.cmonsfw -websites https://test.com,https://www.test2.com -no-file -platforms ios
: Returns theNSNetworkAppTransportSecurity
config in the terminalnsfw -websites https://test.com https://www.test2.com
: Generate both config files for ios and android and saves them into the current folder
- Providing fallbacks
- Providing multiple pins
- Provide certificates
- Disabling subdomain pinning support (May be possible to implement if desired)
- Pin more than the leaf certificate (May be possible to implement if desired)
- Customize file names (May be possible to implement if desired)
- Custom output path for each android & ios (Possible if desired)
- Figure out if I follow best practices, since I'm new to go
- Review code organization
- Consider moving networking into sperate struct / function
- Running requests in paralel?
- Finding a way to embed / merge the ios output into existing Info.plist file
- Website, so you can run everything via a comfy ui
- Testing?
- Handle panics gracefully (not throwing around stack traces etc.)
- Setup Github action for releasing binarys
- (Packageing code for easier installation)
- (Offering CI/CD integrations)
Feel free to either pick something from the TODOS, or open your own issue and we can discuss things
Feedback for the existing codebase is also highly appreciated!