This paper derives a general framework for collateral risk control determination in repurchase transactions or repos. The objective is to treat consistently heterogeneous collateral so that the collateral taker has a similar risk exposure whatever the collateral pledged. The framework measures the level of risk with the probability of incurring a loss higher than a pre-specified level given two well-known parameters used to manage the intrinsic risk of collateral: marking to market and haircuts. It allows for the analysis in a self-contained closed form of the way in which different relevant factors interact in the risk control of collateral (e.g. marking to market frequency, level of volatility of interest rates, time to capture and liquidity risk, probability of default of counterparty, etc.). The framework, which combines the recent theoretical literature on credit and interest risk, provides an alternative quantifiable and objective approach to the existing more ad-hoc rule-based methods used in hair cut determination.