Cook the pasta until al dente according to the instructions on the packet.
Meanwhile, drain the beans. Finely dice the onion and garlic. Heat a little oil in a small saucepan. Add the onions and diced bacon and fry well. Add the red beans and garlic and stir-fry for a few more minutes, then deglaze with the tomatoes and simmer on a low heat. Season with salt, pepper and basil.
Serve with the pasta, sprinkle with parmesan cheese.