Aims. We perform a complete census of molecular ions with an abundance greater than ∼10 −10 in the protostellar shock L1157-B1. This allows us to study the ionisation structure and chemistry of the shock.Methods. An unbiased high-sensitivity survey of L1157-B1 performed with the IRAM-30 m and Herschel/HIFI as part of the CHESS and ASAI large programmes allows searching for molecular ions emission. Then, by means of a radiative transfer code in the large velocity gradient approximation, the gas physical conditions and fractional abundances of molecular ions are derived. The latter are compared with estimates of steady-state abundances in the cloud and their evolution in the shock calculated with the chemical model Astrochem.Results. We detect emission from HCO + , H 13 CO + , N 2 H + , HCS + , and for the first time in a shock, from HOCO + and SO + . The bulk of the emission peaks at blue-shifted velocity, ∼0.5-3 km s −1 with respect to systemic, has a width of ∼3-7 km s −1 and is associated with the outflow cavities (T kin ∼ 20−70 K, n H 2 ∼ 10 5 cm −3 ). A high-velocity component up to −40 km s −1 , associated with the primary jet, is detected in the HCO + 1-0 line. Observed HCO + and N 2 H + abundances (X HCO + ∼ 0.7−3 × 10 −8 , X N 2 H + ∼ 0.4−8 × 10 −9 ) agree with steady-state abundances in the cloud and with their evolution in the compressed and heated gas in the shock for cosmic rays ionisation rate ζ = 3 × 10 −16 s −1 . HOCO + , SO + , and HCS + observed abundances (X HOCO + ∼ 10 −9 , X SO + ∼ 8 × 10 −10 , X HCS + ∼ 3−7 × 10 −10 ), instead, are 1-2 orders of magnitude larger than predicted in the cloud; on the other hand, they are strongly enhanced on timescales shorter than the shock age (∼2000 years) if CO 2 , S or H 2 S, and OCS are sputtered off the dust grains in the shock. Conclusions. The performed analysis indicates that HCO + and N 2 H + are a fossil record of pre-shock gas in the outflow cavity, whilst HOCO + , SO + , and HCS + are effective shock tracers that can be used to infer the amount of CO 2 and sulphur-bearing species released from dust mantles in the shock. The observed HCS + (and CS) abundance indicates that OCS should be one of the main sulphur carrier on grain mantles. However, the OCS abundance required to fit the observations is 1-2 orders of magnitude larger than observed. Laboratory experiments are required to measure the reactions rates involving these species and to fully understand the chemistry of sulphur-bearing species.