Security Flashcards

1
Q

In terms of server security, what is the very most basic thing that you must do first?

A

Disable root access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you see who has been attempting to access your server?

A

sudo cat /var/log/auth.log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are five key ways to improve security?

A
  • SSH (instead of user/pwd)
  • Firewalls
  • Updates
  • Two factor authentication (can be worked around)
  • VPN (a wall between the internet and the intranet)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a zero day?

A

An unpatched vulnerability that the company has not found or documented yet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

There is a software that will auto-update your software, what is it called?

A

unattended-upgrades

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a firewall?

A

A network security device that monitors incoming and outgoing network traffic decides whether to allow or block specific traffic based on a defined set of security rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does nmap do?

A

It runs over a list of IP addresses and checks for open ports. You can run this on any IP address and see exactly what they are running, including versions, on each port.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a port?

A

It is a communication endpoint that maps to a specific process or network service.
Specifying the port allows you to say exactly where you want the information to go.
Every port that is open to the internet is a vulnerability that can potentially be exploited. Best practice is to keep as few ports as possible open.
For example, if you have the web server (like nginx) running on port 80, and the app server (eg. express) running on port 3000, you do not need port 3000 to be open to the internet. All traffic should go to port 80 and then be redirected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Command line: How can I see the standard ports on ubuntu?

A

less /etc/services

We usually use ports above 2000 or 3000 so that we don’t mess with the standard ports you can see in this doc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are iptables?

What is a simpler way to do what they do?

A

Ways of routing, blocking or denying requests to certain ports.
UFW - uncomplicated firewall (it lets you think about denying/blocking/allowing things in terms of services (like ssh or https, rather than ports).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between deny and reject?

A

Deny blackholes requests, i.e. it doesn’t respond. Generally you want to blackhole requests.

Reject returns a package with the message that the port is closed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why do you have to be very careful when working with iptables/ufw?

A

Because you can totally lock yourself out of your server. If you close port 22 (ssh port) then there is no way that you can get back in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the three things that you can do with a file?
How do we control this?
How can we see who is allowed to do what with a file?

A

Read, write, execute.
Permissions.
ls -la

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Command line: how do we change permissions for a file/directory to:

a. everyone can do everything
b. owner and group can read, write, execute. Everyone else can read.
c. owner and group can read, write, execute. Everyone else can read & execute.
d. owner can read, write, execute. Everyone else can read & execute.

A

a. chmod 777 filename / chmod -R 777 dir
b. chmod 774 filename / chmod -R 775 dir
c. chmod 775 filename / chmod -R 775 dir
d. chmod 755 filename / chmod -R 755 dir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

With permissions, what is the group?

A

In my case, the group is probably only sudo. Need to read up on this.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Command line: How can you download something from a webpage?
*Why not just use apt install?

A

curl -sL https://whatever.site/setup.sh
– be careful with this, bc you have no idea what you are downloading, so don’t download and run scripts!!

*apt install will get you the stable version, if you want the latest version you have to go get it yourself.

https://explainshell.com/
site that explains what your shell commands do.

17
Q

Command line: how would you update all global packages?

A

sudo npm update -g