So friends, let's walk through the validation challenge.
The very first thing I have to do is to create a new directory on one of my
managed devices
called forward slash validation hyphen der.
So on my blue box, I will say sudo mk der forward slash validation hyphen der.
Now it has created what I now have to do is to check the SEO Linux security
context information
of this directory.
So I'll say LS dash Z on the root directory.
And now we see the validation der actually has the tag default underscore T. So WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And now we see the validation der actually has the tag default underscore T. So
now back
in my control node, I'm going to have to create a playbook.
So let's call this validation dot ymail going to insert mode have our three hyp
hens at the
top, give the playbook a name and we'll just call this validation one.
Now the host I'm going to target in my case here is just going to be the blue
box or set
gather facts to be false.
And what I'm going to have to do is to write a playbook that uses the rail
system roles
as the Linux role to ensure that the managed device has a Linux to be
configured in the
enforcing modes.
So let me define my vows right here. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So let me define my vows right here.
And I'm going to say se Linux underscore states as to the value enforcing.
So the next thing that I'm going to have to do is to use the same playbook and
use the
role to change the security context type of the validation that directory to be
user
home to you.
So in this case here, I'm going to say se Linux if contexts, and then I'm going
to specify
that my target is going to be forward slash validation hyphen der and then I'll
have
my open parentheses and say forward slash dot asterix.
And then I'll have my question mark and then also the se type which is going to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then I'll have my question mark and then also the se type which is going to
be my label.
And this case here, it's going to be user underscore home underscore T and then
I'll
specify that the file type is going to be a directory.
And then I'll close my color braces.
Now this will be making the modification via se manage.
So what I want to do is I want to use my restore con command, so I'll say se
Linux restore
does and now I specify the directory I want to be restoring.
So it's going to be forward slash validation hyphen der and now it'll specify
my role
that I want to use which is going to be a rail system hyphen roles dot se Linux WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
that I want to use which is going to be a rail system hyphen roles dot se Linux
.
So let's save this playbook and let's give it a run and to enter.
So the playbook completes if we go to our device right now, let's check the new
security
context and as we can see the validation directory has updated its label.
So now the next thing we're going to have to do is to write a second playbook
that is
going to configure firewall D to permit SSH HTTP HTTPS and NP and squared
services.
So what I will do is create a new playbook called validation to dot Y mail. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So what I will do is create a new playbook called validation to dot Y mail.
Let's just target the same host again in my case here.
It's going to be blue box gather facts as false and now let's define my vars
and now
specify the rules so I want to allow SSH HTTP HTTPS and NP as well as squid.
So let's define our tasks.
Let's get this task in name or just the updating firewall config.
Let's use the answerable POSIX firewall D module specify the service we want to
configure
is going to be the item that we happen to be looking through.
So we'll have our double curly braces and the keyword item and we'll specify WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So we'll have our double curly braces and the keyword item and we'll specify
that the
state is going to be enabled and then we want to specify what it is we're going
to
look through.
So we'll have our double curly braces once again and we're going to look to the
variable
rules that we've just defined.
So let's save this and let's try running the second playbook.
So now we make a modification.
If I go to my blue box and I say pseudo firewall dash CMD dash dash list
services and to enter
type in my password and as we can see amongst the services that we have allowed WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
type in my password and as we can see amongst the services that we have allowed
we have
our HTTP HTTPS SNMP squared and SSH services.
So that is us for our validation challenge.
I hope it's been informative for you.
I'd like to thank you for viewing.