import secrets


def synthesize_secrets(record):
    """
    For a single record, synthesize sensitive fields
    - signature
    - data
    - chain
    - serial_number

    Returns updated version of the record (dict) with synthetic secrets
    """
    secret = secrets.token_urlsafe(684)
    record["identity_certificate"]["signature"] = secret

    data = secrets.token_urlsafe(3328)
    record["identity_certificate"]["data"] = data

    chain = secrets.token_urlsafe(5920)
    record["identity_certificate"]["chain"] = chain

    serial = secrets.token_urlsafe(24)
    record["identity_certificate"]["serial_number"] = serial

    return record