Code Monkey home page Code Monkey logo

nsfw's Introduction

NSFW

(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

Download Binary

  • TODO

Building

  1. Clone the repo
  2. Build using go build
  3. Run

Commands

  • -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 to stdout if set, otherwise to Info.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

Example

  • nsfw -websites https://test.com -output ~/my-app/android/app/src/main/res/xml/ -platforms android: Creates the android network_security_config.xml in its folder for test.cmo
  • nsfw -websites https://test.com,https://www.test2.com -no-file -platforms ios: Returns the NSNetworkAppTransportSecurity config in the terminal
  • nsfw -websites https://test.com https://www.test2.com: Generate both config files for ios and android and saves them into the current folder

Not supported

  • 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)

TODOS:

  • 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)

Contributions

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!

nsfw's People

Contributors

flajt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.