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).
config, mapPathDescriptors, SOURCES
SYNCORIGINS
Constructor and Description |
---|
SanitizedBridgesWriter(Configuration config)
Initialize configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUpRsyncDirectory()
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.
|
void |
finishWriting()
Rewrite all network statuses that might contain references to server
descriptors we added or updated in this execution.
|
java.lang.String |
module()
Returns the module name for logging purposes.
|
void |
sanitizeAndStoreExtraInfoDescriptor(byte[] data)
Sanitizes an extra-info descriptor and writes it to disk.
|
void |
sanitizeAndStoreNetworkStatus(byte[] data,
java.lang.String publicationTime,
java.lang.String authorityFingerprint)
Sanitizes a network status and writes it to disk.
|
void |
sanitizeAndStoreServerDescriptor(byte[] data)
Sanitizes a bridge server descriptor and writes it to disk.
|
protected void |
startProcessing()
Module specific code goes here.
|
protected java.lang.String |
syncMarker()
Returns property prefix/infix/postfix for Sync related properties.
|
call, checkAvailableSpace, run, syncMapPathsDescriptors, update
merge
public SanitizedBridgesWriter(Configuration config)
public java.lang.String module()
CollecTorMain
module
in class CollecTorMain
protected java.lang.String syncMarker()
CollecTorMain
syncMarker
in class CollecTorMain
protected void startProcessing() throws ConfigurationException
CollecTorMain
startProcessing
in class CollecTorMain
ConfigurationException
public void sanitizeAndStoreNetworkStatus(byte[] data, java.lang.String publicationTime, java.lang.String authorityFingerprint) throws ConfigurationException
ConfigurationException
public void sanitizeAndStoreServerDescriptor(byte[] data)
public void sanitizeAndStoreExtraInfoDescriptor(byte[] data)
public void finishWriting()
public void cleanUpRsyncDirectory() throws ConfigurationException
ConfigurationException