Skip to content

Commit

Permalink
Add LICENSE and update README.md and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Feb 25, 2023
1 parent 6bc698e commit 0b1e2ad
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 9 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Vignesh Rao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
**Platform Supported**

![Generic badge](https://img.shields.io/badge/Platform-Linux|MacOS|Windows-1f425f.svg)

![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)

**Deployments**

[![pypi](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml)
[![pages-build-deployment](https://github.com/thevickypedia/NetSec/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/thevickypedia/NetSec/actions/workflows/pages/pages-build-deployment)

[![Pypi-format](https://img.shields.io/pypi/format/NetSec)](https://pypi.org/project/NetSec/#files)
[![Pypi-status](https://img.shields.io/pypi/status/NetSec)](https://pypi.org/project/NetSec)

# NetSec (Network Security)
NetSec is a tool to analyze devices connecting to the router and alert accordingly when a new device is connected.

This app can display and store intruders' IP address, MAC address, and Block the device.

> Blocking device feature is currently available only for `Netgear` router users.
## Kick off

**Install**
```shell
python3 -m pip install NetSec
```

**Initiate**
```python
from netsec import network_monitor, SupportedModules

Expand All @@ -17,6 +39,15 @@ if __name__ == '__main__':

> Notifications will not repeat within an hour.
## ENV Variables
Environment variables are loaded from a `.env` file.

- **ROUTER_PASS** - Router password. _Only for `Netgear` users._
- **GMAIL_USER** - Gmail account username to send and email.
- **GMAIL_PASS** - Gmail account password to send and email.
- **RECIPIENT** - Email address to which `NetSec` alerts should be sent.
- **PHONE** - To send an SMS notification - Example: `1234567890`

## Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Expand Down Expand Up @@ -47,6 +78,11 @@ pip install sphinx==5.1.1 pre-commit recommonmark
pre-commit run --all-files
```

## Pypi Package
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)

[https://pypi.org/project/NetSec/](https://pypi.org/project/NetSec/)

## Runbook
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)

Expand Down
44 changes: 42 additions & 2 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,52 @@ <h3>Navigation</h3>
<div class="bodywrapper">
<div class="body" role="main">

<section id="netsec-network-security">
<p><strong>Platform Supported</strong></p>
<p><img alt="Generic badge" src="https://img.shields.io/badge/Platform-Linux%7CMacOS%7CWindows-1f425f.svg" /></p>
<p><img alt="Python" src="https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue" /></p>
<p><strong>Deployments</strong></p>
<p><a class="reference external" href="https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml"><img alt="pypi" src="https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml/badge.svg" /></a>
<a class="reference external" href="https://github.com/thevickypedia/NetSec/actions/workflows/pages/pages-build-deployment"><img alt="pages-build-deployment" src="https://github.com/thevickypedia/NetSec/actions/workflows/pages/pages-build-deployment/badge.svg" /></a></p>
<p><a class="reference external" href="https://pypi.org/project/NetSec/#files"><img alt="Pypi-format" src="https://img.shields.io/pypi/format/NetSec" /></a>
<a class="reference external" href="https://pypi.org/project/NetSec"><img alt="Pypi-status" src="https://img.shields.io/pypi/status/NetSec" /></a></p>
<section id="netsec-network-security">
<h1>NetSec (Network Security)<a class="headerlink" href="#netsec-network-security" title="Permalink to this heading"></a></h1>
<p>NetSec is a tool to analyze devices connecting to the router and alert accordingly when a new device is connected.</p>
<p>This app can display and store intruders’ IP address, MAC address, and Block the device.</p>
<blockquote>
<div><p>Blocking device feature is currently available only for <code class="docutils literal notranslate"><span class="pre">Netgear</span></code> router users.</p>
</div></blockquote>
<section id="kick-off">
<h2>Kick off<a class="headerlink" href="#kick-off" title="Permalink to this heading"></a></h2>
<p><strong>Install</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python3<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>NetSec
</pre></div>
</div>
<p><strong>Initiate</strong></p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">netsec</span> <span class="kn">import</span> <span class="n">network_monitor</span><span class="p">,</span> <span class="n">SupportedModules</span>

<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
<span class="c1"># SupportedModules.att # for AT&amp;T users</span>
<span class="c1"># SupportedModules.netgear # for any network using Netgear router</span>
<span class="n">network_monitor</span><span class="p">(</span><span class="n">module</span><span class="o">=</span><span class="n">SupportedModules</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="n">init</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="c1"># Create snapshot</span>
<span class="n">network_monitor</span><span class="p">(</span><span class="n">module</span><span class="o">=</span><span class="n">SupportedModules</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="n">init</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="c1"># Run the scan</span>
<span class="n">network_monitor</span><span class="p">(</span><span class="n">module</span><span class="o">=</span><span class="n">SupportedModules</span><span class="o">.</span><span class="n">att</span><span class="p">,</span> <span class="n">init</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="c1"># Scan for threats and alert</span>
</pre></div>
</div>
<blockquote>
<div><p>Notifications will not repeat within an hour.</p>
</div></blockquote>
</section>
<section id="env-variables">
<h2>ENV Variables<a class="headerlink" href="#env-variables" title="Permalink to this heading"></a></h2>
<p>Environment variables are loaded from a <code class="docutils literal notranslate"><span class="pre">.env</span></code> file.</p>
<ul class="simple">
<li><p><strong>ROUTER_PASS</strong> - Router password. <em>Only for <code class="docutils literal notranslate"><span class="pre">Netgear</span></code> users.</em></p></li>
<li><p><strong>GMAIL_USER</strong> - Gmail account username to send and email.</p></li>
<li><p><strong>GMAIL_PASS</strong> - Gmail account password to send and email.</p></li>
<li><p><strong>RECIPIENT</strong> - Email address to which <code class="docutils literal notranslate"><span class="pre">NetSec</span></code> alerts should be sent.</p></li>
<li><p><strong>PHONE</strong> - To send an SMS notification - Example: <code class="docutils literal notranslate"><span class="pre">1234567890</span></code></p></li>
</ul>
</section>
<section id="coding-standards">
<h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h2>
<p>Docstring format: <a class="reference external" href="https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings"><code class="docutils literal notranslate"><span class="pre">Google</span></code></a> <br>
Expand Down Expand Up @@ -86,6 +118,11 @@ <h2>Linting<a class="headerlink" href="#linting" title="Permalink to this headin
</pre></div>
</div>
</section>
<section id="pypi-package">
<h2>Pypi Package<a class="headerlink" href="#pypi-package" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://packaging.python.org/tutorials/packaging-projects/"><img alt="pypi-module" src="https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg" /></a></p>
<p><a class="reference external" href="https://pypi.org/project/NetSec/">https://pypi.org/project/NetSec/</a></p>
</section>
<section id="runbook">
<h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html"><img alt="made-with-sphinx-doc" src="https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg" /></a></p>
Expand All @@ -104,9 +141,12 @@ <h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this headin
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">NetSec (Network Security)</a><ul>
<li><a class="reference internal" href="#kick-off">Kick off</a></li>
<li><a class="reference internal" href="#env-variables">ENV Variables</a></li>
<li><a class="reference internal" href="#coding-standards">Coding Standards</a></li>
<li><a class="reference internal" href="#release-notes">Release Notes</a></li>
<li><a class="reference internal" href="#linting">Linting</a></li>
<li><a class="reference internal" href="#pypi-package">Pypi Package</a></li>
<li><a class="reference internal" href="#runbook">Runbook</a></li>
</ul>
</li>
Expand Down
42 changes: 41 additions & 1 deletion docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,53 @@
**Platform Supported**

![Generic badge](https://img.shields.io/badge/Platform-Linux|MacOS|Windows-1f425f.svg)

![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)

**Deployments**

[![pypi](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml)
[![pages-build-deployment](https://github.com/thevickypedia/NetSec/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/thevickypedia/NetSec/actions/workflows/pages/pages-build-deployment)

[![Pypi-format](https://img.shields.io/pypi/format/NetSec)](https://pypi.org/project/NetSec/#files)
[![Pypi-status](https://img.shields.io/pypi/status/NetSec)](https://pypi.org/project/NetSec)

# NetSec (Network Security)
NetSec is a tool to analyze devices connecting to the router and alert accordingly when a new device is connected.

This app can display and store intruders' IP address, MAC address, and Block the device.

> Blocking device feature is currently available only for `Netgear` router users.

## Kick off

**Install**
```shell
python3 -m pip install NetSec
```

**Initiate**
```python
from netsec import network_monitor, SupportedModules

if __name__ == '__main__':
# SupportedModules.att # for AT&T users
# SupportedModules.netgear # for any network using Netgear router
network_monitor(module=SupportedModules.att, init=True) # Create snapshot
network_monitor(module=SupportedModules.att, init=False) # Run the scan
network_monitor(module=SupportedModules.att, init=False) # Scan for threats and alert
```

> Notifications will not repeat within an hour.

## ENV Variables
Environment variables are loaded from a `.env` file.

- **ROUTER_PASS** - Router password. _Only for `Netgear` users._
- **GMAIL_USER** - Gmail account username to send and email.
- **GMAIL_PASS** - Gmail account password to send and email.
- **RECIPIENT** - Email address to which `NetSec` alerts should be sent.
- **PHONE** - To send an SMS notification - Example: `1234567890`

## Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Expand Down Expand Up @@ -43,6 +78,11 @@ pip install sphinx==5.1.1 pre-commit recommonmark
pre-commit run --all-files
```

## Pypi Package
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)

[https://pypi.org/project/NetSec/](https://pypi.org/project/NetSec/)

## Runbook
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)

Expand Down
6 changes: 4 additions & 2 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ <h2 id="N">N</h2>
<li><a href="index.html#module-netsec.modules.helper">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
netsec.modules.models

<ul>
<li><a href="index.html#module-netsec.modules.models">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
netsec.modules.netgear

Expand All @@ -220,6 +220,8 @@ <h2 id="N">N</h2>
</li>
</ul></li>
<li><a href="index.html#netsec.analyzer.network_monitor">network_monitor() (in module netsec.analyzer)</a>
</li>
<li><a href="index.html#netsec.modules.settings.Config.notification">notification (netsec.modules.settings.Config attribute)</a>
</li>
<li><a href="index.html#netsec.modules.helper.notify">notify() (in module netsec.modules.helper)</a>
</li>
Expand Down
Loading

0 comments on commit 0b1e2ad

Please sign in to comment.