Microsoft Office Macro Security
Download ACSC Protect Notice Microsoft Office Macro Security (1MB PDF), updated December 2016
Table of contents
- Macros explained
- What are macros?
- How are macros verified and trusted?
- How to determine which macros to trust
- Securing systems against malicious macros
- Disable all macros
- Allow only macros from controlled trusted locations
- Allow only digitally signed macros
- Recommended approaches
- Further information
- Appendix A: Group policy settings
- Appendix B: Group policy settings grouped by individual Microsoft Office applications
- Microsoft Office applications can execute macros to automate routine tasks. However, macros can contain malicious code resulting in unauthorised access to sensitive information as part of a targeted cyber intrusion.
- This document has been developed by the Australian Signals Directorate (ASD) to introduce approaches that can be applied by organisations to secure systems against malicious macros while balancing both their business and security requirements.
- The names and locations of group policy settings used in this document are taken from Microsoft Office 2013; some slight differences may exist for earlier or later versions of Microsoft Office.
- The Australian Cyber Security Centre (ACSC) has seen an increasing number of attempts to compromise organisations using malicious macros.
- Adversaries have been observed using social engineering techniques to entice users into executing malicious macros in Microsoft Office files. The purpose of these malicious macros can range from cybercrime to more sophisticated exploitation attempts.
- By understanding the business requirements for the use of macros, and applying the recommendations in this document, organisations can effectively manage the risk of allowing macros in their IT environments.
What are macros?
- Microsoft Office files can contain embedded code (known as a macro) written in the Visual Basic for Applications (VBA) programming language.
- A macro can contain a series of commands that can be coded or recorded, and replayed at a later time to automate repetitive tasks. Macros are powerful tools that can be easily created by novice users to greatly improve their productivity. However, adversaries can also create macros to perform a variety of malicious activities, such as assisting to compromise workstations in order to exfiltrate or deny access to sensitive information.
How are macros verified and trusted?
- Microsoft Office has both trusted document and trusted location functions. Once trusted documents or trusted locations are defined, macros in trusted documents or macros in Microsoft Office files stored in trusted locations automatically execute when the Microsoft Office files are opened. While the use of trusted documents is discouraged, trusted locations when implemented in a controlled manner can allow organisations to appropriately balance both their business and security requirements.
- Microsoft Office applications allow developers to include information about themselves and their macro code by digitally signing their macros. The certificate that is used to create a signed macro confirms that the macro originated from the signatory, while the signature itself confirms that the macro has not been altered. Digital certificates can be self-generated by users, obtained from a commercial certificate authority or obtained from an organisation’s security administrator if they operate their own certificate authority.
How to determine which macros to trust
- To manage the use of macros within an organisation, all macros created by users or third parties should be reviewed by an independent party to the developer and assessed to be safe before being approved for use within the organisation.
- When assessing whether macros are safe or not, assessors should ask themselves the following questions:
- Is there a business requirement for a particular macro?
- Has the macro been developed or provided by a trusted party?
- Has the macro been validated by a trustworthy and technically skilled party?
- Has the macro been signed by an approved certificate authority?
Keep reading Securing systems against malicious macros in ACSC Protect Notice Microsoft Office Macro Security (1MB PDF).
The Australian Government Information Security Manual (ISM) assists in the protection of official government information that is processed, stored or communicated by Australian government systems.
The Strategies to Mitigate Cyber Security Incidents complements the advice in the ISM.
Australian government customers with questions regarding this advice can contact ASD Advice and Assistance.
Australian businesses and other private sector organisations seeking further information should contact CERT Australia.