Skip to content

Commit 0b1e2ad

Browse files
committed
Add LICENSE and update README.md and bump version
1 parent 6bc698e commit 0b1e2ad

11 files changed

Lines changed: 161 additions & 9 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Vignesh Rao
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1+
**Platform Supported**
2+
3+
![Generic badge](https://img.shields.io/badge/Platform-Linux|MacOS|Windows-1f425f.svg)
4+
5+
![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
6+
7+
**Deployments**
8+
9+
[![pypi](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml)
10+
[![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)
11+
12+
[![Pypi-format](https://img.shields.io/pypi/format/NetSec)](https://pypi.org/project/NetSec/#files)
13+
[![Pypi-status](https://img.shields.io/pypi/status/NetSec)](https://pypi.org/project/NetSec)
14+
115
# NetSec (Network Security)
216
NetSec is a tool to analyze devices connecting to the router and alert accordingly when a new device is connected.
317

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

620
> Blocking device feature is currently available only for `Netgear` router users.
721
22+
## Kick off
23+
24+
**Install**
25+
```shell
26+
python3 -m pip install NetSec
27+
```
28+
29+
**Initiate**
830
```python
931
from netsec import network_monitor, SupportedModules
1032

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

1840
> Notifications will not repeat within an hour.
1941
42+
## ENV Variables
43+
Environment variables are loaded from a `.env` file.
44+
45+
- **ROUTER_PASS** - Router password. _Only for `Netgear` users._
46+
- **GMAIL_USER** - Gmail account username to send and email.
47+
- **GMAIL_PASS** - Gmail account password to send and email.
48+
- **RECIPIENT** - Email address to which `NetSec` alerts should be sent.
49+
- **PHONE** - To send an SMS notification - Example: `1234567890`
50+
2051
## Coding Standards
2152
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
2253
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
@@ -47,6 +78,11 @@ pip install sphinx==5.1.1 pre-commit recommonmark
4778
pre-commit run --all-files
4879
```
4980

81+
## Pypi Package
82+
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)
83+
84+
[https://pypi.org/project/NetSec/](https://pypi.org/project/NetSec/)
85+
5086
## Runbook
5187
[![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)
5288

docs/README.html

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,52 @@ <h3>Navigation</h3>
4242
<div class="bodywrapper">
4343
<div class="body" role="main">
4444

45-
<section id="netsec-network-security">
45+
<p><strong>Platform Supported</strong></p>
46+
<p><img alt="Generic badge" src="https://img.shields.io/badge/Platform-Linux%7CMacOS%7CWindows-1f425f.svg" /></p>
47+
<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>
48+
<p><strong>Deployments</strong></p>
49+
<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>
50+
<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>
51+
<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>
52+
<a class="reference external" href="https://pypi.org/project/NetSec"><img alt="Pypi-status" src="https://img.shields.io/pypi/status/NetSec" /></a></p>
53+
<section id="netsec-network-security">
4654
<h1>NetSec (Network Security)<a class="headerlink" href="#netsec-network-security" title="Permalink to this heading"></a></h1>
4755
<p>NetSec is a tool to analyze devices connecting to the router and alert accordingly when a new device is connected.</p>
4856
<p>This app can display and store intruders’ IP address, MAC address, and Block the device.</p>
4957
<blockquote>
5058
<div><p>Blocking device feature is currently available only for <code class="docutils literal notranslate"><span class="pre">Netgear</span></code> router users.</p>
5159
</div></blockquote>
60+
<section id="kick-off">
61+
<h2>Kick off<a class="headerlink" href="#kick-off" title="Permalink to this heading"></a></h2>
62+
<p><strong>Install</strong></p>
63+
<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
64+
</pre></div>
65+
</div>
66+
<p><strong>Initiate</strong></p>
5267
<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>
5368

5469
<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>
70+
<span class="c1"># SupportedModules.att # for AT&amp;T users</span>
71+
<span class="c1"># SupportedModules.netgear # for any network using Netgear router</span>
5572
<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>
56-
<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>
73+
<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>
5774
</pre></div>
5875
</div>
76+
<blockquote>
77+
<div><p>Notifications will not repeat within an hour.</p>
78+
</div></blockquote>
79+
</section>
80+
<section id="env-variables">
81+
<h2>ENV Variables<a class="headerlink" href="#env-variables" title="Permalink to this heading"></a></h2>
82+
<p>Environment variables are loaded from a <code class="docutils literal notranslate"><span class="pre">.env</span></code> file.</p>
83+
<ul class="simple">
84+
<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>
85+
<li><p><strong>GMAIL_USER</strong> - Gmail account username to send and email.</p></li>
86+
<li><p><strong>GMAIL_PASS</strong> - Gmail account password to send and email.</p></li>
87+
<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>
88+
<li><p><strong>PHONE</strong> - To send an SMS notification - Example: <code class="docutils literal notranslate"><span class="pre">1234567890</span></code></p></li>
89+
</ul>
90+
</section>
5991
<section id="coding-standards">
6092
<h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h2>
6193
<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>
@@ -86,6 +118,11 @@ <h2>Linting<a class="headerlink" href="#linting" title="Permalink to this headin
86118
</pre></div>
87119
</div>
88120
</section>
121+
<section id="pypi-package">
122+
<h2>Pypi Package<a class="headerlink" href="#pypi-package" title="Permalink to this heading"></a></h2>
123+
<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>
124+
<p><a class="reference external" href="https://pypi.org/project/NetSec/">https://pypi.org/project/NetSec/</a></p>
125+
</section>
89126
<section id="runbook">
90127
<h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this heading"></a></h2>
91128
<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>
@@ -104,9 +141,12 @@ <h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this headin
104141
<h3><a href="index.html">Table of Contents</a></h3>
105142
<ul>
106143
<li><a class="reference internal" href="#">NetSec (Network Security)</a><ul>
144+
<li><a class="reference internal" href="#kick-off">Kick off</a></li>
145+
<li><a class="reference internal" href="#env-variables">ENV Variables</a></li>
107146
<li><a class="reference internal" href="#coding-standards">Coding Standards</a></li>
108147
<li><a class="reference internal" href="#release-notes">Release Notes</a></li>
109148
<li><a class="reference internal" href="#linting">Linting</a></li>
149+
<li><a class="reference internal" href="#pypi-package">Pypi Package</a></li>
110150
<li><a class="reference internal" href="#runbook">Runbook</a></li>
111151
</ul>
112152
</li>

docs/_sources/README.md.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
1+
**Platform Supported**
2+
3+
![Generic badge](https://img.shields.io/badge/Platform-Linux|MacOS|Windows-1f425f.svg)
4+
5+
![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
6+
7+
**Deployments**
8+
9+
[![pypi](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/NetSec/actions/workflows/python-publish.yml)
10+
[![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)
11+
12+
[![Pypi-format](https://img.shields.io/pypi/format/NetSec)](https://pypi.org/project/NetSec/#files)
13+
[![Pypi-status](https://img.shields.io/pypi/status/NetSec)](https://pypi.org/project/NetSec)
14+
115
# NetSec (Network Security)
216
NetSec is a tool to analyze devices connecting to the router and alert accordingly when a new device is connected.
317

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

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

22+
## Kick off
23+
24+
**Install**
25+
```shell
26+
python3 -m pip install NetSec
27+
```
28+
29+
**Initiate**
830
```python
931
from netsec import network_monitor, SupportedModules
1032

1133
if __name__ == '__main__':
34+
# SupportedModules.att # for AT&T users
35+
# SupportedModules.netgear # for any network using Netgear router
1236
network_monitor(module=SupportedModules.att, init=True) # Create snapshot
13-
network_monitor(module=SupportedModules.att, init=False) # Run the scan
37+
network_monitor(module=SupportedModules.att, init=False) # Scan for threats and alert
1438
```
1539

40+
> Notifications will not repeat within an hour.
41+
42+
## ENV Variables
43+
Environment variables are loaded from a `.env` file.
44+
45+
- **ROUTER_PASS** - Router password. _Only for `Netgear` users._
46+
- **GMAIL_USER** - Gmail account username to send and email.
47+
- **GMAIL_PASS** - Gmail account password to send and email.
48+
- **RECIPIENT** - Email address to which `NetSec` alerts should be sent.
49+
- **PHONE** - To send an SMS notification - Example: `1234567890`
50+
1651
## Coding Standards
1752
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
1853
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
@@ -43,6 +78,11 @@ pip install sphinx==5.1.1 pre-commit recommonmark
4378
pre-commit run --all-files
4479
```
4580

81+
## Pypi Package
82+
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)
83+
84+
[https://pypi.org/project/NetSec/](https://pypi.org/project/NetSec/)
85+
4686
## Runbook
4787
[![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)
4888

docs/genindex.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ <h2 id="N">N</h2>
196196
<li><a href="index.html#module-netsec.modules.helper">module</a>
197197
</li>
198198
</ul></li>
199-
</ul></td>
200-
<td style="width: 33%; vertical-align: top;"><ul>
201199
<li>
202200
netsec.modules.models
203201

204202
<ul>
205203
<li><a href="index.html#module-netsec.modules.models">module</a>
206204
</li>
207205
</ul></li>
206+
</ul></td>
207+
<td style="width: 33%; vertical-align: top;"><ul>
208208
<li>
209209
netsec.modules.netgear
210210

@@ -220,6 +220,8 @@ <h2 id="N">N</h2>
220220
</li>
221221
</ul></li>
222222
<li><a href="index.html#netsec.analyzer.network_monitor">network_monitor() (in module netsec.analyzer)</a>
223+
</li>
224+
<li><a href="index.html#netsec.modules.settings.Config.notification">notification (netsec.modules.settings.Config attribute)</a>
223225
</li>
224226
<li><a href="index.html#netsec.modules.helper.notify">notify() (in module netsec.modules.helper)</a>
225227
</li>

0 commit comments

Comments
 (0)