Securing User Access: Auditing Email Domains for Cloud Migration and Security

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This documentation offers guidance on how to Audit user email domains for cloud migration or security checks.

Solution

Overview

When migrating to the Cloud or conducting user audits for security reasons, it's essential to verify that only authorized users have access to the instance. One effective method is to audit the email domains, as emails are crucial for password resets and overall user safety.

This article outlines steps to assist in obtaining a comprehensive list of email domains and the number of users associated with each domain. Using this information, you can collaborate with your security team to conduct a thorough audit.

User Audit from On-Premise Database

Execute the following SQL query to retrieve a report that includes all the domains utilized in user emails along with the count of users for each domain.

Confluence

PostgreSQL

1 2 3 4 5 6 7 SELECT RIGHT(cwd_user.email_address, Strpos(Reverse(cwd_user.email_address), '@') - 1),        Count(*) FROM   cwd_user        INNER JOIN cwd_directory cd ON cd.id = cwd_user.directory_id WHERE  cd.active = 'T' GROUP  BY 1 ORDER  BY 2 DESC; 

MySQL

1 2 3 4 5 SELECT RIGHT(cwd_user.email_address, LOCATE('@', REVERSE(cwd_user.email_address))-1) as DOMAIN, COUNT(*) as COUNT FROM cwd_user INNER JOIN cwd_directory cd on cd.id = cwd_user.directory_id where cd.active = 'T' GROUP BY 1 ORDER BY 2 desc;

MSSQL

1 2 3 4 5 6 7 8 9 10 SELECT DOMAIN, COUNT(*) as COUNT FROM ( SELECT RIGHT(cwd_user.email_address, CHARINDEX('@', REVERSE(cwd_user.email_address))-1) as DOMAIN FROM cwd_user INNER JOIN cwd_directory cd ON cd.id = cwd_user.directory_id WHERE cd.active = 'T' AND cwd_user.email_address LIKE '%@%' ) domains GROUP BY DOMAIN ORDER BY COUNT desc;

Oracle

1 2 3 4 5 6 7 8 9 10 SELECT DOMAIN, COUNT(*) as COUNT FROM ( SELECT SUBSTR(cwd_user.email_address, INSTR(cwd_user.email_address, '@', -1) + 1 ) as DOMAIN FROM cwd_user INNER JOIN cwd_directory cd ON cd.id = cwd_user.directory_id WHERE cd.active = 'T' ) GROUP BY DOMAIN ORDER BY COUNT Desc;

Jira

PostgreSQL

1 2 3 4 5 6 SELECT RIGHT(cwd_user.email_address, strpos(reverse(cwd_user.email_address), '@') - 1), count(*) FROM cwd_user INNER JOIN cwd_directory cd on cd.id = cwd_user.directory_id WHERE cd.active = 1 GROUP BY 1 ORDER BY 2 desc;

MySQL

1 2 3 4 5 SELECT RIGHT(cwd_user.email_address, LOCATE('@', REVERSE(cwd_user.email_address))-1) as DOMAIN, COUNT(*) as COUNT FROM cwd_user INNER JOIN cwd_directory cd on cd.id = cwd_user.directory_id where cd.active = 1 GROUP BY 1 ORDER BY 2 desc;

MSSQL

1 2 3 4 5 6 7 8 9 10 11 SELECT DOMAIN, COUNT(*) as COUNT FROM ( SELECT RIGHT(cwd_user.email_address, CHARINDEX('@', REVERSE(cwd_user.email_address))-1) as DOMAIN FROM cwd_user INNER JOIN cwd_directory cd ON cd.id = cwd_user.directory_id WHERE cd.active = 1 AND cwd_user.email_address LIKE '%@%' ) domains GROUP BY DOMAIN ORDER BY COUNT desc;

Oracle

1 2 3 4 5 6 7 8 9 SELECT DOMAIN, COUNT(*) as COUNT FROM ( SELECT SUBSTR(cwd_user.email_address, INSTR(cwd_user.email_address, '@', -1) + 1) as DOMAIN FROM cwd_user INNER JOIN cwd_directory cd ON cd.id = cwd_user.directory_id WHERE cd.active = 1 ) GROUP BY DOMAIN ORDER BY COUNT Desc;

Work with the security team to assess each email domain. Email domains should be classified as "not trusted" only if the security team is

  • concerned about the origin of a domain and user emails using it.

  • If they are unable to trust the organization that creates emails using that domain.

If the security team doesn’t have any concerns about the domain, then it should be considered "Trusted".

For each domain, if you find that it is necessary to investigate the emails using them, we recommend listing all users using that domain from the following:

    • In Jira: Administration console > Users menu > List users tab

    • In Confluence: Administration console > User Management tab > Users menu

Updated on April 17, 2025

Still need help?

The Atlassian Community is here for you.