So enough of looking at visualizations now with a test of DB, let's use a real data source.
First one will be a more secure data source will also need to install a collective it and then we can
install a dashboard.
OK, so what we can do is get ourselves a dedicated MySchool server, don't use an existing production
server, but now we can create one using the digitalization coupon from earlier.
Or you might have a different cloud provider set up.
OK.
So looking at the diagram so far, Karana server might want to take you to a profanities because it
has an IP address.
I have ports 84 for three and actually twenty two as well.
For site, we've been playing around with a test data DB data source.
We're now moving on to the mosque, your data source, which is one of many.
So I'm going to install a mosque, our server first, then install a collector that collect will then
prepare tables in a time series format that we can use in Havana.
OK, so first thing, let's go to your server.
I mean, digitalization, I'm going to create new droplet.
Many cloud providers will have a specialized database option.
I'm not going to do that.
I'm just going to create a droplet.
I'm going to install Ubuntu 20 minimum spec and I'm going to manually install my SKU on to that.
OK, so Ubuntu twenty basic $6 a month I can put anywhere.
I like Amsterdam, for example.
I'm going to use my key.
I already have one.
You can use a password if you want.
I'm going to call it my school.
Like that crate droplet?
OK, so that's the IP address I've been given, that's a public IP copy that I'm now going to set that
up in party.
That's what I use, for instance.
So IP address and there I'm going to call it my secure.
I'm going to set the authentication, my private key because I'm using this as HK method and I'm going
to change my parents to be larger font because it's hard to say otherwise.
OK, before I open that, I'll just save that.
OK, so my school, there it is there so I can open that up.
This is my new mask, your server.
I'm logging on as root.
There we go there.
So root at my school, this is another server.
So I've got two servers now microfinance server at that IP address, and I like your server at that
IP address.
It's going to update my documentation.
They would go.
Very good.
I need to have open port twenty two and three three zero six, but more about that after.
OK, first thing you normally do when you get anybody, server is update the app to so it knows about
the latest packages.
OK, now we're going to install my civil servant to that server, so sudo apt get install Mike, your
server.
Now we go now.
Precious, OK, now I'm creating a brand new Mike your server.
I don't want to use a production server just yet.
I can do that later, so I recommend not using our production server.
Just use something that we can experiment with and then delete when you're finished with it.
OK, that's done.
Next thing I'm going to do is run this command here.
This is a tool that we can use to make sure our SQL server is locked down in a secure manner.
Presenter, I'm not going to use the validate password option because I'm just teaching here.
I want the password to be nice and simple.
If you want really super complicated passwords, press us for this.
I'm just going to press no, because it will create problems while learning.
So any other key for no end?
For example, I'm just going to create a default password and that is just password S.W.O.R.D..
Nothing complicated.
Remove anonymous users.
Yes, this allowed root remotely.
Yes.
Remove test database.
Yes.
Reload privilege tables.
Yes.
All done.
That's ready.
Let's check its status.
Very good active running.
Now it's important to know what version you just installed so that you can run Moscow Hyphen Capital
V like that?
Version eight That's important to note because we'll use it at the moment.
Okay, so we don't have this server, Moscow server and that's my IP address.
Your IP address is going to be different.
Next thing I'm going to do is I need to install a collector.
All data sources will have some kind of collection process going on, preparing data from the end data
source and saving it into a format that Safana can quickly retrieve from.
That will usually be a table of some sort that contains rows with a timestamp and one or more values.
OK, so for this mosque, your data source, there are several options that we can choose from.
I'm going to use a dashboard and collected that you can get from the Griffon Dashboards website.
OK, so the dashboard I'll use will be the popular my two simple dashboard from this link here.
So open that this is the Carvana dashboard page we scroll down.
I have my school data source selected from this list of many, and it's this one here to my school simple
dashboard.
There are several others that you can try out, but I always found this one to be the best.
OK, so there's some sample images here of what it will look like when we're finished.
OK.
Its dependencies are minimum Gryffindor 8.1.2, and we use these visualizations down here.
Now this dashboard requires a specific collector, and you can see that written here in the reviews
section down here.
You must use a collector from there.
So I have a link to that also.
So the collector will be from here.
That's the collector will install.
It's on GitHub, and I'm using version eight, so I'll need to download this script to my to underscore
it.
Well, if you're using version five of my show, then download that script.
So on my documentation, I've prepared a get command here.
You can copy that, and that's downloading the mod to underscore skill on my MySchool server.
Right click space.
OK, so you get rule GitHub user, etc. My collector master my two ideas key will enter and that's downloaded
100 percent through fast.
We need to edit that file.
So Sudo Nano or use nano for that.
Nano is a text editor for Linux Ciudadano.
My two ideas cool.
Now we scroll down.
What it's actually doing is creating a database called Meitu.
It will create some tables in that database where it will store statistics about your server.
And these are the commands that will create and run if you are good at school, you might find this
very informative.
But if you don't know a skill, then you don't really need to know this to understand professional.
But what the collector is essentially made from is a store procedure which will collect daily stats.
And it will run every 10 minutes now, right at the end.
We need to uncomment these last three lines.
We need to create a user called my two hat.
That's a wild card for this server identified by anything you like.
This is the password.
I'm just going to keep it simple.
I'm asking, you use the word password.
Grant all that means all permissions on my two dot star, which means all the tables in the Meitu database
to the user.
My two at wild card this server, because the my two user is going to be querying global statistics
about the MySchool server.
It also needs to have select permission on the Performance Schema database or tables to my two same
user.
Now this is all about the collector, so control X to save that.
Yes.
What I've just done was installed the script for the collector.
When we run the script, it will credit stored procedure.
It will run every 10 minutes running a command called Show Global Status and store that data into a
table, know time series fashion so that we can do that using Gravano.
Now, the last three lines we on commented were about creating this user called my two just to you,
and it has a grant select permission on everything in performance schema.
We don't need to run that script.
We can run that script using Morse code.
Also copy that line just there and on your server.
Mike will run my to you will present a case that's just run that mask your script that we just edited
using nano and it would have created a new user.
We can now open a mike your prompt and do some simple tests.
So just type mask.
You'll like that enter and it should present you with a mask for a prompt that greater than sign with
the mosquito.
That's the mask you are prompt.
We can now start typing still commands.
So the first one will do show databases, they show databases, and we have several databases on this
as your server.
The new one we discredit from the script is called Mitu has several tables that our collective will
be using, and Gravano will be reading from this also the performance schema type that already exists
on the MySchool server.
But we've created that my to user, which can read from the performance schema and summarize information
into the My two table so that my two user and the My two table are named the same thing.
But just be aware that this is the database called Mitu.
And there's a user that we also created a Code White with select permissions on the performance schema.
OK, now part of what's important about the collector is that Eskimo will use an event scheduled to
run that every ten minutes a copy that line pasted in show variables where verbal name equals event
scheduler, if it says on that is good.
If it says off like it used to in the older versions of Moscow, then would have to do some things to
enable it.
We don't have to do that.
OK, so the next line?
Let's have a look at some information about our users in our database.
Select host user from my shoulder user.
OK, so we have some in-built users, the scale we use and we also have our own one that we credit who
my to, then my to is the specific user that the collective will use to read that performance schema
and summarize it into the my two that will query and Bafana.
OK, next, let's look at the Martu database.
So use my to what else switching to the My two database, it's to show tables.
Finished with a semicolon.
OK, so there's two tables in it called current status.
The collector will be saving data into those two tables, so let's see what there is now.
Select all from current and use with a semicolon and there's some data there, so I can do the same
thing.
Select all status.
There we go.
And there's some data now, too.
Now, if you want to exit the mosque, you are prompt just Typekit like that.
So we're back into the normal Ubuntu bash prompt now.
OK, that's very good.
We now have the collector running and this sort there.
We can now go into Safana and try and set up a data source.
It's not going to work completely, but it's good to see what kind of problems will have so that we
know how to fix them.
OK, so intifadah, I'm going to go down here to configuration data sources, and I'm going to add a
data source.
Scroll down until I find my skill to select.
OK, so this is a lot of test out a DB, but instead this is about connecting to a mosque yourself.
So the host will be the IP address of mosque your server call and three three zero six the IP address.
What's that?
OK, so hosts call and three three zero six.
Now, these things aren't going to work initially, but we'll just show you what those problems are.
Be the database that I'll be connecting to will be called two.
Now that's the database that we just created.
One that script and our collector will be saving data into that Meitu database.
The user that will use is called Griffon with a password.
I'm going to keep it simple.
I'm going to use the word password and I can see that if I click this, so that's the simple password
I'm using, you can use something a lot more complicated.
OK, now this user doesn't yet exist on our Eskil service will create that.
Also, depending on where you got your Eskil server from and how we've installed it, we won't be able
to connect on Port three three zero six, but we'll get into that also.
So let's just save and test and see what we get.
OK, so data source updated.
But we got a problem.
Connecting to the server will resolve that.
OK, so several things to do.
So one of those is to create a user called Crafar on that server.
Now I'm creating a new user because it's advised to sacrifice.
Gryffindor does not validate the query to site.
So queries can contain any Haskell Simon, for example, use on the database or drop tables, or do
any other malicious thing and use Carafano as a vector.
So what you do is you create a specific user with minimum permissions, for example, select only on
a specified database and tables that you want to query.
So I could also use the my two user, but the my two user has advanced permissions because you can also
read from the performance schema table and also insert data.
So I'm creating a specific user code Bafana with only select permissions and select permissions on all
the tables in the two database.
So first thing will do is create a user.
So going back onto our MySchool server when my MySchool server, I'm going to log back into the mosque
will prompt.
So type in Mike.
You will enter like that and will create a user, so create use Agraféna at identified by password.
Now we need to know what the IP address is.
All biography on a server.
So I'm replaced that day and the IP address of Mega-fauna server is this value that I saved earlier.
OK, so I'm creating a new user called Griffon at that IP address, so that will be used for connecting
to the mosquito server from Mega-fauna server.
And that's the username that Mike will expect.
And that's the password I'm using is very simple.
Just password.
And that's the password that I entered here before.
OK, so identified by password presents.
So we have a new user.
Now I'm going to select on that user to all the tables in the Meitu database so that user 2FA at one
for two.
OK, so a line that can finally use it to read all the tables in the Meitu database present to flush
privileges.
And before we go, we can verify that user exists by typing in select host use for my skill user.
And then we go, we have a new user called Crafar.
Now that's the host that it will be connected.
So quit now.
That's not all the problems solved yet, but try connecting again to see what error we get now in the
data source.
So save and test data source updated.
But we still have a problem now.
By default, when you install MySchool, it won't allow external connections.
So my server that IP address isn't able to connect to the running module process.
OK, so to allow remote connections, we need to open the MySchool configuration file that will use
that command.
Sudo Nano ADC Moscow my positive.
Scroll down and add this section here.
This will bind Moscow to all IP addresses on your server thing, the external IP address, as well as
localhost because right now, by default, it's only bound to local host cases a that control x y vious.
Enter now to restart was.
Copy that.
Sudo service module restart.
OK.
Let's check its status.
Right, good active running control to get out of that.
Now if we try again to connect using the Moscow data source, it should be a case saving test database
connection.
Okay, so when connecting to external data sources, you are going to have lots of different issues
related to connectivity and permissions.
So on my my SQL server, I have an IP address.
I have ports.
Twenty two and three three zero six already open.
I'm using unrestricted Ubuntu server with no port blocking by default.
So three three zero six works already.
I've created a user called Raphinha at the IP address of my grandfather's server because that's how
a school is going to see the connection.
I've also bound my school two zero zero zero zero so that it also binds to the external IP address.
Now, if you're using any other cloud provider, Port three three zero six will probably also need to
be opened in your security group settings.
However, you do this in your cloud provider.
I didn't need to do that.
What my digitalization server because it's already open by default.
OK, so that's good.
We can get out of that now.
If we go to the Explore tab, just click that and select the Moscow data source at the top.
We will now be able to run queries on that.
My two table now, the Moscow Query Wizard here is quite hard to understand at first, so instead go
straight into the ESCO option.
If you're familiar with SQL, that statement will make some sense to you.
But anyway, I'm not going to run that.
What I want to run is this section here, so copy that and replace that and now run query.
And there we go.
We start to get some data.
So we're reading data from my two dot status where variable name equals threads connected in order by
time ascending.
We don't have to really understand what's going on there yet, but you will understand that I don't.
Anyway, that just verifies that we're connecting to the Moscow database through the Moscow data source.
The next part is about creating the dashboard so dashboards manage.
We're going to import a dashboard.
We're going to import the dashboard from Gravano.
OK, so back on the Giffen Labs website or to Moscow, a simple dashboard, there is an ID just to get
this dashboard.
So copy that to clipboard seven nine nine one.
Go back into this graph on a page here.
Type in the ID or paste and load.
OK, so it's found to MySchool Simple Dashboard Folder General.
We could create around folders if we want it, so I'm not going to do that.
Select a default data source being Moscow and now import.
OK, so we now have an import the we've just downloaded from Safana, which is built specifically for
that collector that we just installed and set up in Moscow.
And we've created the users.
We've opened the appropriate ports.
We've made the appropriate changes to Moscow to allow the external connection, and we can now start
getting data now to collect runs every 10 minutes.
So we're not going to see a real lot for now.
Every 10 minutes, there'll be a new update to these graphs.
So what I'll do is pause my recording and come back in an hour and we'll see some more data written
here about our Moscow seven.
Excellent.
OK, so my Moscow data source that's going to be running for about two and a half hours.
Set that to three hours.
So see it.
OK, so also note that my database server that I just installed isn't working very hard.
It's not a production server, so there isn't really much to see here.
It's not working hard at all.
Anyway, with each of these visualizations, we can look into those and inspect them a little more to
see what they are.
For example, I can press eight on these threats and errors here, and if I scroll up, that's the query
that California is using, which is worth being aware of.
There are two queries running in here and be threads connected threads running a few other particular
properties from the data source that we see on the one single graph, so you can see how that is put
together.
Another thing here where a graph has been hard coded to 180 days, despite me expecting three hours
up there.
So if I edit that one and if I click query options, I can change that 180 days to be two days.
For example, there is in two days of data, so it's still not that interesting to see, but I could
apply that now, says last two days.
There's another one down here last 14 days.
This is a heat map and will become more interesting as it fills up.
Let's change that to two days.
As well, just to see.
OK, so apply that so it's now showing two days, this will look more interesting when it's been running
for many days and especially if it was actually a production mosquito database used by our website or
other application anyway.
So I hope you can see from all that that setting up a dashboard is actually a very complicated process.
We will set up many dashboards.
The mosquito was the first one.
There'll be more as we go across.
Important thing about setting up dashboards and Crafar is that you need to consider that the graphic
on a server is going to have potentially privileged access to the end data source you're connecting
to.
So you need to manage permissions and security so that Rafah now can't be used as a vector to steal
data or even destroyed data.
So that was important that I had set up appropriate uses and permissions and IP restrictions, which
leads me on to setting up IP tables rules now for my server on three three zero six.
Since I don't have a dedicated firewall on my server, I'm going to manage access to ports three three
zero six using IP tables.
OK, so I'm on my MySchool server.
I'm just going to type in IP tables five and there are no dedicated rules on these, so I'm going to
create one four three three zero six.
So if I scroll to the bottom there IP Table's input source or Farner ESP code dot net, that's my server
destination ports three three zero six accept.
So what this rule will do is accept incoming connections to this server from a server with the IP address,
sacrifice code dot net supply into that, and if I do iptables l again, it has updated that domain
name to be the actual IP address.
So I could have actually just type the IP address in there, but it doesn't matter.
You can type the domain of your grip on a server or the IP address of it.
That is my IP address and that is my domain anyway.
The other thing I should drop all other connections to ports three three, three six.
Like that?
IP tables?
OK, now check that IP tables l OK.
So I'm accepting connections to ports three three zero six.
It's four place step with Moscow just there automatically and dropping everything else.
So the only server that can remotely connect to my Moscow server is microphone a server.
So these are things you should consider now with the username.
It's especially important that that user that is connecting to the server has only read any permissions
so that I can't do escalated commands such as drop database, drop table or read data from tables on
the database.
So these are things to consider.
Anyway, this was a long video, a lot of steps involved in getting a more secure data source to work.
I'm using one kind of dashboard that's called the Mike two simple dashboard.
You will find other the dashboards for Moscow throughout the incident, and they'll all have a different
process for setting them up.
You can create a whole set up yourself.
But this example has shown that it's quite a large jump in skill.
You need to have some very good Moscow knowledge to be able to create a dashboard from the ground up
for a more secure server, and that is the same for any data source you connect to.
So that's why it's important understand that Gryphon doesn't actually exist by itself.
Despite that, refineries actually promoted as a magic tool for everything, getting it to work properly
does require in-depth knowledge of the data source that you're connecting to.
Anyway, we'll move on to other data sources, and that will start to make more sense now.
If you didn't understand all the things in this video doesn't matter, you have the video forever.
It's a long video, and you can move on to other data sources and come back to that when you've had
some time away from it.
Excellent.
In the next few videos, we'll do some more Moscow examples.
Excellent.