Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

10 Sept 2011

Kernel.org is hacked, what'z the impact??


All open source lovers got a shocker when they came to know that kernel.org is hacked, there was some panic and lots of questions started floating on open source forums, here is a compiled draft on the news and the progress so far, would like to share with the readers:-

As recently announced on www.kernel.org, the main kernel.org server (known as “hera”) was recently compromised by an unknown intruder. The hacker was able to gain “root” access, meaning they had the full run of the system. There is no need to worry about the integrity of the kernel source or of any other software hosted on the kernel.org systems.

Kernel.org is, of course, the home for the Linux kernel. Many other projects live there as well. On the face of it, that would make kernel.org a tempting target for an attack. What self-respecting cracker wouldn’t want an opportunity to place some special code into the Linux kernel? Such code would, over time, find its way into millions of machines worldwide. The injection of backdoors or other malware is a concern for any software maintainer - open source or otherwise - but it turns out that we are well protected against that sort of attack.

If kernel developers worked by shipping simple files of source code around, they might well be vulnerable to malware added by an intruder. But that is not how kernel development is done. The code for the kernel (and for many other projects) is managed with the “git” source code management system. And git does not allow the code to be modified by third parties without people knowing about it.

How git works?

A cryptographic “hashing function” is a mathematical formula which boils the contents of a file down to a small number. “Small” is relative; git’s hash function produces 160-bit numbers, which are quite big by normal standards - it is roughly equal to the number of atoms in the Earth. The key to the hash function is that, if the contents of the file change, the hash will change too. Creating any new file matching the hash of an existing file is not really possible; if you want that new file to look like the old one with the exception of a bit of hostile code, the challenge is even bigger. So an attacker would be unable to change a file without changing its hash as well. Git checks hashes regularly, so a simplistic attempt to corrupt a file would be flagged almost immediately.

The hashing does not stop there. For any given state of the kernel source tree, git calculates a hash based on:-

(1) The hashes of all the files contained within that tree, and

(2) The hashes of all of the previous states of the tree.

So, for example, the hash for the kernel at the 3.0 release is 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe. There is no way to change any of the files within that release - or within any previous release - without changing that hash. If anybody (even the kernel.org repository) were to present a 3.0 kernel with a different hash, it would be immediately apparent that something was not right.

If an attacker were to corrupt the kernel.org repository, those other developers would notice the next time they updated their personal repositories - something that happens many times every day. If the attacker were to simply add new patches that had not gone through Linus Torvalds’s personal copy of the repository (which is not the copy on kernel.org), he would notice the next time he tried to make a change of his own. Git will see that the hash values are not what they should be and raise the alarm.

Kernel.org may seem like the place where kernel development is done, but it’s not; it’s really just a distribution point. The integrity of that distribution point is protected by the combination of clever software and thousands of copies of the repository distributed around the world.

It will be necessary to rebuild the kernel.org infrastructure and to figure out how the attacker got in. The integrity of those systems was lost; restoring it and protecting it into the future will take a considerable amount of work. But people running Linux need not worry about the integrity of their kernels; that is protected by defenses stronger than those of any single computer.

Also as announced by Linus “ entire repository of Linux Kernel gets hosted at Github”

Here is the official email by Linus:- https://lkml.org/lkml/2011/9/4/92

Let's see how things shape up in near future. But whoever is the hacker, he has done a smart job - getting root access is definitely not trivial, now we need to see what additional security measures will come in picture

Lot's to look forward to in coming days, let's follow the development closely.....

3 Jul 2011

Open source version control management

GIT is a distributed revision control system with an emphasis on speed.
GIT was initially designed and developed by Linus Torvalds for Linux kernel development.
Later on, GIT became the de facto standard in the open source community.


The main design goals behind GIT are:-
·         Support for distributed workflow
·         Very high performance
·         Very strong safeguards against corruption

GIT is free software. It is distributed under the terms of GNU General Public License v2. The GIT provides only the basic functionality for SCM operations. It can be seen as a versioning file-system. GIT does not have any notion of users or access rights. Nor it has any graphical user interface. All these are built on top of GIT by additional tools, like Gerrit.

Let's get started:-
Initializing the build environment
64-bit systems:
---------------------------------
$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev
---------------------------------

More information on initializing the build environment can be found at:-
http://source.android.com/source/initializing.html

Download the GIT Source
Use your favorite package installer to install git-core and gitosis packages:
sudo apt-get -y install git-core


Installing Repo
Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo
To install, initialize, and configure Repo, follow these steps
Make sure you have a bin/ directory in your home directory, and that it is included in your path:
-----
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
-----


After installing Repo, set up your client to access the android source repository:-
Create an empty directory to hold your working files:
Run repo init to bring down the latest version of Repo with all its most recent bug fixes. We must specify a URL for the manifest, which specifies where the various repositories included in the Android source, will be placed within your working directory.
$ repo init -u git://hostname/local/platform/manifest.git

To check out a branch other than "master", specify it with -b:

When prompted, configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address. Make sure this is a live address at which you can receive messages.
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
To pull down files to your working directory from the repositories as specified in the default manifest, run $repo sync

Let’s learn something about manifest file, how it works and what it contains?

What is a Manifest file??
It’s a xml file, which contains information related to:-
·         Remote
·         Revisions
·         Project path
·         Project name


Manifest file is a xml file which contains all the information about:-
Projects:-
Which are the git projects that have to be synced, where those projects are located, which revision of those git projects should be picked while syncing to local directory.

Remote:-
Points to the generic path of the git repositories.

Revision: -
Specifies which branch or tag or commit needs to be picked up while syncing.