Operating System Security 1 Users UNIX user username

  • Slides: 36
Download presentation
Operating System Security 1

Operating System Security 1

Users • UNIX user -> username -> uid – uid is systems real name

Users • UNIX user -> username -> uid – uid is systems real name for user – integer 0. . . 65536 (varies in some systems) – mapping is in /etc/passwd shimeall: *: 5003: 20: Tim: /users/shimeall: csh • More than one username may map to a uid – Desired for some system purposes (program tracking) – Problem for ordinary users (confused file ownership) – Security problem (hacker makes duplicate uid account) • Temporary uid change: su 2

Groups • User - one or more groups • Group - zero or more

Groups • User - one or more groups • Group - zero or more users – – Used for file permissions Defined by /etc/groups and network sharing software ypcat group. byname gid - integer system name for group (generally unique) • Listed for individual users with groups • Change group of file with chgrp – chgrp newgroup myfile 3

SETUID and SETGID • Special mechanisms: temporarily use a uid or gid during the

SETUID and SETGID • Special mechanisms: temporarily use a uid or gid during the execution of a program) • Part of mode bits – s in user x field - setuid – s in group x field - setgid • To be effective, both s and x must be set – chmod a+x myprog – chmod u+s myprog – chmod 4755 myprog • WARNING: Lots of subtle security holes! 4

Dangerous Accounts • root – superuser • open, guest, play, nobody - courtesy accounts

Dangerous Accounts • root – superuser • open, guest, play, nobody - courtesy accounts • Accounts without passwords • uucp, sync, pspq - single-command accounts • Group accounts 5

User Policy • Restricting access – – – commands file access login times network

User Policy • Restricting access – – – commands file access login times network access terminal access • Inactive users – – Detection Password change Locking (change shell) Deletion (after backup) • Ultimately - need multilevel security 6

Multilevel Security • Users with different needs to know sharing computer or network •

Multilevel Security • Users with different needs to know sharing computer or network • If don’t need to know – shouldn’t even be able to determine if information exists • Should be able to filter functionality based on allowable information • Mandatory and Discretionary protections 7

Monitor Model • General Schema: – Takes user's request. – Consults access control information.

Monitor Model • General Schema: – Takes user's request. – Consults access control information. – Allows or disallows request. • Advantages – Easy to implement. – Easy to understand • Disadvantages – Bottleneck in system – Controls only direct accesses (not inferences) 8

Graham-Denning Model • Introduces protection rules that operate on: – A set of subjects

Graham-Denning Model • Introduces protection rules that operate on: – A set of subjects S – A set of objects O – A set of rights R – An access control matrix Subjects S 1 s 2 S 2 O 1 O 2 Control Read* Owner read Control Owner 9

Graham-Denning Rights Eight primitive protection rights – create, delete object – create, delete subject

Graham-Denning Rights Eight primitive protection rights – create, delete object – create, delete subject – read, grant, delete, transfer access right 10

Military Security Model • Information is ranked: – – Unclassified Confidential Secret Top Secret

Military Security Model • Information is ranked: – – Unclassified Confidential Secret Top Secret • Least Privilege: Subject should have access to fewest objects needed for successful work – The system backup program may be allowed to bypass read restrictions on files, but it would not have the ability to modify files. – Need to Know” 11

Compartmentalization Information may belong to one or more compartments Compartments are used to enforce

Compartmentalization Information may belong to one or more compartments Compartments are used to enforce need-to-know. • Classification of Information: <rank; compartments> • Clearance: <rank; compartments> – an indication of a level of trust • A subject can access an object only if – The clearance level of the subject is at least as high as that of the information. – The subject has a need to know about all compartments for which the information is classified. 12

Information Flow Models • Acts as an intelligent filter to control the transfer of

Information Flow Models • Acts as an intelligent filter to control the transfer of information permitted by access to a particular object. • Information flow analysis can assure that operating system modules that have access to sensitive data cannot leak that data to calling modules. 13

Bell-La. Padula Model • A formal description of the allowable paths of information flow

Bell-La. Padula Model • A formal description of the allowable paths of information flow in a secure system. – Applies only to privacy – Identifies paths that could lead to inappropriate disclosures. – Is used as the basis for the design of systems that handle data of multiple levels. – Includes both discretionary and mandatory access rules • B-LP Discretionary Access Control – Uses Access Matrix similar to Graham-Denning Model – Includes functions for dealing with the access matrix. 14

Bell-La. Padula Mandatory Controls • Fixed security classes for each subject and each object

Bell-La. Padula Mandatory Controls • Fixed security classes for each subject and each object • Security classes ordered by a relation – Tranquility constraint prevents access classes of objects from changing • Simple Security Property • * Property 15

Bell-La. Padula Properties Simple Security Property: • Subject may have read access only if

Bell-La. Padula Properties Simple Security Property: • Subject may have read access only if object classified at same level or lower. * - Property • Subject may have write access only if all objects read are at same level or higher than object to be written. 16

Biba Model • Concerned with integrity rather than secrecy. • Defines integrity levels much

Biba Model • Concerned with integrity rather than secrecy. • Defines integrity levels much like sensitivity levels. – Fixed integrity classes for each subject and each object – Ordered integrity classes 17

Biba Properties Simple Integrity Property: • Subject can modify object only if integrity class

Biba Properties Simple Integrity Property: • Subject can modify object only if integrity class at least as high as the object. (untrusted subjects reduce integrity class when writing) * - Property: • Subjects may have write access only if the integrity of objects they are reading is at least as high as the object to be written. (untrusted sources reduce integrity of results) 18

Integrity Preservation A high integrity file is one whose contents are created by high-integrity

