13. A method comprising using at least one hardware processor for: receiving a masking rule of a data element in one or more documents of a JSQN-type, said one or more documents each comprise a hierarchy of at least two levels identified by name-value pairs, wherein the masking rule is based on the hierarchy of the one or more documents of the JSON-type, wherein the masking rule is defined according to one or more constraints with respect to a level of the at least two levels; and enforcing the masking rule on a document of the one or more documents of the JSON-type; wherein the enforcing of the masking rule comprises, listening to traffic in a network; identifying the document as it passes through the network; and enforcing the masking rule on the document.
14. The method of claim 13 , wherein the enforcing of the masking rule on the document is performed online.