The actual Spanish public pension system constitutes a key factor in maintaining social welfare system but its sustainability in the medium and long term is vulnerable. Among the main threats, we can highlight the inevitable increase in the dependency rate, the limited increase in social security contributions and the actual replacement rate. To assess the public pension system sustainability, I implement a dynamic and stochastic general equilibrium model a la Gertler (1999) with a tractable life cycle behavior. Based on a simple version of the model, I found that social security tax rate must increase by more than 26% in order to get rid of the actual deficit (11.5% of social security contributions) while the necessary increase on total labor must be around 13%. According to the estimated growth of the dependency rate for the period 2018-2045 (EUROSTAT), the necessary increase in social security tax rate must be exponential due to its negative effect on labor demand.