Linux Security PAM Flashcards

1
Q

Describe the three fields/columns in system-auth

Where are the modules located (SO FILES)

A

Management group/module interface, control flag, module (SO file) used, module parameters or arguments (like close)

session required pam_selinux.so close

Module (so files)
/lib/security
lib64/security

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

What are the files for located in /etc/pam.d?

A

You’ll see files labelled like
atd
setup
sudo
These are how these processes/applications authenticate

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

Module interfaces/management groups

A

Authentication (auth) - Verifies user identity (like checking password or secret)

Account - Checks if specified account is valid (Is it enabled, expired, allowed to login, has service access)

Password - used for updating password, works with authentication, enforce strong passwords

Session - actions performed at beginning and end of session

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

Control Flags

A

Requisite - Strongest flag - If module interface flagged requisite and fails PAM returns to calling app and reports the failure. Return value is associated with first requisite or required fail.

Required - In case of failure, execution isn’t stopped and continues to next module. Afterword it will return with failure

Sufficient - If this module succeeds and no prior required module has failed, this returns a success. If fail, this is ignored and moves on through stack

Optional - Not based on success or failure, but rather something like, if you have a home directory fine, if you don’t then build one.

Include - include all lines of given type from the configuration file specified as an argument to this control (if file is specified in the third column use this

Substack - same as above

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

Modules

A

/lib64/security
These can provide mechanisms to authenticate users from any backend like a file /etc/passwd or database like openLDAP

pam_unix is the main module used to verify authentication

if you want to know more about modules look at their man page
man pam_unix

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

Module Arguments

A

Anything extra you want to add in

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

How are pam options read?
Check if program is pam-aware (uses pam for authentication)

A

From the top down
You can’t have optional before required
ldd /usr/sbin/sshd | grep pam
ldd /sbin/sshd | grep pam

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

What is PAM
and why was it created

A

Pluggable Authentication Module
Allows applications to authenticate in different ways

When a new authentication method is made, all services would need to be recompiled (bio-metrics, smart-card, etc)
Pam negates this by always being the one stop shop to tell services how to authenticate

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

If you just have pam_deny on its own, what does it do?

A

Rejects the login or whatever it’s there for but it doesn’t report anything. You’ll need a different entry before it.

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

Two ways to configure pam

A

/etc/pam.conf <- This is like putting everything into one file

/etc/pam.d <- better for each individual service

pam.conf will be ignored if pam.d exists

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

If a service/program doesn’t have a config file then what will it consult?

A

/etc/pam.d/other

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

What happens if you configure pam wrong?

A

It won’t let you log in

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

Where does PAM send its activity info to?

A

/var/log/secure
/var/log/messages

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

Where do you go to tell the system where to go for internal services?

A

/etc/nsswitch.conf

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

How does a normal log in work?

A

/etc/passwd checked for user
/etc/shadow used for user password

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