Los procedimientos almacenados y los sistemas

Centro de Exposiciones del Centro de Conocimiento sobre servicios públicos electrónicos. Almacenamiento. En seguridad informática siempre se habla de los procedimientos almacenados como un mecanismo para evitar el problema de la inyección de SQL. En What have the STORED PROCEDURES ever done for us? defienden se pueden conseguir ventajas como:

Your application is only aware of that one database account that can only execute SP required by your application and nothing more.

That application account can’t access data at all directly.

That application account is created and managed by another database account with a higher level of privileges and that is stored and protected much more securely.

Esto es, el principio del mínimo privilegio.

Además, también beneficios desde el punto de vista de las prestaciones.

Well, this one is easy, everyone knows that at least - STORED PROCEDURES will give you performance gain.

Mantenibilidad, porque nos permiten hacer depuración sin tener que usar el sistema completo.

Execute the STORED PROCEDURE that serves that screen and examine the data. If data contains the bug, then you know that the problem is within the STORED PROCEDURE, if it doesn’t then the bug is somewhere within the application layer.

Disponibilidad, puesto que también nos permiten detectar y corregir determinados problemas en la base de datos.

I may have already mentioned above that you can patch a bug in STORED PROCEDURE without having to stop anything. Hence, availability.

Un recordatorio, presentado de forma llamativa.

Machine Learning para elegir un método de compresión

Semáforos En el mundo de los programas ‘inteligentes’, una aproximación con una cierta tradición es aplicar esa inteligencia a la toma de decisiones cuando algunos parámetros pueden cambiar y probar todas las opciones es una tarea difícil o costosa.

De esto hablaba shrynk - Using Machine Learning to learn how to Compress aplicado al tema de la compresión de información (esto es, hacer que ocupe menos espacio). Hay muchos métodos de compresión y unos son mejores que otros cuando los datos tienen unas ciertas características:

Different algorithms exist for different types of data, such as images, video, audio, but also text and general purpose files. Any data can be compressed as long as there is a pattern to use.

Y el ‘machine learning’ es una buena herramienta de ayuda a la decisión. En este caso, se utilizan métodos ya conocidos de compresión y se evalúa su comportamiento frente a los datos disponibles.

For each file, it will apply the compression and gather the values for each compression algorithm on size, write and read columns and converts them to z-scores: this makes them comparable at each dimension and is a novel approach as far as I know. The lowest sum of z-scores given the user weights gets chosen as a classification label. Let’s see that in slow-motion.

En lugar de decidir ‘a mano’ o por algún méitodo más costoso, este sistema permite elegir un método suficientemente bueno.

Since having to come up with manual rules for when to use which compression would be very complex and time costly, this was a great case for machine learning. It’s very scalable, as when a new compression algorithm shows up on the market, shrynk will be able to benchmark that one and no new rules have to be figured out.

Curioso.

Make y makefiles siguen siendo herramientas de actualidad

Construcción Sigo manteniendo algunos viejos Makefiles de proyectos en C que sigo necesitando. Resuelven bien un problema concreto que es el de gestionar las dependencias entre ficheros que continen código y las bibliotecas que hay que generar a partir de ellas, en qué orden y qué es necesario compilar después de cambiar alguna parte del proyecto.

Por eso me gustó leer The Language Agnostic, All-Purpose, Incredible, Makefile que aporta una visión actual del programa Make y cómo lo usa el autor.

Este programa existe desde 1976 y mucha gente piensa que ya está obsoleto:

Make was born in 1976, making it one of the oldest tools in a programmer’s toolkit. Any tool that has been around this long is bound to have a mythology, stories, and examples that would be intimidating to someone unfamiliar with it. Additionally, I think many of us have written it off as no longer relevant, as we are not writing C programs, after all. Allow me to show you why it should not be intimidating, and furthermore, is applicable to your everyday workflow as an engineer.

El programa trabaja con objetivos, tiempos y reglas basadas en lo que se necesita para alcanzar esos objetivos:

This section is just a summary of what we just arrived at. The properties of satisfaction for a target.

The target must exist. The target’s timestamp must be newer than the timestamp of the target’s prerequisites. The prerequisite targets must be satisfied.

Un buen recordatorio.

Teoría de la probabilidad y gestión de sistemas

Laplace fue un matemático interesado en la estadística La teoría de la probabilidad analiza aspectos como cuántas veces tiene que ocurrir un suceso para que se obtena un determinado resultado. Hechos poco probables deberían ocurrir pocas veces (que no significa que no puedan ocurrir) y el problema puede aparecer cuando ‘damos muchas oportunidades’ para que finalmente el hecho suceda. En un sistema informático estamos continuamente ‘tirando los dados’: se trata de hacer muchas veces procesos repetitivos, para evitar tener que repetirlos nosotros a mano. De esto nos hablaba Some Useful Probability Facts for Systems Programming centrándose en el caso de la programación de sistemas.

Por ejemplo, si en un servicio en línea hay una probabilidad de que suceda un incidente cada 20 días, la forma en que se distribuyan esos sucesos nos afectarán de manera desagradable e inevitable de vez en cuando.

If an online service has a production incident once every 20 days on average, then (assuming unrelated incidents) just over a third of 20-day periods will be dead quiet, just over a third will have the “ideal” single incident, while a quarter of 20-day periods will be extra stressful. In the real world, production incidents are even more tightly clustered because they’re not always independent.

Lectura interesante.

Modelo de Seguridad en programas informáticos de la OWASP

The pila seguridad En el mundo de la seguridad del software hay dos modelos de madurez (esencialmente, modelos basados en lo que hacen distintas empresas y organizaciones, como guía para lo que deberíamos estar haciendo el resto. Por un lado está el Building Security In Maturity Model (BSIMM) y el Software Assurance Maturity Model (SAMM).

El primero proviene de un grupo de expertos de la industria y ha tenido varias versiones en los últimos años. El segundo, fue promovido por la OWASP (Open Web Application Security Proyect) y yo casi lo daba por muerto.

Sin embargo, a principios de este año se anunció OWASP SAMM version 2: Analyze and improve organizational security posture, lo que significa que han vuelto a avanzar.

“This is a really important release for the project team. After three years of preparation, the team, our SAMM community, and through the help of our sponsors we now have an effective and measurable way for all types of organizations to analyze and improve their software security posture,” said project co-leaders Seba Deleersnyder and Bart De Win.

Interesante.