entendendo o selinux - security enhanced linux
DESCRIPTION
Palestra sobre SELinux apresentada na PUC no evento Tchelinux em Novembro de 2008.TRANSCRIPT
![Page 2: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/2.jpg)
Tchelinux
Agenda● Introdução e Motivação● Definição● Modelos de Controles de Acesso – DAC e MAC● SELinux
– Histórico
– Arquitetura
– Políticas de Segurança Strict, Targeted, MLS e MCS
![Page 3: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/3.jpg)
Tchelinux
Agenda
● SELinux– Criação e Manutenção de Políticas
– Administração
● Demonstração Prática● Conclusões● Referências
![Page 4: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/4.jpg)
Tchelinux
Introdução e Motivação
● Incidentes de Segurança:– Complexidade das aplicações;
– Elevação de privilégios;
– Código móvel;
– Zero-days;
– Políticas de atualizações;
– Inevitabilidade de falha: “The Inevitability of Failure: The Flawed Assumption of Security in Modern Computing Environments” http://www.nsa.gov/selinux/papers/inevitability
![Page 5: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/5.jpg)
Tchelinux
DAC – Controle de Acesso Discricionário
● Modelo mais popular.● Administradores e não-administradores;● Delegações;● Usuários = Programas (processos)
![Page 6: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/6.jpg)
Tchelinux
Problemas no DAC
● Usuários: admin ou não-admin;● Princípio do menor privilégio difícil de aplicar;● Serviços que só rodam como super usuário;● Herança de poderes de acesso;● Definições de acessos por usuário e não por
programa;● Assume que todos os programas são
confiáveis e sem falhas.
![Page 7: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/7.jpg)
Tchelinux
MAC – Controle de Acesso Mandatório
![Page 8: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/8.jpg)
Tchelinux
MAC – Controle de Acesso Mandatório
● Sistema define a política de acesso;● Sujeitos (usuários) não pode conceder direitos;● Sujeitos (programas) não podem conceder
direitos (vírus, trojans, por exemplo);● P(S,O,A) -> {accept,deny}
![Page 9: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/9.jpg)
Tchelinux
DAC vs MAC
DAC● Dono do objeto possui poder
total sobre ele;● Confiança completa nos
usuários;● Decisões de acesso são
baseadas somente no user-id e permissões do objeto;
● Impossível de controlar o fluxo de dados;
MAC● Dono do objeto PODE ter
algum poder sobre ele;● Somente confia no
administrador da política;● Objetos e processos podem
possuir IDs;● Possibilita controle do fluxo
de dados;
![Page 10: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/10.jpg)
Tchelinux
DAC vs MAC
![Page 11: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/11.jpg)
Tchelinux
Security-Enhanced Linux
● Desenvolvido pela National Security Agency (NSA) e Secure Computing Corporation para uso das tecnologias MAC (Flask);
● Classes B1 e superiores da TC-SEC
![Page 12: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/12.jpg)
Tchelinux
SELinux - Objetivos
● Isolamento das aplicações;● Controle do fluxo de informações;● Confidencialidade;● Integridade;● Auto-proteção;● Menor privilégio;● Separação de papéis;
![Page 13: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/13.jpg)
Tchelinux
SELinux - Desenvolvimento
![Page 14: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/14.jpg)
Tchelinux
SELinux e LSM● LSM (Linux Security Modules) – 2001 Linux
Kernel Summit
![Page 15: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/15.jpg)
Tchelinux
SELinux - Arquitetura
![Page 16: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/16.jpg)
Tchelinux
SELinux - Elementos
● Objetos● Sujeitos● Ações / Permissões● Política
![Page 17: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/17.jpg)
Tchelinux
SELinux – Contextos de Segurança
● Identidade● Papel● Tipo / Domínio● Nível de Segurança
![Page 18: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/18.jpg)
Tchelinux
SeLinux – Decisões de Acesso
● Tudo é negado por padrão● Regras de Allow, Auditallow e Dontaudit
![Page 19: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/19.jpg)
Tchelinux
SELinux – Decisões de Transição
![Page 20: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/20.jpg)
Tchelinux
SELinux - Política
![Page 21: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/21.jpg)
Tchelinux
SELinux - Política
![Page 22: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/22.jpg)
Tchelinux
SELinux – Política Strict
● Para cada tipo de acesso de cada processo para cada arquivo deverá existir ao menos uma regra na política, senão o acesso será negado;
● Complexidade alta;● Programas não suportados;● Problemas no início do uso do
SELinux
![Page 23: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/23.jpg)
Tchelinux
SELinux – Política Targeted
● Domínio unconfined_t;● Política padrão atual;● Várias aplicações suportadas
![Page 24: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/24.jpg)
Tchelinux
SELinux – Política MLS
● Política Strict + Níveis (modelo BLP);● Mais dois campos no contexto de segurança:
– sensibilidade: confidencial, secreto, etc (hierarquia)
– categoria: classificação não hierarquica
● Órgãos do governo e militares
![Page 25: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/25.jpg)
Tchelinux
SELinux – Política MCS
● Subconjunto do MLS● Nível de sensibilidade não utilizado
![Page 26: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/26.jpg)
Tchelinux
SELinux – Customização da Política
● Política de referência;● Variáveis booleanas;● Políticas Modulares;● Utilitários para geração de políticas
![Page 27: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/27.jpg)
Tchelinux
SELinux - Administração
● enforcing, permissive, disabled
![Page 28: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/28.jpg)
Tchelinux
SELinux – Customização da Política
![Page 29: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/29.jpg)
Tchelinux
SELinux - Demonstração
![Page 30: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/30.jpg)
Tchelinux
Conclusões
● Viável para uso em servidores com aplicações comuns;
● Possibilidades de uso futuras;● Não precisa de intervenção para uso comum;● Segurança Pró-ativa;● Software Livre !
![Page 31: Entendendo o SELinux - Security Enhanced Linux](https://reader031.vdocuments.site/reader031/viewer/2022013121/549c0d6eac7959bf2a8b465e/html5/thumbnails/31.jpg)
Tchelinux
SELinux - Referências
● http://jczucco.googlepages.com/selinux.html● http://selinuxnews.org/planet/● http://www.redhat.com/docs/manuals/enterprise/
RHEL-5-manual/Deployment_Guide-en-US/selg-overview.html
● http://mdious.fedorapeople.org/drafts/html/● http://delicious.com/jczucco/selinux