import re


def _mask_pattern(dirty: str):
    """
    Masks out known sensitive data from string.
    Parameters
    ----------
    dirty : str
        Input that may contain sensitive information.
    Returns
    -------
    str
        Output with any known sensitive information masked out.
    """
    # DB credentials as found in called processes.
    call_proc_db_creds = re.compile(r"--(user|password)=[^', ]+([', ])")
    clean = call_proc_db_creds.sub(r"--\1=*****\2", dirty)

    return clean