<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Josh-T on Medium]]></title>
        <description><![CDATA[Stories by Josh-T on Medium]]></description>
        <link>https://medium.com/@josh.thurston?source=rss-94f70f2c6ba9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*boyNhm22LdPiZZHtMb3Q3A.jpeg</url>
            <title>Stories by Josh-T on Medium</title>
            <link>https://medium.com/@josh.thurston?source=rss-94f70f2c6ba9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 04:20:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@josh.thurston/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Flask User Auth with Neo4j]]></title>
            <link>https://medium.com/swlh/flask-user-auth-with-neo4j-cca79aa90f57?source=rss-94f70f2c6ba9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cca79aa90f57</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[neo4j]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Josh-T]]></dc:creator>
            <pubDate>Tue, 30 Jun 2020 00:36:51 GMT</pubDate>
            <atom:updated>2020-07-08T15:45:19.665Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been working on a Flask App project for the past few months. Tutorial after tutorial and book after book used the combination of Flask with SQLAlchemy to leverage databases like SQLite.</p><p>I chose a different path. Perhaps a harder path. I wanted to build a Flask App with Neo4j as my DB. I discovered that finding documentation on this combo will likely lead you to a variety of blogs, videos, GitHub Repositories <a href="https://nicolewhite.github.io/">created by Nicole White</a>. Nicole created a terrific tutorial, but it’s older now. I couldn’t get it to work because things evolve. At the end of the day I decided to figure this out and post a more up to date and more in depth tutorial.</p><p>Here I’ll give a tutorial covering Flask Setup, User Registration, User Login/Logout, and User sessions.</p><p>Access the project on <a href="https://github.com/josh-thurston/FlaskNeo4jStarter">Github</a></p><h4>Project Setup</h4><p>Create a project folder. Mine is called “BasicApp” for this tutorial.</p><p>I suggest you create a virtual environment for the project.</p><p>If you are using PyCharm you can skip this step. If you are using another editor then create a virtual environment in the BasicApp directory.</p><pre>python3 -m venv venv<br>source venv/bin/activate</pre><p>I use PyCharm for my editor, and find that creating a new project with a virtual environment is much faster.</p><p>Create a new project and make the appropriate selections as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pk7qxrnIZSyAPNWSVLl7cQ.png" /><figcaption>PyCharm Flask Project</figcaption></figure><p>Create the following directory structure</p><pre>BasicApp<br>- data<br>- services<br>- static<br>  - css<br>- templates<br>  - accounts<br>  - home<br>  - shared<br>- app.py<br>- requirements.txt</pre><p>Add the following to requirements.txt</p><pre>py2neo<br>werkzeug<br>flask<br>passlib</pre><p>In the data directory create a file called db_session.py. This is where you will store your Neo4j authentication information. Be sure to enter your unique password and your IP address. If you are running Neo4j locally, enter 127.0.0.1.</p><p>See my previous article <a href="https://medium.com/@josh.thurston/neo4j-installation-e9724a1644f">Installing Neo4j</a> if you need some help</p><p>Add the following to db_session.py</p><pre>from py2neo import Graph</pre><pre>def db_auth():<br>    user = &#39;neo4j&#39;<br>    pword = &#39;YourNeo4jPassword&#39;<br>    graph = Graph(&quot;<a href="http://192.168.1.1:7474/db/data/">http://192.168.1.1:7474/db/data/</a>&quot;, username=user, password=pword)<br>    return graph</pre><p>Next, create a basic CSS design. Everything in this tutorial will utilize the CSS below. You can change and enhance later.</p><pre>body {<br>    margin: 0;<br>    padding: 0;<br>    color: #000000;<br>    font-family: Source Sans Pro, Helvetica, Arial, sans-serif;<br>    font-size: 17px;<br>    background-color: #ffffff;<br>}</pre><pre>.main_content {<br>    background: #ffffff;<br>    margin: 0;<br>    padding: 0 0 50px;<br>}</pre><pre>.topnav {<br>    overflow: hidden;<br>    width: 100%;<br>    background-color: black;<br>    font-size: 14px;<br>    box-shadow: 5px 5px 5px gray;<br>    text-align: center;<br>}</pre><pre>.topnav a {<br>    float: left;<br>    display: block;<br>    color: #EFEFEF;<br>    text-align: center;<br>    padding: 14px 16px;<br>    text-decoration: none;<br>    border-radius: 25px;<br>    border-top: 5px solid black;<br>    border-bottom: 5px solid black;<br>}</pre><pre>.topnav a:hover {<br>    color: white;<br>}</pre><pre>.message h1 {<br>    width: 100%;<br>    padding: 10px;<br>    margin-left: auto;<br>    margin-right: auto;<br>    text-align: center;<br>    font-size: 40px;<br>    font-weight: 800;<br>}</pre><pre>.form-control {<br>    margin-bottom: 15px;<br>}</pre><pre>.form-wrapper {<br>    border: 1px solid gray;<br>    width: 25%;<br>    margin-left: auto;<br>    margin-right: auto;<br>    margin-top: 30px;<br>    border-radius: 10px;<br>    background-color: white;<br>}</pre><pre>.form-label {<br>    padding: 5px;<br>    font-weight: bold;<br>}</pre><pre>form {<br>    padding: 20px;<br>    max-width: 450px;<br>    margin-left: auto;<br>    margin-right: auto;<br>    margin-top: 10px;<br>    border-radius: 10px;<br>}</pre><pre>form .controls {<br>    margin-bottom: 1em;<br>}</pre><pre>input {<br>    margin-top: 15px;<br>    margin-bottom: 15px;<br>}</pre><pre>.actions, h2{<br>    text-align: center;<br>}</pre><pre>.error-msg {<br>    color: red;<br>    font-size: 16px;<br>    font-weight: bold;<br>    padding-top: 5px;<br>    text-align: center;<br>}</pre><pre>footer {<br>    margin-top: 50px;<br>    padding: 30px;<br>    text-align: center;<br>    color: black;<br>}</pre><pre>footer a {<br>    color: darkorange;<br>}</pre><p>I prefer to use template inheritance in my applications. This simplifies and reduces the amount of HTML code you need to write for each page. It also makes it much easier for shared design throughout all of your pages. For more information about Template Inheritance, check out this <a href="https://svn.python.org/projects/external/Jinja-1.1/docs/build/inheritance.html">page</a>.</p><p>Create the base template in BasicApp/templates/shared/_layout.html</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;title&gt;{% block title %}FlaskStarter{% endblock %}&lt;/title&gt;</pre><pre>&lt;link rel=&quot;stylesheet&quot;<br>          href=&quot;<a href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,600italic,700,700italic|Source+Code+Pro:500">https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,600italic,700,700italic|Source+Code+Pro:500</a>&quot;&gt;</pre><pre>&lt;link rel=&quot;stylesheet&quot;<br>          href=&quot;<a href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css</a>&quot;<br>          integrity=&quot;sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO&quot; crossorigin=&quot;anonymous&quot;&gt;</pre><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;/static/css/site.css&quot;/&gt;</pre><pre>{% block additional_css %}{% endblock %}<br>&lt;/head&gt;<br>&lt;body&gt;</pre><pre>&lt;div class=&quot;topnav&quot;&gt;<br>    &lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;<br>    &lt;a href=&quot;/accounts/register&quot; style=&quot;float: right&quot;&gt; Register&lt;/a&gt;<br>    &lt;a href=&quot;/accounts/login&quot; style=&quot;float: right&quot;&gt;Login&lt;/a&gt;<br>    &lt;a href=&quot;/accounts/logout&quot; style=&quot;float: right&quot;&gt;Logout&lt;/a&gt;<br>    &lt;a href=&quot;/accounts/profile&quot; style=&quot;float: right&quot;&gt;Profile&lt;/a&gt;<br>&lt;/div&gt;</pre><pre>&lt;div class=&quot;main_content&quot;&gt;<br>    {% block main_content %}{% endblock %}<br>&lt;/div&gt;</pre><pre>&lt;footer&gt;&lt;/footer&gt;</pre><pre>&lt;script src=&quot;<a href="https://code.jquery.com/jquery-3.3.1.slim.min.js">https://code.jquery.com/jquery-3.3.1.slim.min.js</a>&quot;<br>        integrity=&quot;sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo&quot;<br>        crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js">https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js</a>&quot;<br>        integrity=&quot;sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49&quot;<br>        crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;<br>&lt;script<br>        src=&quot;<a href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js">https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js</a>&quot;<br>        integrity=&quot;sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy&quot;<br>        crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Now create the home page in BasicApp/templates/home/index.html</p><pre>{% extends &quot;shared/_layout.html&quot; %}<br>{% block title %}Home{% endblock %}<br>{% block main_content %}</pre><pre>&lt;div class=&quot;page-title&quot;&gt;<br>    &lt;h1&gt;Home&lt;/h1&gt;<br>&lt;/div&gt;</pre><pre>{% endblock %}</pre><p>Now we need to edit app.py and create our first route to our homepage.<br> <br>Open app.py in the editor. We need to import a couple modules to make sure everything works.</p><pre>from flask import Flask, render_template, redirect, session, url_for, flash, request<br>from data.db_session import db_auth<br>from services.accounts_service import create_user, login_user, get_profile<br>import os</pre><p>We need to make sure that we have our first route setup for the index.html page. Add the following info to app.py</p><pre>App = Flask(__name__)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/&#39;)<br>def index():<br>    return render_template(&quot;home/index.html&quot;)<br>    <br>if __name__ == &#39;__main__&#39;:<br>    app.run(debug=True)</pre><p>At this point, you can run your app and see if everything is working.</p><p>Time to create a registration page, the user Class, and the functions that will connect to the Neo4j database to create the user.</p><p>Add the following to app.py</p><p>You will probably notice that I do something slightly different. I separate my GET and POST methods into separate routes. I learned this in a Python course from <a href="https://blog.michaelckennedy.net/">Michael Kennedy.</a> The idea is to separate the two for a little extra security.</p><p>To help you understand what each of the functions, I added comments below to describe things a little more in depth for you.</p><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/register&#39;, methods=[&#39;GET&#39;])<br>def register_get():<br>    return render_template(&quot;accounts/register.html&quot;)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/register&#39;, methods=[&#39;POST&#39;])<br>def register_post():<br>    # Get the form data from register.html<br>    name = request.form.get(&#39;name&#39;)<br>    email = request.form.get(&#39;email&#39;).lower().strip()<br>    company = request.form.get(&#39;company&#39;).strip()<br>    password = request.form.get(&#39;password&#39;).strip()<br>    confirm = request.form.get(&#39;confirm&#39;).strip()</pre><pre>    # Check for blank fields in the registration form <br>    if not name or not email or not company or not password or not confirm:<br>        flash(&quot;Please populate all the registration fields&quot;, &quot;error&quot;)<br>        return render_template(&quot;accounts/register.html&quot;, name=name, email=email, company=company, password=password, confirm=confirm)</pre><pre>    # Check if password and confirm match<br>    if password != confirm:<br>        flash(&quot;Passwords do not match&quot;)<br>        return render_template(&quot;accounts/register.html&quot;, name=name, email=email, company=company)</pre><pre>    # Create the user<br>    user = create_user(name, email, company, password)<br>    # Verify another user with the same email does not exist<br>    if not user:<br>        flash(&quot;A user with that email already exists.&quot;)<br>        return render_template(&quot;accounts/register.html&quot;, name=name, email=email, company=company)</pre><pre>    return render_template(&quot;accounts/register.html&quot;)</pre><p>Create BasicApp/services/classes.py</p><pre>from py2neo.ogm import GraphObject, Property</pre><pre>class User(GraphObject):<br>    __primarylabel__ = &quot;user&quot;<br>    __primarykey__ = &quot;email&quot;<br>    name = Property()<br>    email = Property()<br>    company = Property()<br>    password = Property()<br>    hashed_password = Property()</pre><p>Create BasicApp/services/accounts_service.py</p><pre>from data.db_session import db_auth<br>from typing import Optional<br>from passlib.handlers.sha2_crypt import sha512_crypt as crypto<br>from services.classes import User</pre><pre>graph = db_auth()</pre><pre>def find_user(email: str):<br>    user = User.match(graph, f&quot;{email}&quot;)<br>    return user</pre><pre>def create_user(name: str, email: str, company: str, password: str) -&gt; Optional[User]:<br>    if find_user(email):<br>        return None<br>    user = User()<br>    user.name = name<br>    user.email = email<br>    user.company = company<br>    user.hashed_password = hash_text(password)<br>    graph.create(user)<br>    return user</pre><pre>def hash_text(text: str) -&gt; str:<br>    hashed_text = crypto.encrypt(text, rounds=171204)<br>    return hashed_text</pre><pre>def verify_hash(hashed_text: str, plain_text: str) -&gt; bool:<br>    return crypto.verify(plain_text, hashed_text)</pre><pre>def login_user(email: str, password: str) -&gt; Optional[User]:<br>    user = User.match(graph, f&quot;{email}&quot;).first()<br>    if not user:<br>        print(f&quot;Invalid User - {email}&quot;)<br>        return None<br>    if not verify_hash(user.hashed_password, password):<br>        print(f&quot;Invalid Password for {email}&quot;)<br>        return None<br>    print(f&quot;User {email} passed authentication&quot;)<br>    return user</pre><pre>def get_profile(usr: str) -&gt; Optional[User]:<br>    # user = User.match(graph, f&quot;{usr}&quot;).first()<br>    user_profile = graph.run(f&quot;MATCH (x:user) WHERE x.email=&#39;{usr}&#39; RETURN x.name as name, x.company as company, x.email as email&quot;).data()<br>    return user_profile</pre><p>Last step for registration is the template with the registration form that will match up with the previous sections.</p><p>Create BasicApp/templates/accounts/register.html</p><pre>{% extends &quot;shared/_layout.html&quot; %}<br>{% block title %}Register{% endblock %}<br>{% block main_content %}<br>    &lt;div class=&quot;main&quot;&gt;<br>        &lt;div class=&quot;form-wrapper&quot;&gt;<br>            &lt;form method=&quot;POST&quot;&gt;<br>                &lt;h2&gt;Register&lt;/h2&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot; Full Name&quot; required<br>                       value=&quot;{{ name }}&quot;&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot; Email&quot; required value=&quot;{{ email }}&quot;&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;company&quot; placeholder=&quot; Company Name&quot; required<br>                       value=&quot;{{ company }}&quot;&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;password&quot; name=&quot;password&quot; placeholder=&quot; Password&quot; required<br>                       value=&quot;{{ password }}&quot;&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;password&quot; name=&quot;confirm&quot; placeholder=&quot; Password&quot; required<br>                       value=&quot;{{ password }}&quot;&gt;</pre><pre>&lt;div class=&quot;actions&quot;&gt;<br>                    &lt;button type=&quot;submit&quot; class=&quot;bt btn-info btn-sm&quot;&gt;Register&lt;/button&gt;<br>                &lt;/div&gt;<br>                &lt;div class=&quot;error-msg&quot;&gt;<br>                    {% if error %}<br>                        &lt;div class=&quot;error-msg&quot;&gt;{{ error }}&lt;/div&gt;<br>                    {% endif %}<br>                    {% with messages = get_flashed_messages() %}<br>                        {% if messages %}<br>                            {% for msg in messages %}<br>                                &lt;p&gt;{{ msg }}&lt;/p&gt;<br>                            {% endfor %}<br>                        {% endif %}<br>                    {% endwith %}<br>                &lt;/div&gt;<br>            &lt;/form&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>{% endblock %}</pre><p>We need to add our Neo4j connection and authentication to app.py. We also need to add a secret key. We will create a login for users in the coming steps. When they login we will use a component from flask called “session”. This establishes a cookie for users so their login session is maintained as they browse from page to page in the application. To get this working, a secret_key must be created to ensure the connection has a unique key.</p><p>Update app.py</p><pre>app = flask(__name__)<br>app.secret_key = os.urandom(24)<br>graph = db_auth()</pre><p>Create BasicApp/templates/accounts/login.html</p><pre>{% extends &quot;shared/_layout.html&quot; %}<br>{% block title %}Login{% endblock %}<br>{% block main_content %}<br>    &lt;div class=&quot;main&quot;&gt;</pre><pre>&lt;div class=&quot;form-wrapper&quot;&gt;<br>            &lt;form action=&quot;&quot; method=&quot;POST&quot;&gt;<br>                &lt;h2&gt;Login&lt;/h2&gt;<br>                &lt;input name=&quot;email&quot; type=&quot;text&quot; placeholder=&quot; Your email address&quot; class=&quot;form-control&quot;<br>                       value=&quot;{{ email }}&quot;&gt;<br>                &lt;input name=&quot;password&quot; type=&quot;password&quot; placeholder=&quot; Password&quot; class=&quot;form-control&quot;<br>                       value=&quot;{{ password }}&quot;&gt;<br>                &lt;button type=&quot;submit&quot; class=&quot;btn btn-danger&quot;&gt;Login&lt;/button&gt;<br>                &lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;</pre><pre>{% if error %}<br>                    &lt;div class=&quot;error-msg&quot;&gt;{{ error }}&lt;/div&gt;<br>                {% endif %}<br>            &lt;/form&gt;<br>        &lt;/div&gt;</pre><pre>&lt;/div&gt;<br>{% endblock %}</pre><p>A good way to check if a user is logged in is to present their User Profile with the information they enter at registration. This will help test a couple things.</p><ol><li>A user is authenticated</li><li>A user is able to access data that is restricted to their user account only.</li><li>A user session is established</li></ol><p>Create BasicApp/templates/accounts/index.html</p><pre>{% extends &quot;shared/_layout.html&quot; %}<br>{% block title %}Home{% endblock %}<br>{% block main_content %}</pre><pre>&lt;div class=&quot;main&quot;&gt;<br>    &lt;div class=&quot;form-wrapper&quot;&gt;<br>        &lt;form method=&quot;post&quot;&gt;<br>            &lt;h2&gt;Profile&lt;/h2&gt;<br>            {% for info in user_profile %}<br>                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot; Full Name&quot; value=&quot;{{ info.name }}&quot;&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;email&quot; placeholder=&quot; email&quot; value=&quot;{{ info.email }}&quot;&gt;<br>                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;company&quot; placeholder=&quot; Company Name&quot; value=&quot;{{ info.company }}&quot;&gt;<br>            {% endfor %}<br>            &lt;div class=&quot;actions&quot;&gt;<br>                &lt;button type=&quot;submit&quot; class=&quot;bt btn-info btn-sm&quot;&gt;Save&lt;/button&gt;<br>            &lt;/div&gt;<br>        &lt;/form&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;<br>{% endblock %}</pre><p>Now that the login page is created, we need to add a route for it.</p><p>Edit app.py and add the following for user login</p><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/login&#39;, methods=[&#39;GET&#39;])<br>def login_get():<br>    # Check if the user is already logged in.  if yes, redirect to profile page.<br>    if &quot;usr&quot; in session:<br>        return redirect(url_for(&quot;profile_get&quot;))<br>    else:<br>        return render_template(&quot;accounts/login.html&quot;)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/login&#39;, methods=[&#39;POST&#39;])<br>def login_post():<br>    # Get the form data from login.html<br>    email = request.form[&#39;email&#39;]<br>    password = request.form[&#39;password&#39;]<br>    if not email or not password:<br>        return render_template(&quot;accounts/login.html&quot;, email=email, password=password)</pre><pre># Validate the user<br>    user = login_user(email, password)<br>    if not user:<br>        flash(&quot;No account for that email address or the password is incorrect&quot;, &quot;error&quot;)<br>        return render_template(&quot;accounts/login.html&quot;, email=email, password=password)</pre><pre># Log in user and create a user session, redirect to user profile page.<br>    usr = request.form[&quot;email&quot;]<br>    session[&quot;usr&quot;] = usr<br>    return redirect(url_for(&quot;profile_get&quot;))</pre><p>Add the following to app.py for the user profile page.</p><p>Note: The profile page is pre-built so that you can add more to the page later on. Ideally you would add additional form fields for users to populate and save. The update piece is not finished out in this tutorial. The page will only present the user profile information that was captured during registration.</p><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/profile&#39;, methods=[&#39;GET&#39;])<br>def profile_get():<br>    # Make sure the user has an active session.  If not, redirect to the login page.<br>    if &quot;usr&quot; in session:<br>        usr = session[&quot;usr&quot;]<br>        session[&quot;usr&quot;] = usr<br>        user_profile = get_profile(usr)<br>        return render_template(&quot;accounts/index.html&quot;, user_profile=user_profile)<br>    else:<br>        return redirect(url_for(&quot;login_get&quot;))</pre><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/profile&#39;, methods=[&#39;POST&#39;])<br>def profile_post():<br>    # Make sure the user has an active session.  If not, redirect to the login page.<br>    if &quot;usr&quot; in session:<br>        usr = session[&quot;usr&quot;]<br>        session[&quot;usr&quot;] = usr<br>        user_profile = get_profile(usr)<br>        return render_template(&quot;accounts/index.html&quot;, user_profile=user_profile)<br>    else:<br>        return redirect(url_for(&quot;login_get&quot;))</pre><p>Next, we need to add the logout function of the app.<br>Add the following to app.py</p><pre><a href="http://twitter.com/app">@app</a>.route(&#39;/accounts/logout&#39;)<br>def logout():<br>    session.pop(&quot;usr&quot;, None)<br>    flash(&quot;You have successfully been logged out.&quot;, &quot;info&quot;)<br>    return redirect(url_for(&quot;login_get&quot;))</pre><p>Ready to test.</p><p>Run the application and visit the page in your browser 127.0.0.1:5000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlWJsy5OL84i19YYO6TwqQ.png" /><figcaption>Home Page</figcaption></figure><p>Register a user and test error handling</p><p>Leave some of the form fields blank to make sure that error messages are prompting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*iHgekZaEe54qDQzPQk5Gmw.png" /></figure><p>Type in two different passwords to make sure that the password confirmation is working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*GcPindeA6GT4Uz1-7v1VxQ.png" /></figure><p>Finish a registration and then login. After login, you should be redirected to the profile page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*pXyOVTSnyheHFMrzxS3OTw.png" /></figure><p>To check that your user session is working, click on ‘Home’ and then go back to ‘Profile’. This should maintain your session and present your profile information.</p><p>Now ‘Logout’ and then click ‘Profile’. This should redirect you to the login page again because you do not have an active session any longer.</p><p>Finally, register another user, but try to use the same email address as you used last time. This should create a duplicate email address error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*DqMjUSRLa7WDxhrpF3q-og.png" /></figure><p>Final item to look at.</p><p>When you are logged into Neo4j from your browser you can look at the user that was created.</p><p>You can check that user passwords are hashed for security purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLZmk9aWJhYvcpChORRjrQ.png" /></figure><p>Hopefully this gets you down the road to creating a new and exciting app with Flask and Neo4j. I will have a lot more to share as I continue my projects</p><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cca79aa90f57" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/flask-user-auth-with-neo4j-cca79aa90f57">Flask User Auth with Neo4j</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Neo4j Installation]]></title>
            <link>https://medium.com/the-kickstarter/neo4j-installation-e9724a1644f?source=rss-94f70f2c6ba9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9724a1644f</guid>
            <category><![CDATA[neo4j]]></category>
            <dc:creator><![CDATA[Josh-T]]></dc:creator>
            <pubDate>Mon, 29 Jun 2020 21:32:51 GMT</pubDate>
            <atom:updated>2020-07-01T17:32:52.745Z</atom:updated>
            <content:encoded><![CDATA[<p>I started programming about two years ago. I quickly progressed through numerous Python books, videos, and tutorials in my first year. I think it may be a natural progression, but I suddenly needed a place to store data. You know, a database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3iRG-EFmHrAR25xa9zu-A.png" /><figcaption>Image Source <a href="https://miro.medium.com/max/2670/1*3wVYz3cetZqy2GughF9Obw.png">https://miro.medium.com/max/2670/1*3wVYz3cetZqy2GughF9Obw.png</a></figcaption></figure><p>I don’t know why, but I felt reluctant to learn SQL for some reason. To this day (1 year later) I don’t know why I chose this path. Friends and colleagues have told me I chose the harder path, but at the end of the day I think my brain works more like a graph database. It almost seems like I had a Red Pill vs Blue Pill situation, and people are telling me I chose the wrong pill. I’m pretty happy with my selection…</p><p>To spread the knowledge, I’ll give you a quick install guide for Neo4j. This is a primer piece for my upcoming article that will cover building a Flask App with Neo4j as the DB. The article will specifically cover user authentication and session management. A topic that I found very little guidance for. Tutorials, videos, and blogs seemed to be out of date or overly complex.</p><h3>Installation</h3><p>Running your database locally may be an appealing option. I travel at times and want to do some work while I am on the road. So, running Neo4j on my MacBook is a must. Here is the install which is super simple. Not really worthy of a tutorial.</p><p>Download the desktop application and install. <a href="https://neo4j.com/download/">link</a></p><p>When I am at home I work with several Neo4j DB instances. So, I run a hypervisor with several Ubuntu VM’s that run Neo4j.</p><p>Here is Neo4j install on Ubuntu</p><p><strong>Prerequisites</strong></p><p>- Ubuntu 18.04<br>- Access to Ubuntu Terminal or Shell Console (SSH)</p><p><strong>Install Steps</strong></p><ol><li>On Ubuntu server run</li></ol><pre>Sudo apt update</pre><p>2. Install Java and verify install</p><pre>Sudo apt install openjdk-8-jdk<br>Java --version</pre><p>3. Update the package repository to add Neo4J.</p><pre>sudo wget -O - <a href="https://debian.neo4j.org/neotechnology.gpg.key">https://debian.neo4j.org/neotechnology.gpg.key</a> | sudo apt-key add -</pre><pre>sudo echo &#39;deb <a href="https://debian.neo4j.org/repo">https://debian.neo4j.org/repo</a> stable/&#39; | sudo tee -a /etc/apt/sources.list.d/neo4j.list</pre><pre>sudo apt-get update</pre><p>4. Install Neo4J and verify install</p><pre>sudo apt install neo4j<br>Neo4j --version</pre><p><strong>Configuration for accessing the database</strong></p><ol><li>Edit the Neo4J config file</li></ol><pre>sudo nano /etc/neo4j/neo4j.conf</pre><p>2. Locate the following line and un-comment the line to allow connections from any IP address. If you only have a specific IP that you want to allow, enter that IP address only.</p><pre>dbms.connectors.default_listen_addres-0.0.0.0</pre><p><strong>Neo4j Service</strong></p><ol><li>Start|Stop|Restart Neo4J</li></ol><pre>Systemctl {start|stop|restart} neo4j</pre><p>2. Check status of the service</p><pre>Service neo4j status</pre><p><strong>Connecting to Neo4J</strong></p><p>1. Web Browser [IPAddress]:7474<br>2. Enter credentials. Default is neo4j neo4j<br>3. Change password on the first logon</p><p><strong>Note:</strong> You may need to restart the service before you are able to connect for the first time.</p><p>Pretty simple right? That’s all for now. Catch a more in depth tutorial in my next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9724a1644f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-kickstarter/neo4j-installation-e9724a1644f">Neo4j Installation</a> was originally published in <a href="https://medium.com/the-kickstarter">The KickStarter</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beats on Raspberry Pi & a Side of ELK]]></title>
            <link>https://medium.com/swlh/beats-on-raspberry-pi-a-side-of-elk-c25f7006ee45?source=rss-94f70f2c6ba9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c25f7006ee45</guid>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[pivpn]]></category>
            <category><![CDATA[pihole]]></category>
            <category><![CDATA[openvpn]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Josh-T]]></dc:creator>
            <pubDate>Mon, 28 Oct 2019 01:41:43 GMT</pubDate>
            <atom:updated>2019-10-28T14:25:17.974Z</atom:updated>
            <content:encoded><![CDATA[<p>Mixing Beats with Raspberry Pi and ELK sounds like a Martha Stewart recipe that went wrong. Probably something she would create with Snoop in effort to hide his veggies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*dDsFhlADJyke8515EjtbCA.jpeg" /><figcaption>Is that ELK? <a href="https://i2.wp.com/peopledotcom.files.wordpress.com/2016/10/martha-stewart-snoop-dogg.jpg?crop=0px%2C0px%2C2000px%2C1500px&amp;resize=660%2C495&amp;ssl=1">src</a></figcaption></figure><p>Well I’m no Martha Stewart and I definitely don’t have the celeb status to hang with Snoop Dogg. — Whats up Snoop, if your reading this.</p><p>Nope, this is about <a href="https://www.elastic.co/">Ealstic.co</a> <a href="https://www.elastic.co/products/beats">Beats</a> data shippers and setting them up on <a href="https://www.raspberrypi.org/">Raspberry Pis</a>.</p><p>Over the past six months I have been on a non stop exploration and learning journey. It began with Python and that led into mini projects for the house. All of the sudden I have five Raspberry Pi units and I am working through one project after another. As I expanded my tinkering I wanted to start capturing logs for all the devices in my home network for monitoring, fun, and learning. I work in InfoSec after-all, logs are sorta my thing.</p><p>Elastic became an obvious go to option for my home lab needs. I setup my ELK stack (Elasticsearch, Logstash, Kibana) quickly, and I even wrote a nice script I call <a href="https://github.com/josh-thurston/easyELK">easyELK</a> to simplify the setup. I was on cruise control logging my firewall, Mac devices, Windows devices, and Ubuntu Servers in ELK. Then, I discovered Elastic doesn’t release and maintain Beats for arm architecture. You’re Killing me Smalls!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*4hZt7GsCdNix4QVkfMt56g.png" /><figcaption><a href="https://media.phillyvoice.com/media/images/Sandlot.74ea818d.fill-735x490.png">src</a></figcaption></figure><p>I searched for a workaround and spent hours going through numerous blogs, discussion threads, and videos, but none of them worked. They were either outdated or beyond my skillset. Many of them seemed to be very manual and left room for error. I was at a slight disadvantage because I only know Python which doesn’t require you to compile code. All the research I was doing led back to GOlang and compiling code. Did I mention this all started on a learning journey? Challenge accepted! I consolidated my notes and set out to create my own solution… <a href="https://github.com/josh-thurston/easyBEATS">easyBEATS</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*dKvsF46KXw4hzFOyibkkwg.png" /></figure><p><strong>Hardware: </strong>Raspberry Pi 3b+, 4</p><p><strong>Software: </strong>Raspbian, Beats 7.3.2</p><p>You want to get your ELK stack up and running first. If you don’t have this complete, check out my easyELK project mentioned earlier. Make sure that you have all your dashboards and index patterns loaded. easyBEATS wont handle that for you, but easyELK will.</p><p>I think that GOlang is great, except for setting GOPATH. It is a mind bender and a source of frustration for a noob. I kept mine with the default settings on my Raspberry Pi. $HOME/go is used through the entire script. The Go Workspace directories are created by easyBEATS.</p><pre>mkdir $HOME/go <br>mkdir $HOME/go/bin<br>mkdir $HOME/go/pkg<br>mkdir $HOME/go/src<br>mkdir $HOME/go/src/github.com<br>mkdir $HOME/go/src/github.com/elastic<br></pre><p>There are some dependencies that need to be covered. I threw in a couple ‘if’ statements to check for them and reduce manual prep work.</p><pre>if [ $(dpkg-query -W -f=&#39;${Status}&#39; python-pip git 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 0 ];</pre><pre>then</pre><pre>echo &quot; -&gt;Installing python-pip git...&quot;</pre><pre>apt-get install python-pip git -y;</pre><pre>elif [ $(dpkg-query -W -f=&#39;${Status}&#39; python-pip git 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 1 ];</pre><pre>then</pre><pre>echo &quot; -&gt;python-pip git is installed&quot;</pre><pre>fi</pre><pre>echo &quot;Checking for virtualenv...&quot;</pre><pre>if python -c &#39;import pkgutil; exit(not pkgutil.find_loader(&quot;virtualenv&quot;))&#39;;</pre><pre>then</pre><pre>echo &quot; -&gt;virtualenv is installed&quot;</pre><pre>else</pre><pre>echo &quot; -&gt;Installing virtualenv...&quot;</pre><pre>pip install virtualenv</pre><pre>fi</pre><pre>echo &quot;Checking for Make...&quot;</pre><pre>if [ $(dpkg-query -W -f=&#39;${Status}&#39; make 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 0 ];</pre><pre>then</pre><pre>echo &quot; -&gt;Installing make...&quot;</pre><pre>apt-get install make -y;</pre><pre>elif [ $(dpkg-query -W -f=&#39;${Status}&#39; make 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 1 ];</pre><pre>then</pre><pre>echo &quot; -&gt;Make is installed&quot;</pre><pre>fi</pre><pre>echo &quot;Checking for GCC...&quot;</pre><pre>if [ $(dpkg-query -W -f=&#39;${Status}&#39; gcc 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 0 ];</pre><pre>then</pre><pre>echo &quot; -&gt;Installing GCC...&quot;</pre><pre>apt-get install build-essential manpages-dev -y;</pre><pre>elif [ $(dpkg-query -W -f=&#39;${Status}&#39; gcc 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 1 ];</pre><pre>then</pre><pre>echo &quot; -&gt;GCC is installed&quot;</pre><pre>fi</pre><pre>echo &quot;Checking for Go...&quot;</pre><pre>if [ $(dpkg-query -W -f=&#39;${Status}&#39; golang-go 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 0 ];</pre><pre>then</pre><pre>echo &quot; -&gt;Installing Go...&quot;</pre><pre>sudo apt-get install golang-go -y;</pre><pre>go version</pre><pre>echo &quot; -&gt;$(tput setaf 6) Go is installed$(tput sgr0)&quot;</pre><pre>elif [ $(dpkg-query -W -f=&#39;${Status}&#39; golang-go 2&gt;/dev/null | grep -c &quot;ok installed&quot;) -eq 1 ];</pre><pre>then</pre><pre>echo &quot; -&gt;Go is installed&quot;</pre><pre>fi</pre><p>Now it’s Go time. Yes pun intended. Time to use Go to git the source code and make the new arm versions of Filebeat, Packetbeat, Metricbeat, and Auditbeat.</p><p>Why do I have a variable BEAT_VERSION? Because it makes it much easier to manage the going forward. Each release Beats has a commit code. Once you know where to get the commit code, you can plug that into easyBEATS and you don’t have to update a whole bunch of links. The code is to the left of the release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*F0m-Ukpk9gZTUxkstWVcdA.png" /><figcaption><a href="https://github.com/elastic/beats/releases">https://github.com/elastic/beats/releases</a></figcaption></figure><pre>BEAT_VERSION=”5b046c5&quot;<br>cd $HOME/go/src/github.com/elastic<br>go get github.com/elastic/beats | tee -a $log<br>cd beats<br>git fetch<br>git checkout $BEAT_VERSION | tee -a $log</pre><p>I also learned that compiling can eat up a good amount of resources. I decided to temporarily enable and utilize swap space to ease the compiling process along.</p><pre>sudo fallocate -l 2G /swapfile<br>sudo chmod 600 /swapfile<br>sudo mkswap /swapfile<br>sudo swapon /swapfile</pre><p>I also realized that it would be a good idea to check the version of the arm chipset. easyBEATS will run a check using lscpu to determine what arm version to build (arm or arm64). Well that was a fun learning experience too. Check out <a href="https://en.wikichip.org/wiki/arm/versions">WikiChip</a> for some assistance. Now that the architecture is set we download the source code and compile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gA0CnMVdxwbjTWZqeLPyA.png" /><figcaption><a href="https://compile-shop.com/wp-content/uploads/2017/12/logo_couleurs.png">src</a></figcaption></figure><pre>cd $HOME/go/src/github.com/elastic/beats/filebeat<br>if [ $(lscpu | grep -c “armv7”) -eq 1 ];<br>then<br>GOOS=linux GOARCH=arm go get;<br>make;<br>elif [ $(lscpu | grep -c “armv8”) -eq 1 ];<br>then<br>GOOS=linux GOARCH=arm64 go get;<br>make;<br>fi</pre><p>Moving right along, literally, create the directories and move the files into place, enable the service, set the permissions, and have everything ready for final config. The last part requires manual work. Configure each of the Beats modules as needed and start the service.</p><pre>sudo mkdir /usr/share/filebeat<br>sudo mkdir /usr/share/filebeat/bin<br>sudo mkdir /etc/filebeat<br>sudo mkdir /var/log/filebeat<br>sudo mkdir /var/lib/filebeat<br>sudo mv $HOME/go/src/github.com/elastic/beats/filebeat/filebeat /usr/share/filebeat/bin<br>sudo mv $HOME/go/src/github.com/elastic/beats/filebeat/module /usr/share/filebeat<br>sudo cp $HOME/go/src/github.com/elastic/beats/filebeat/filebeat.reference.yml /etc/filebeat<br>sudo mv $HOME/go/src/github.com/elastic/beats/filebeat/modules.d/ /etc/filebeat/<br>sudo cp $HOME/go/src/github.com/elastic/beats/filebeat/filebeat.yml /etc/filebeat<br>sudo cp $HOME/beats_arm/filebeat_files/fields.yml /etc/filebeat<br>sudo cp $HOME/beats_arm/filebeat_files/LICENSE.txt /usr/share/filebeat<br>sudo cp $HOME/beats_arm/filebeat_files/NOTICE.txt /usr/share/filebeat<br>sudo cp $HOME/beats_arm/filebeat_files/filebeat.service /lib/systemd/system<br>sudo chmod 700 /var/log/filebeat<br>sudo chmod 755 /etc/filebeat/<br>sudo chown -R root:root /etc/filebeat<br>sudo chown -R root:root /usr/share/filebeat/*<br>sudo /bin/systemctl daemon-reload<br>sudo systemctl enable filebeat<br>sudo swapoff -v /swapfile<br>sudo rm /swapfile</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*SpDD38a2Iiw3SCVoR_ZrbQ.png" /><figcaption><a href="https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/9bb6af9d-9be0-4819-9fab-d9bdfb65ac89/d1qfu6k-228ca20b-f74f-40bd-9c53-8581ee92bce8.png?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcLzliYjZhZjlkLTliZTAtNDgxOS05ZmFiLWQ5YmRmYjY1YWM4OVwvZDFxZnU2ay0yMjhjYTIwYi1mNzRmLTQwYmQtOWM1My04NTgxZWU5MmJjZTgucG5nIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.1rIG2bSyxvmbrImC0gbhwQ239DtVZAVJfZQlGDS9z-I">src</a></figcaption></figure><p>I learned a lot about Elastic products through this project. My bash scripting skills went up a couple notches and posting my project on GitHub was exciting. I didn’t calculate the number of hours spent on the project, but I estimate 60 hours learning, testing, and perfecting the script to make it repeatable. It was a lot of fun and I feel like I appreciate the Open Source spirit much more.</p><p>Two additional applications I also came across were pivpn and <a href="https://github.com/pi-hole/pi-hole">Pi-Hole</a>. I originally setup Pi-hole on an Ubuntu server because I wanted to use <a href="https://github.com/nin9s/elk-hole">elk-hole</a> for logging. This gave me more reason to get Beats working on my Raspberry Pi. After creating easyBEATS, I was able to move Pi-Hole over to my Raspberry Pi and use elk-hole to ship the logs over to my ELK stack. Not sure how many birds that is, but one stone… . You get the point.</p><p>Hopefully you found this interesting and at minimum discovered that a solution to create Beats packages for Raspberry Pi does exist. You don’t need to work through the learning curve and fight all the frustration I had. If you want to use easyBEATS or contribute to the code visit my GitHub repo. Send me some ideas and I will be happy to try and help create another ‘easy’ solution with you.</p><p>Check these links out:</p><p>- <a href="https://github.com/josh-thurston/easyBEATS">easyBEATS</a><br>- <a href="https://github.com/josh-thurston/easyELK">easyELK</a><br>- elk-<a href="https://github.com/nin9s/elk-hole">hole</a><br>- <a href="https://github.com/pi-hole/pi-hole">Pi-Hole</a><br>- <a href="http://www.pivpn.io/">pivpn</a><br>- <a href="https://docs.pi-hole.net/guides/vpn/dual-operation/">Pi-Hole + OpenVPN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c25f7006ee45" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/beats-on-raspberry-pi-a-side-of-elk-c25f7006ee45">Beats on Raspberry Pi &amp; a Side of ELK</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[SIEM]thing is Wrong!]]></title>
            <link>https://medium.com/swlh/siem-thing-is-wrong-d5274b305dd8?source=rss-94f70f2c6ba9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5274b305dd8</guid>
            <category><![CDATA[opsec]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Josh-T]]></dc:creator>
            <pubDate>Tue, 18 Jun 2019 22:58:57 GMT</pubDate>
            <atom:updated>2019-06-21T19:59:53.981Z</atom:updated>
            <content:encoded><![CDATA[<p>Congratulations, you’ve setup your SIEM and you instantly have a single pane of glass for security operations and incident response! Not really.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCDht_P6v7BEeAsjObx3UA.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@goumbik?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Lukas </a>from <a href="https://www.pexels.com/photo/agriculture-backyard-blur-close-up-296230/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>There may have been a time period in the past where that term, ‘single pane of glass’, was closer to reality, but it just isn’t a term that should be used these days. Unfortunately, it’s very likely that security will never have a single pane of glass due to the technology growth in the industry. There are too many technologies and platforms that ultimately become data sources, and the SIEM offerings of the world can’t consume all of the data. Each data source has the potential to hold valuable information or clues that security analysts need for their investigations. However, there are more fundamental problems with SIEM implementations across the globe that have less to do with the product and more to do with implementation.</p><p>It’s <strong>not</strong> always the user and it’s <strong>not</strong> always the product.</p><p>Presumably, the leading reason for users misgivings around SIEM is usually unspoken. Technology vendors don’t want to offend a customer by telling them that they failed to setup correctly. Customers are limited on budget and want to a make their technology investment a success, but they are thinking that the product should simply perform. The solution is for both parties to come together and combine product expertise with organizational knowledge. In many instances, the SIEM is technically installed correctly but the configuration and adaptation to the unique environment and security team capabilities is lacking. Product expertise can only cover so much ground and the gap is in the fundamental understanding of turning Noise into Signal. Technology vendors don’t know the capabilities of the customer or the lay of the land. If only there were a process to follow and alleviate the stalemate. The negative outcomes of a poor SIEM implementation are endless, and the user is the victim. Users often times look at a SIEM dashboard and can’t tell what is good vs bad or true positive vs false positive. Screen fatigue plagues security analysts because they spend too much time manually sifting through events to stitch together. After their research, they rarely document what events were valuable and take the critical next step of continuous improvement because they don’t have time or even worse, context.</p><p>Think about most of the major security breach reports in the media over the last decade. Time and time again the victim has security tools in place and sometimes met compliance or regulations such as PCI-DSS. Did any of the security vendors take the blame and state that their product failed to meet promised expectations? I can’t think of a single instance. The flaw was the security team didn’t see the event or have the context to understand if the event(s) were malicious. The signal was lost in the noise and in some cases the signal was never even collected.</p><p>Sec Ops management will eventually witness their security analysts hunting for events to investigate. The analysts will probably make mental notes of events that were false positives or outright useless. Detection times will be slow and response times even slower. Soon, realization sets in that there isn’t a clear indication of success over time. It is very hard to prove that the team is able to increase the security baseline and getting better at security when the team is drowning in noise.</p><p>After several technology rollouts and onboarding of data sources in the SIEM, the problem still isn’t solved and decisions must be made.</p><ul><li>Dump the SIEM and buy a new one</li><li>Hire more experienced analysts</li><li>Train existing analysts</li><li>Quit and go where the grass is greener</li><li>Dig in, review and enhance Process</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnXzkxNVMIZbgTE-x-j7ZA.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@goumbik?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Lukas </a>from <a href="https://www.pexels.com/photo/agriculture-backyard-blur-close-up-296230/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>Time to Dig In!</p><p>Is it plausible that any NFL Football team won the Super Bowl without a playbook? Zero chance that has happen or ever will happen. The playbooks are the key to offensive and defensive strategy. They align the team and prepare them to identify and respond to the opponent for every conceivable play. Even more importantly, the playbook design is built around the team and individual players capabilities.</p><p>The same is true for security operations. Playbooks are critical in order to build an effective security operations and incident response team. Create playbooks, AKA, runbooks, and begin to explore the data required to perform a tactical investigation for each playbook. This is a critical first step in preparing a SIEM to run the way it is intended. The value in features such as correlation, enrichment, threat intelligence feeds, and asset risk scoring are all more achievable after separating signal from the noise. Don’t think on those features in the early stages. More importantly, those valuable features typically align to the last two steps of the process, Insight and Action. The key to SIEM is to understand what capabilities the security team wants or needs and then gather the right data to fulfill the capability.</p><p>Just to make sure I haven’t lost you. Here are a couple key takeaways so far.</p><ol><li>Create playbooks for incident response.</li><li>Don’t pull in data from everything in the environment</li><li>Understand the technology in the environment and what types of data exist in each technology</li><li>Enhance the process</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*fGIIDjGw0UgofNr_Fe5Bfg.png" /></figure><p>Throughout the process review and enhancement you will be working with data that is used for analysis. Defining what data is needed to fulfill the capability can be difficult without understanding tactical and technical analysis.</p><p><strong>Tactical Analysis </strong>should be the story.</p><ul><li>Why did this event happen?</li><li>What has happen?</li><li>Who is the adversary / target?</li></ul><p><strong>Technical Analysis </strong>should be the pieces that make up the story.</p><ul><li>When did it happen?</li><li>Where is the source and destination?</li><li>How was it done?</li></ul><p>All too often security teams setup a SIEM and begin gathering logs from anything they can get their hands on. While the intent is good in nature, the execution and the process are lacking and negatively affect the outcome because it is too much noise. Also, many security teams focus on implementing tools, such as a SIEM, to identify security events, but often forget to prepare for response and metrics. Capabilities are about detecting and responding. Responding to a security incident is only possible if the security team can collect the right technical data and reveal the story through tactical analysis. Separating the signal from the noise and building insight or context is the virtual bridge from technical analysis to tactical analysis. There is a process for this too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*6LT8Ep2owAVu1SGrTcHqJA.png" /></figure><p>The OODA loop should become a core concept in security investigations and should be used in data selection too. More Info about the OODA Loop <a href="https://en.wikipedia.org/wiki/OODA_loop">link</a></p><p><strong>OODA</strong></p><ul><li>Observe</li><li>Orient</li><li>Decide</li><li>Act</li></ul><p><strong>Observe</strong> events and behaviors that may indicate the adversaries motives — takedown, theft, establish access, control.</p><ul><li>Example: Inbound Apache Web Server Exploit from a remote IP address.</li></ul><p><strong>Orient</strong> is gathering situational awareness, insight, or context. This is achieved through data enrichment, correlation rules, normalization, additional data sources, and organizational knowledge.</p><ul><li>Example: The destination is an Apache server. No signs of service takedown, theft, or unauthorized access. The remote IP address is tied to various events every month. It shows to be related to a vulnerability scanning service.</li></ul><p><strong>Decide</strong> involves validation, scoping, and criticality assessment of the event.</p><ul><li>Example: The Apache server is vulnerable and it is a critical asset that drives revenue. The exploit event is tied to monthly vulnerability scanning activities by the organization.</li></ul><p><strong>Act</strong> is simply responding at the right time with the right resources while considering the outcomes of acting now or later.</p><ul><li>Example: This event is not an attack. Report the event and request Apache is patched OR enable blocking by a countermeasure such as Network IPS if a patch cannot be installed in a reasonable timeline. Monitor the vulnerable asset until a patch or tuning is complete. Ensure an exploit attempt is not made from any other source IP addresses.</li></ul><p>With an understanding of the adversaries motives and the OODA loop, it is time to start mapping capabilities and filtering data.</p><p><strong>Capability Examples:</strong></p><ul><li>Malware</li><li>Data Exfiltration</li><li>Remote Exploit Attempts</li><li>Credentials Compromise or Misuse</li><li>Denial of Service</li></ul><p>To articulate this further, I’ll use malware as the example, but this can be applied to almost any capability. Remember to break the data into chunks that align to capabilities. Be sure to document and understand what technologies are in the environment. Soon, it will be easy to map each of the technologies (data) to the signal, insight, and action phases.</p><p><strong>Example — Malware Detection and Response Technologies:</strong></p><p><strong>Note: </strong>Below is a brief list of technologies using generic names. The ability to detect malware depends on the technology vendor. The ability to consume data into a SIEM may depend on the SIEM and/or the technology vendor as well.</p><ul><li>Endpoint Threat Prevention</li><li>Web Proxy</li><li>Network IPS</li><li>Firewall</li><li>Endpoint Detection &amp; Response (EDR)</li></ul><p>It is time to start the process of separating Signal from the Noise.</p><p>In the SIEM, create a dashboard that only shows events from the data sources that support the capability (ex. Malware). The wording and configuration of the dashboard may vary depending on the technology vendor (SIEM &amp; Data Source).</p><p>Consider creating dashboard tiles based on the following criteria or groupings. These should assist in separating events quickly.</p><p>Tile 1 — Events by data source</p><p>Tile 2 — Events by event name, summary or description</p><p>Tile 3 — Events by result type (Block, delete, quarantine fail etc.)</p><p>Tip: It will be useful to have the ability to drill into an event and see the event details.</p><p>Using this basic dashboard, work through the events one by one. The goal is to review and categorize each event so that future decisions can be made based on the usefulness of the event in supporting the capability.</p><p>Separate the events into the following groups:</p><p><strong>Noise</strong> — The event provides no assistance in detecting a malicious event (malware).</p><p><strong>Context </strong>— The event may not aid in detecting a malicious event, but it may provide context about an event.</p><ul><li><strong>Example</strong> — A firewall event showing a successful outbound connection was allowed. This type of an event may not prove a malicious activity has taken place. If, for example, a piece of malware was successfully executed on an endpoint AND performed an outbound connection to a remote IP address… The firewall event should provide context about the remote IP, Port, Protocol. The endpoint technology may only capture the name of the file and show the detection was made, but failed to handle the potential threat. A correlation rule could be useful to identify a malware detection and not handled around the same time a callback connection is made to a remote IP.</li></ul><p><strong>Signal — </strong>The event shows malicious activity and the threat was handled or the event shows malicious activity and the threat was not handled.</p><p><strong>Research</strong> — The event shows activity that needs to be validated. Expect tuning of policy as a result.</p><ul><li><strong>Example — </strong>A Network IPS event for IIS 5.0 Server. Research to see if the company has any IIS 5.0 servers running. This will help determine signal and true positive / false positive.</li></ul><p><strong>Operational</strong> — The event shows activity that is only useful to the deployment or operational health.</p><ul><li><strong>Note:</strong> The structure of the security team will be a factor in deciding if these events are important. Security teams who have separate engineering and analyst teams vs engineers are the analysts. Either way the events need to be separated.</li><li><strong>Two Examples</strong>:</li><li>Scheduled Scan Completed</li><li>Update complete</li></ul><p>Document the events so that future security team members have a written history of why specific events were kept or dropped.</p><p>Capture the event name, description, and ID for any event that is related to Malware.</p><ul><li>Cleaned</li><li>Deleted</li><li>Quarantined</li><li>Would be blocked</li><li>Failed to clean</li><li>Failed to delete</li></ul><p>Any event that is noise should be dropped from the SIEM. Two approaches for this.</p><ul><li>Configure the data source to stop sharing the event with the SIEM</li><li>Configure the SIEM to drop / delete the event once it is received</li></ul><p>Create a watchlist for Malware events, this should be all events related to malicious events (handled &amp; not handled). Add all the events to this watchlist.</p><p>If the security team wants to keep operational events in the SIEM, create a watchlist with all the ID’s related to operational health events.</p><p>Create a dashboard for Malware (this is a capability driven dashboard now). The security team may have a preference in what dashboard elements are used.</p><p>Create alarms for events where response is necessary. Ex. Failed to clean, delete, quarantine</p><p>Now the signal is separated from the noise for the use case.</p><p>Repeat for all the capabilities in the security team. Some may be harder than others, so start with the low hanging fruit like malware, rogue device detection, phishing and build up to more complex capabilities like fileless malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zsHeug0WFqHbgpIMSE6yGg.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@geralt?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Gerd Altmann </a>from <a href="https://www.pexels.com/photo/marketing-school-business-idea-21696/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>Topics for another day… Correlation, enrichment, asset risk scoring, integrations, metrics that matter and all of the features that support insight and action.</p><p><strong>Additional Thoughts</strong></p><p>You may be wondering why we want the malware handled event…</p><p>The SOC and the overall security team must determine if they are getting better at security monthly, quarterly, annually etc. A quick start point in understanding is to measure events, create a continuous improvement loop, and gain insight into the effectiveness of the changes.</p><p><strong>Example Scenario:</strong> Endpoint protection events are high and don’t always require response. The SOC should aim for a level of maturity where they respond and eradicate quickly (24 hours or less) as a top priority. Analyzing handled events is important because they can reveal other indicators of attack or compromise. Each set of events should start a continuous improvement effort by tuning policies and ensure everything is up to date on product and DAT versions. Analyze the number of malware events that required response over time and aim to decrease.</p><p>How much did the policy tuning and the updating process improve the number of events that were handled vs not handled?</p><p>Are response times getting faster?</p><p>How many samples were detected on multiple systems?</p><ul><li>Look at the trending / normalization data and compare standard deviation over months quarters etc.</li></ul><p>What else can be done to improve? Enhance detection at the perimeter and practice a defense in depth strategy? Could SSL decryption be enabled and broaden the scope of traffic analysis? Could a SaaS proxy technology or always on VPN strategy be used for devices in the field and practice a scalable defense in depth strategy?</p><ul><li>If yes, then deploy products, tune the products, enable features like SSL decryption, forced proxy, integrate tools and aim for scalability.</li></ul><p>How much did the defense in depth and scalability strategy improve the overall malware detection?</p><ul><li>Examine the trending and see if malware detections at the perimeter are trending up and endpoint trending down.</li><li>Create a dashboard element to show system IP addresses at the time of detection. Sort the data to show detections for systems off of the company LAN. Did the mean time to detect improve? Did the detection shift from endpoint to another countermeasure?</li><li><strong>Note</strong>: Setup network zones in the SIEM to enhance metrics by zone. It will provide extra insight into areas of the organization that are higher in activity and may require tweaking.</li></ul><p>Are the malware handled events useful?</p><ul><li>Yes, just because the malware was handled doesn’t mean the work is done.</li></ul><p>Use these events to extract additional information and be proactive. Identify the source IP, URL, domain, hostname, user, mail sender, removable media etc. Remember the tactical and technical analysis? Malware that is handled still has a story.</p><ul><li>Analysts should research each of these observables and determine the root cause of the malware event.</li></ul><p>What can be done to prevent future malicious activity?</p><ul><li>Block a remote IP</li><li>Block a mail sender</li><li>Block a URL</li><li>Block a domain</li><li>Investigate and remediate an internal host</li><li>Block autorun on removable media and force an on access scan when media is connected</li><li>Identify a bad actor</li></ul><p>With all of the activity in tuning and improving there should be a couple significant outcomes. The event volume in the SIEM should go down considerably. The meaningful events should be more clear and actionable. The start point for measuring effectiveness has been established. The health of the SIEM (performance in events per second) should be in a better state. A new set of questions and procedures for the investigation can be adopted and built upon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5274b305dd8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/siem-thing-is-wrong-d5274b305dd8">[SIEM]thing is Wrong!</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three Keys to a Successful SOC]]></title>
            <link>https://medium.com/the-kickstarter/three-keys-to-a-successful-soc-8839a197d916?source=rss-94f70f2c6ba9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8839a197d916</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[opsec]]></category>
            <dc:creator><![CDATA[Josh-T]]></dc:creator>
            <pubDate>Mon, 13 May 2019 18:50:58 GMT</pubDate>
            <atom:updated>2020-07-01T17:32:16.489Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXgOkF0FghetBLs9QmSbIw.jpeg" /></figure><h3><strong>| VISIBILITY | CAPABILITY | AUTHORITY |</strong></h3><p>I speak with a considerable number of organizations about their security program and the tools they are using to protect their organization. I want share my thoughts on three areas that security teams are rarely prepared to discuss. I feel these three items are critical to maturing security teams and security operations centers (SOC).</p><p>Security is not all about the technology that the team implements. The security tools market is massive and it continues to grow. The success or lack of success doesn’t come down to the brand or feature otherwise we would have a very small security tools market consisting of a select number “silver bullets”. The success of a tool implementation, in many scenarios, is dependent on the deployment, configuration, and usage. I believe the leading factors in selecting tools often times come down to price, the sales team, brand loyalty, and reviews from industry analysts. The most successful security teams are not built on the cheapest products, best in breed products, and rarely work like that fancy demo. I like fancy PowerPoint presentations too, but it goes like the golf saying “Drive for show, putt for dough”. You can see the best presentation or hear the greatest sales pitch ever, but if you can’t implement a product and align to your process than it won’t help you win. Security teams rarely find success in buying the brand name or using products because they have always liked the brand (fanboys). Successful teams are built on mature processes, procedures and metrics that matter.</p><p>Security teams and security operations centers come in all shapes and sizes. Time management, security awareness, patching, vulnerability scanning, and publishing company policies factor into the success of any security team. But there should be a starting point for building and breeding success. I start with three keys that are intertwined with just about every aspect of security in an organization.</p><p><strong>Visibility</strong></p><p>Does the security team have visibility to the information and assets inside the organization to effectively protect, detect, and correct a security incident? Ask a CISO what their mission is and they will tell you they manage risk, compliance, prioritize the company security requirements, and their team mitigates security incidents. Every single part of their mission requires visibility in the organization.</p><p><strong>Note:</strong> I realize there is much more to the mission, but I am siding with brevity for the moment.</p><p>How can the security team identify a threat targeting an asset if they don’t have network visibility. Simple access to information like Netflow will enable the SOC to analyze and understand communications between assets on the network. Visibility to the communications lead into visibility to assets and gaining an understanding of what is managed, rogue, BYOD etc. A security team cannot easily protect what they don’t know about! Unknown assets cause longer investigations and limit situational context. Do the SOC a favor and tackle asset and device identification early for them. There are many ways to approach identifying assets, segmenting assets, building an asset inventory and discovering new assets.</p><p>Set a goal to gain visibility to network traffic and begin understanding the assets on the network. Gain visibility into common connections (IP, Port, Protocol, times) that the devices are establishing on the network. This visibility will help build the security team baseline.</p><p><strong>Example Scenario:</strong></p><p>Identify database servers and gain understanding of the IP addresses that connect to the databases. Once the IP addresses are vetted, identify the port/protocol. After you know the common connections and the times, you will be able to identify anomalies. If a new device with an abnormal IP address suddenly connects to a database the SOC should have this visibility and be prepared to investigate. It may be more obvious if that abnormal IP is attempting to connect on a different Port or protocol.</p><p>Laptop in LAN with an IP in DHCP scope attempts to connect to SMB on port 445 to an MS SQL server that normally has connections from static IP addresses in LAN on port 1433.</p><p><strong>Capability</strong></p><p>SOC capability questions I ask typically result in blank stares and tilted heads. The question I ask “What capabilities does your SOC have?” One of my measures for maturity starts with that one question. I try to understand what the SOC is equipped to do. If the team doesn’t have the capability to detect a random IP in DHCP scope establishing a non standard connection to a database server, then it tells me a lot about the maturity of the team. My questions do reveal some information about security tools, but the answer I am looking for should include process, playbooks, and metrics.</p><p>Think about the following questions:</p><ol><li>Does your security team or SOC have the ability to protect, detect, and correct malware events that are successful and unsuccessful?</li><li>Does your security team have a process for all malware events?</li></ol><ul><li>Malware detected and blocked, cleaned, quarantined</li><li>Malware detected and failed to block, clean, quarantine</li></ul><p>3. Does your security team measure malware events?</p><ul><li>Blocked, cleaned, quarantined</li><li>Failed block, clean, quarantine</li><li>Blocked at perimeter vs blocked on endpoint</li><li>Number of detections per filename/ hash</li><li>Total number of detection trending over time with standard deviations. This week is xx% lower than previous xx weeks…</li></ul><p>4. Does your security team understand where they detect malware? Perimeter, zone, workstation, server, etc…</p><ul><li>Blocks on servers compared to user devices</li><li>Blocks at workstations vs NIPS or web proxy</li></ul><p>5. Does your security team have a continuous improvement process to increase or strengthen defenses?</p><ul><li>Blocks on workstations but not at perimeter, go enhance perimeter detection via policy or better technology</li></ul><p>These are just a handful of questions for just one of many capabilities. These questions should lead into developing or refining process, policy, procedures, measurement, and build on gaining visibility.</p><p>Sadly I believe that organizations are buying products / tools and they believe that fulfills capability and the mission stops when the deployment is complete — ish. Why, lack of time, resources, skill, and maturity.</p><p><strong>Authority</strong></p><p>Providing a security team with visibility and establishing capabilities will get you to the goal line, but you cannot cross the line unless you give them authority. I see security teams crumble and live in a state of defeat more than I want. Imagine performing an investigation and all details lead to a true positive and require quick response, but the SOC can’t access the asset or make emergency changes. SOC teams need the ability to stop an attack.</p><p>An analogy to consider. A person is shot and emergency responders are dispatched.</p><ul><li>What if the authority to call emergency responders (911 for many countries) was limited. Helping those in need would be slower and dramatically lower in volume.</li><li>What if the emergency responders didn’t have authority to clear traffic using lights and sirens? The time to respond and provide care would be higher and lives would be lost.</li><li>What if the authority to triage the patient wounds was not provided to emergency responders? If medical care was limited to doctors and nurses in a physical emergency room and responders were only tasked with transporting the patient, then lives would be lost.</li><li>What if the authority to perform CPR on a patient who stops breathing at the scene of the crime or during transportation to the emergency room? Again, lives would be lost</li><li>What if the authority to rush a patient into an emergency room and bypass other patients sitting in the waiting room? Lives would be lost</li></ul><p>SOC teams might not be saving a human life in the literal sense, but not having the authority to respond to a security threat can have devastating impact to the business. This happens every day and the results are published in the media frequently. Work on establishing playbooks with process and procedures that dictate how, when, and to what extent the SOC team has the authority to effectively respond.</p><p>When you combine these keys together you have a recipe for success in building and maturing a security team.</p><p>1. Give the authority and capability to isolate devices on the network when security teams have visibility to identify suspicious and malicious events and rogue devices.<br>2. Give the authority and capability to change policies and rules in security tools to stop an attack that was discovered through visibility to suspicious and malicious events.<br>3. Give the authority and capability to access assets and thoroughly investigate suspicious or malicious events that are detected (through visibility).<br>4. Give the authority and capability to access information about the assets in the environment so the team can build context, prioritize. and a deeper understanding during an investigation.<br>5. Give limited but necessary authority and capability to disable accounts, shutdown services, or shutdown systems in the network to stop suspicious or malicious events that are detected (through visibility).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8839a197d916" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-kickstarter/three-keys-to-a-successful-soc-8839a197d916">Three Keys to a Successful SOC</a> was originally published in <a href="https://medium.com/the-kickstarter">The KickStarter</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>