Class SanitizedBridgesWriter

  • All Implemented Interfaces:
    java.lang.Runnable, java.util.concurrent.Callable<java.lang.Object>, java.util.Observer

    public class SanitizedBridgesWriter
    extends CollecTorMain

    Sanitizes bridge descriptors, i.e., removes all possibly sensitive information from them, and writes them to a local directory structure. During the sanitizing process, all information about the bridge identity or IP address are removed or replaced. The goal is to keep the sanitized bridge descriptors useful for statistical analysis while not making it easier for an adversary to enumerate bridges.

    There are three types of bridge descriptors: bridge network statuses (lists of all bridges at a given time), server descriptors (published by the bridge to advertise their capabilities), and extra-info descriptors (published by the bridge, mainly for statistical analysis).

    • Constructor Detail

      • SanitizedBridgesWriter

        public SanitizedBridgesWriter​(Configuration config)
        Initialize configuration.
    • Method Detail

      • module

        public java.lang.String module()
        Description copied from class: CollecTorMain
        Returns the module name for logging purposes.
        Specified by:
        module in class CollecTorMain
      • syncMarker

        protected java.lang.String syncMarker()
        Description copied from class: CollecTorMain
        Returns property prefix/infix/postfix for Sync related properties.
        Specified by:
        syncMarker in class CollecTorMain
      • sanitizeAndStoreNetworkStatus

        public void sanitizeAndStoreNetworkStatus​(byte[] data,
                                                  java.lang.String publicationTime,
                                                  java.lang.String authorityFingerprint)
        Sanitizes a network status and writes it to disk.
      • sanitizeAndStoreServerDescriptor

        public void sanitizeAndStoreServerDescriptor​(byte[] data)
        Sanitizes a bridge server descriptor and writes it to disk.
      • sanitizeAndStoreExtraInfoDescriptor

        public void sanitizeAndStoreExtraInfoDescriptor​(byte[] data)
        Sanitizes an extra-info descriptor and writes it to disk.
      • finishWriting

        public void finishWriting()
        Rewrite all network statuses that might contain references to server descriptors we added or updated in this execution. This applies to all statuses that have been published up to 24 hours after any added or updated server descriptor.
      • cleanUpRsyncDirectory

        public void cleanUpRsyncDirectory()
                                   throws ConfigurationException
        Delete all files from the rsync directory that have not been modified in the last three days, and remove the .tmp extension from newly written files.
        Throws:
        ConfigurationException