Saturday, February 13, 2021

SAN Switch - Disabling the Telnet service on Brocade SAN switches - STIG finding

 

SAN Switch - Disabling the Telnet service on Brocade SAN switches

Disabling the Telnet protocol on Brocade SAN switches

By default, telnet is enabled on Brocade SAN switches. As part of security hardening of the devices it need to be disabled. In order to implement the change, you have to modify IP Filter policy to disable inbound connectivity to tcp port.

1. Login to your SAN switch
2. By default, IP filter policy can not be changed, so first clone the default policy.
> ipfilter --show
                2              any         tcp          23           permit

> ipfilter --clone Block_Telnet_ipv4 -from default_ipv4
> ipfilter --clone Block_Telnet_ipv6 -from default_ipv6
> ipfilter --show

3. Now, you have to remove the existing rule to permit connectivity on tcp service port 23.
   Run ipfilter-show to find out the current rile number which permits the connectivity.

> ipfilter --delrule Block_Telnet_ipv4 -rule 2
> ipfilter --delrule Block_Telnet_ipv6 -rule 2

4. Now, add rule to deny inbound connectivity to the fabric switch on tcp service port 23
> ipfilter --addrule Block_Telnet_ipv4 -rule 2 -sip any -dp 23 -proto tcp -act deny
> ipfilter --addrule Block_Telnet_ipv6 -tule 2 -sip any -dp 23 -proto tecp -act deny

5. Now, save and apply the policy
> ipfilter --save Block_Telnet_ipv4
> ipfilter --save Block_Telnet_ipv6
> ipfilter --activate Block_Telnet_ipv4
> ipfilter --activate Block_Telnet_ipv6
> ipfilter --show

you should see
2              any         tcp          23           deny

So, in summary
> ipfilter --show
> ipfilter -clone Block_telnet_23 -from default_ipv4

> ipfilter -delrule Block_telnet_23 -rule 2
> ipfilter -delrule Block_telnet_23 -rule 2 -sip any -dp 23 -protp tcp -act deny

> ipfilter -save Block_telnet_23
> ipfilter -activate Block_telnet_23

> ipfilter --show

Git - Survival Commands - Become zero to Hero - git in 5 minutes

 

git - survival commands - become zero to hero - git in 5 minutes

 git survival commands - zero to hero

Terms to understand
Working Directory
 - The directory where you will be creating, modifying files or directories.
Staging area:
 - The location where files are ready to be saved (Committed). First files are stored in staging area and then we commit.
Repo:
  - Files/direcotries that are saved/committed. It can be local or remote repo.
  - Local repo is your local PC, and remove it like github, gitlab.

OK, Lets get started ...

1. Open account on github

2. download git bash or MobaXterm and install it
   # yum install git
   $ git version

3. Open your program and initilize git
   $ mkdir gitws; cd gitws
   $ git init
   .git dir is created which contains config info

4. Add your identity so that you can download/upload your files
   $ git config --global user.name "Sam"
   $ git config --global user.email "sam@linuxtab.com"

5. Add your remote repo
   $ git remote add origin <URL-TO-GitHub>

6. Pull the content or update your local repo with remote to sync
   $ git pull

7. To select or to go to a particular branch
   $ git checkout <branch_name>
   $ git checkout ws_task2
   $ git checkout master    # you can switch between the branches

8. Create a new branch and switch to it to make changes to the contents
   $ git checkout -b <branch_name>
   $ git checkout -b <ws_task3>
   $ cat > index.html
     Welcome to the club !!!

4. Show the status if there is anything changed/modified at staging area.
   $ git status

5. Add changed contents to the staging area
   $ git add <file or dir>
   $ git add mydir
   $ git add index.html
   $ git add .     # add everything

6. Save any changes make to the file in your branch. This is commit area.
   $ git commit -m <Detail what is changed>
   $ git commit -m "initial changes are made for login module"
   $ git commit -m "My first commit" index.html
   $ git log index.html    # shows all version of file with commit id
   $ git help log  # get help on subcommand
   $ git show commitid    # shows the detail log
   $ git diff commit_id_1 commit_id_2    # show the difference in two versions
   $ git ls-files

7. Switch to your master (origin) branch
   $ git checkout master

8. Lets merge the branch ws_task3 with master
   - All the changes in ws_task3 will be added to master (fast forward merge)
   $ git merge ws_task3
   $ git branch -d ws_task3    # remove the branch you created

9. Push the change to your remote repo
   $ git push -u origin <branch name>