Integrity Preservation A high integrity file is one whose contents are created by high-integrity processes. • high-integrity file cannot be contaminated by information from low-integrity processes. • high-integrity process cannot be subverted by low integrity processes or data. The integrity class label on a file guarantees that the contents came only from sources of at least that degree of integrity. 19

Secure Operating Systems Basic Features of a Multiprogramming OS – – – – Authentication

Secure Operating Systems Basic Features of a Multiprogramming OS – – – – Authentication of users. Protection of memory. File and I/O device access control. Allocation and access control to general objects. Enforcement of sharing. Guarantee of fair service. Interprocess communication and synchronization. • Basic Considerations – Security must be considered in every aspect of the design of operating systems. – It is difficult to add on security features. 20

Basic Design Principles • Least privilege - fewest possible privileges for user. • Economy

Basic Design Principles • Least privilege - fewest possible privileges for user. • Economy of mechanism - small, simple, straight forward. • Open design • Complete mediation - check every access • Permission based - default is denial of access. • Separation of privilege - no single super user. • Least common mechanism - avoid shared objects. • Easy to use. 21

Security Kernel • Responsible for implementing the security mechanisms of the entire operating system.

Security Kernel • Responsible for implementing the security mechanisms of the entire operating system. • Provides the security interfaces among the hardware, the operating system, and the other parts of the computing system. • Implementation of a security kernel: – May degrade system performance (one more layer). – May be large. – No guarantees. 22

Backups • First line of defense against denial-of-service and modification threats • Don’t depend

Backups • First line of defense against denial-of-service and modification threats • Don’t depend on system backups for important data • User backups • Administrator backups: – – Day-zero backup Upgrade backup Full backup Incremental backup 23

Backup Policy • One backup volume per partition • Time backup for restoration –

Backup Policy • One backup volume per partition • Time backup for restoration – How much work are we willing to lose? • Verify backup at archive location – Content - not just format – Ensure operator training – Ensure archive environment • Rotate media – Need more than most recent backup • Maintain physical security on backups • Maintain logical security on backups • Be careful about legal issues on backups 24

Integrity • Compromise of integrity equal to compromise of privacy • Integrity threats: –

Integrity • Compromise of integrity equal to compromise of privacy • Integrity threats: – – – Change permissions to allow modification/reading Change password file Change device / interface configurations Move files Replace system programs with substitutes Replace log files with sanitized versions • 95% of UNIX security incidents result of misconfiguration 25

Integrity Protection Strategies • Prevention • Detection • Recovery 26

Integrity Protection Strategies • Prevention • Detection • Recovery 26

Unix Operation Modes • Normal Operating Mode: – – Any user login Diverse command

Unix Operation Modes • Normal Operating Mode: – – Any user login Diverse command set Network operations Import and export files • Single User Mode: – – – Intended for system maintenance / full backup Only root login allowed Restricted command set No network operations No file import/export 27

Prevention Strategies • Software Controls: – File permissions – Directory permissions – Restrictions on

Prevention Strategies • Software Controls: – File permissions – Directory permissions – Restrictions on root access • Low-level operating system controls: – Immutability - only change in single-user mode – append - only add to file, except single-user mode • Hardware controls: – Read-only file systems (CD ROM, WORM) – Write-protect options 28

Detection Strategies • Comparison copies: – On read-only media – On standard media, remote

Detection Strategies • Comparison copies: – On read-only media – On standard media, remote storage – Large space, slow, expensive • Metadata: – – Stored list of files Path to files Modification times Easy to fool • Digital Signature – Encrypt with private key of modifier – Fast, small, hard to fool, requires extra work 29

TRIPWIRE • System to compute signatures on all files in system – Batch mode

TRIPWIRE • System to compute signatures on all files in system – Batch mode - compare against stored signatures & report differences – Interactive mode - compare against stored signatures & confirm updates – Both commercial and freeware products • Detects: – Corrupted file systems – Unlogged administrator actions – Replacement of system programs 30

Recovery Strategies • Restore from backup - Rollback (Data Loss) • If data problem,

Recovery Strategies • Restore from backup - Rollback (Data Loss) • If data problem, may be able to replay changes Selective Rollback (some data loss) • If redundant file system, vote file versions Masking • If specific changes found - correct - Roll forward • In general -- the more detection and prevention, the easier the recovery 31

Auditing • Installing security protection is only a beginning • Need to monitor systems

Auditing • Installing security protection is only a beginning • Need to monitor systems • Monitoring methods: Audits and Logs – Audit - active scanning of current state of system – Log - record of actions taken in operation of system • Audits often use logs, and do more 32

Log File Vulnerabilities • Alteration – Append mode – Non-rewritable media (print) • Deletion

Log File Vulnerabilities • Alteration – Append mode – Non-rewritable media (print) • Deletion – Non-rewritable media – Move to restricted log host – PC linked by serial line • Flooding – Ensure large storage – Reduce before logging (look for repeating patterns) 33

Syslog • General purpose logging utility • Any program can generate syslog messages –

Syslog • General purpose logging utility • Any program can generate syslog messages – Socket connect to syslogd process TCP port • Messages to files, devices or computers – Dependent on severity and service • Messages marked with authentication level – kern, user, mail, lpr, auth, demon, news, uucp, local 0. . . local 7, mark • Messages marked with priority – emerg, alert, crit, err, warning, notice, info, debug, none 34

Syslog Vulnerabilities • • Network/Device flooding Stack overwrites (old versions) False log entries Need

Syslog Vulnerabilities • • Network/Device flooding Stack overwrites (old versions) False log entries Need for consistent, frequent review 35

Hand-Written Logs • • Journal System Ensure physical protection “Where do you keep them?

Hand-Written Logs • • Journal System Ensure physical protection “Where do you keep them? ” Ensure legitimate entries – Signature rules • Keep for system • Keep for site 36