Skip to content

FrOSCon - Beyond LAMP

First talk finished :-). No proofreading done so far. Next talk will start in a few seconds.

Its All About Scale

  • size
  • features
  • non-functional requirements
  • Language agnostic - language you are using doesn't matter

Background Tasks

User can't wait and server can't handle it

  • sending mail
  • calling 3rd party APIs / services
  • converting media (image, video, audio)
  • updating caches

Direct Approach

Don't do that since your are losing control

Slightly Less Bad Idea

  • Write jobs into sql database
  • have some workers that poll the database for jobs

Don't use it

Queus To The Rescue

  • write jobs into message queue
  • have some workers for the queue
  • many services available (ZeroMQ, RabbitMQ, Redis Pub/Sub, Amazon SQS ...)

Good idea but lot of work and hard to get right

Beanstalkd

  • create a job
  • process a job

RQ

  • simple job queue in python
  • backed by redis
  • enqeueu function call
  • run worker how stores result in database

Celery

  • python
  • multiple brokers
  • primarily python with clients for ruby and php
  • highly available (HA)
  • fast
  • flexible
  • monitoring
  • workflows
  • time and rate limits
  • scheduling
  • autoscaling

Search

Like query

  • no lingustic suport
  • no ranking
  • not indexed (mysql has fulltext index and postgresql)

Fulltext Search Engines - Solr Vs. Elastic Search

  • based on lucene
  • full linguistic support
  • faceted search
  • result highlighting
  • HTTP API
  • similar but different
  • easy to set up
  • clients available like PHP: solarium, symfony component or PHP Elastica
  • integrate search into framework (map objects into documents and back) or handeling updates and deletes

NoSQL

  • key-value stores
  • column based
  • document stores
  • graph

Errors

  • don't let it happen
  • send an email (overload mailboxes)
  • log errors
    • php symfony provides a component that you log only all messages if error occures (so only info logging if something happens)
    • properly configure logging
    • use event aggregator
      • sentry
      • errbit

Sentry (event aggregator)

  • started as OSS
  • now available as SaSS
  • udp
  • written in django
  • php client available

Errbit (event aggretator)

  • still OSS

Deployment

  • ftp
  • git pull / app server by ssh
  • but you want a automated deployment like fab deploy
  • automated deployment with webistrano (just a single button)

Wrap Up

  • use background tasks
  • use full text search
  • try to use nosql where needed
  • do error logging
  • think about deployment

meetup - attraktor - selinux

Just arrived at home from back to hack selinux. I tried my best to keep up the speed of slides. Nevertheless, there are some gaps in between.

Big thanks to the presenter. I turned my fear into anticipation for using it!

History

  • 1976 LaPadula paper released
  • DTMach as construction idea released
  • Based on FLASK, first patches to linux kernel
  • 2002 implemented as linux security module (LSM)
  • Since 2003 part of the mainline kernel
  • Fedora core was first distribution (shipped with policy)
  • Since 2007 shipped with RHEL5 EAL4+

Bell LaPadula

  • MAC
  • TE
  • RBAC
  • No read up, no write down

Features

  • Extends DAC (directory access control)
  • mode at runtime changeable (enforcing vs permissive)
  • flexible policy
  • AVC (access vector cache)
  • root is not god anymore
  • process running in own security domain

Discretionary Access Control

  • classical security concept
  • object based access control
  • unflexible
  • rights per user
  • user can ship rights
  • uid can be changed by using suid

MAC

  • access control by using policy

TE - Type Enforcement

  • all resources have a typ/domain
  • whitelisting ruleset

Security Context

  • securityarea
  • object (user:role:domain:level)
  • subject

Policy

  • heart of selinux
  • common policis are targeted, strict and MLS
  • defines rules for access from subject of object
  • defines domain transition of a subject (when can a subject change its domain)

Policies

Targeted

  • default policy
  • contains a understandable complexity
  • well choosen processes running in own domain
  • you can tweak the policy by using booleans
  • this policy should be enough for daily work
  • if you use the filesystem hirachy standard you are quite save
  • Unknown software is stored in context "unconfined"

