How to add "rel" attributes to all external links throughout the website?
By implementing hook_link_alter in either a custom module or your theme.
The code (untested) would be similar to:
/**
 * Implements hook_link_alter().
 */
function MODULE/THEME_link_alter(&amp;$variables) {
  if (isset($variables['options']['attributes']['target']) &amp;&amp; $variables['options']['attributes']['target'] == '_blank') {
    $variables['options']['attributes']['rel'] = 'noopener noreferrer';
  }
}