Finely chop the onion. Peel the squash, remove the seeds, then cut into 2 cm cubes.
Heat a little oil in a large saucepan, and gently fry the onion, pancetta and rosemary for about 10 minutes.
When the onion is soft, add the squash cubes, chopped tomatoes and vegetable stock. Season with salt and pepper. Bring to the boil and simmer at low temperature for 10 minutes.
Add the pasta and cook for 5-10 minutes until al dente.
Meanwhile, slice the cabbage into thin strips, drain the beans, then stir them into the soup. Cook for 3 minutes, then turn off the heat and rest for 5 minutes under cover.