07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

e confined. In any case, you will have to carefully review the generated rules and validate them<br />

according to your knowledge of the application. Effectively, this approach tends to grant more<br />

rights than are really required. The proper solution is often to create new types and to grant<br />

rights on those types only. It also happens that a denied operation isn't fatal to the application,<br />

in which case it might be better to just add a “dontaudit” rule to avoid the log entry despite the<br />

effective denial.<br />

COMPLEMENTS<br />

No roles in policy rules<br />

It might seem weird that roles do not appear at all when creating new rules.<br />

SELinux uses only the domains to find out which operations are allowed. The<br />

role intervenes only indirectly by allowing the user to switch to another domain.<br />

SELinux is based on a theory known as Type Enforcement and the type<br />

is the only element that maers when granting rights.<br />

14.4.4.4. Compiling the Files<br />

Once the 3 files (example.if, example.fc, and example.te) match your expectations for the<br />

new rules, just run make to generate a module in the example.pp file (you can immediately<br />

load it with semodule -i example.pp). If several modules are defined, make will create all the<br />

corresponding .pp files.<br />

14.5. Other Security-Related Considerations<br />

Security is not just a technical problem; more than anything, it's about good practices and understanding<br />

the risks. This section reviews some of the more common risks, as well as a few<br />

best practices which should, depending on the case, increase security or lessen the impact of a<br />

successful attack.<br />

14.5.1. Inherent Risks of Web Applications<br />

The universal character of web applications led to their proliferation. Several are often run<br />

in parallel: a webmail, a wiki, some groupware system, forums, a photo gallery, a blog, and so<br />

on. Many of those applications rely on the “LAMP” (Linux, Apache, MySQL, PHP) stack. Unfortunately,<br />

many of those applications were also written without much consideration for security<br />

problems. Data coming from outside is, too often, used with little or no validation. Providing<br />

specially-crafted values can be used to subvert a call to a command so that another one is executed<br />

instead. Many of the most obvious problems have been fixed as time has passed, but new<br />

security problems pop up regularly.<br />

VOCABULARY<br />

SQL injection<br />

When a program inserts data into SQL queries in an insecure manner, it becomes<br />

vulnerable to SQL injections; this name covers the act of changing a<br />

parameter in such a way that the actual query executed by the program is<br />

different from the intended one, either to damage the database or to access<br />

data that should normally not be accessible.<br />

400 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!