Multi Level Security (mls)

  • everything is running under selinux policies
  • tweakable by booleans
  • only for high risk security aspects

Booleans

  • enables tweaking the policy without reload
  • no knowledge about policy needed
  • booleans can set permanent
  • semanage boolean -l lists a lot of informations

Userlandtools

  • -Z is selinux switch (ls -Z, netstat -Z)
  • cp, mkdir and so on are linked against selinux to support setting needed bytes
  • getenforec/setenforce - switching selinux mode
  • restorecon/fixfiles/chcon - changing context of subjects
  • sestatus - status
  • avcstat - status about avc
  • libselinux - the selinux
  • libsepol - all binaries linked against

Policy Management

  • setsebool/getsebool - show and set of selinux booleans
  • semanage - policy management
  • semodule -

Policy Development

  • audit2allow - builds selinux rules based on audit log
  • checkmodule - transforms rulse into binary
  • semodule_package -
  • audit2why - analyse selinux

Linux Audit Framework (LAF)

  • should be used for logging

Backup

  • you are loosing the context if your backup software does
  • tar and rsync supports :)

web - Edward Snowden [...] "Solche Leute sind wahrscheinlich die Helden des 21. Jahrhunderts, würde ich mal sagen."

[...] Zehn Wochen sind vergangen, seit Edward Snowden eingeladen hat zum Tag der offenen Tür bei den weltgrößten Geheimdiensten. Ein Platz in den Geschichtsbüchern ist ihm sicher. Nur welcher? Für Hans Magnus Enzensberger ist die Sache eindeutig.

Hans Magnus Enzensberger:
"Solche Leute sind wahrscheinlich die Helden des 21. Jahrhunderts, würde ich mal sagen."

Er hat sein Leben riskiert, um seinem Land und den westlichen Demokratien zu zeigen, was schief läuft. Durch seine Enthüllungen wissen wir jetzt, was wir ahnten: Die machen wirklich Kopien von uns allen – es gibt tatsächlich eine Matrix. Der Publizist Frank Schirrmacher sieht die Demokratie in ihren Grundfesten bedroht.

Hans Magnus Enzensberger:
"Wir sind in einem System, wo das geheime Wissen fast größer zu sein scheint, als das öffentliche Wissen – und das im Internet-Zeitalter."

Enzensberger meldet sich zu Wort, weil die Regierung den Wandel, der unsere Gesellschaft radikal verändern wird, gar nicht erkennt. Er sagt: Geheimdienste und Gigantenunternehmen wie Google haben sich von der Demokratie bereits verabschiedet:

Hans Magnus Enzensberger: "In jeder Verfassung der Welt steht ja ein Recht auf Privatsphäre, Unverletzlichkeit der Wohnung und so weiter... das sind ja lange Passagen. Das ist abgeschafft! Das heißt, wir befinden uns in postdemokratischen Zuständen."

Wie diese Zustände nach der Demokratie aussehen können, zeigt der Science-Fiction-Film "Minority Report". Man wird überall gescannt – ob in der U-Bahn oder im Einkaufszentrum. Erstaunlicherweise ist das schon Wirklichkeit: Supermärkte gehen dazu über, uns mit Kameras zu beobachten, sie zoomen auf unsere Gesichter, scannen die Bewegungen, Computerprogramme interpretieren unsere Stimmung, wissen von unseren Vorlieben – sie kennen uns ja von den vorherigen Besuchen und werden schon bald sekundenschnell das passende Angebot aufs Handy schicken. Schokolade?

Frank Schirrmacher:
"Ich glaube schon, wenn ein typischer Bundesbürger die Analyse seiner Persönlichkeit, aus Sicht einer Firma, noch nicht mal des Geheimdienstes, aufgrund seiner digitalen Kommunikation lesen würde, würde er schon vom Stuhl fallen."
[...]


Quelle

Danke für die wahren Worte. Es tut gut solche Gedanken zu lesen, obendrein im öffentlich rechtlichen.