Skip to content
System hardening
ASD ISMISM-1890

ASD ISM 1890 Ensure macros are free of malicious code

What it says

Microsoft Office macros are checked to ensure they are free of malicious code before being digitally signed or placed within Trusted Locations.

Quoted as published. Everything else on this page is written by Control Stack.

In plain English

Before any Microsoft Office macro is digitally signed or placed in a Trusted Location, check it for malicious code, including each new version.

Every Microsoft Office macro must be checked for malicious code before it is digitally signed or placed in a Trusted Location. Both steps can let a macro run without the usual blocks, because Office trusts macros signed by a trusted publisher and files in a Trusted Location, a folder it treats as safe. The check comes first every time, including for a new version of a macro already in use. Malicious code means instructions that do harm, such as downloading programs or sending data out.

Why it matters

Signing a macro with a trusted publisher's certificate, or placing it in a Trusted Location, lets Office run it without the usual blocks. If a malicious macro gets either treatment unchecked, the organisation's own trust settings run it wherever it is opened.

How to implement

  1. Make a passed check the only way into signing and Trusted Locations.

    Give the checking role to people who can read macro code, and let only them place files in Trusted Locations (ISM-1487) or use the signing certificate's private key. Where nobody in-house can read the code, use a specialist who can.

  2. Review every line of the macro's code before approving it.

    On an isolated workstation, extract every module, form and class, and the compiled code, with a macro analysis tool; files can hide code from the Visual Basic Editor. Look for code that runs on opening (such as AutoOpen), starts programs, calls external libraries, downloads files or hides text through encoding.

  3. Scan and test-run the macro in isolation.

    Scan the file with antivirus, then run the macro on a test machine with no access to production systems, watching for new processes, files, registry changes and network connections. Anything the code review or test cannot explain against the macro's stated purpose fails the check.

  4. Sign or place only the exact version that passed.

    Record the macro's name and version, who checked it, the date, the result and a copy of the checked code, then sign it or copy it into the Trusted Location. Any later change, even a small fix, goes back through the check before it is re-signed or replaced.

  5. Check supplier macros before you sign or place them.

    For a project locked against viewing, extract its code with your macro analysis tool, or check the supplier's unlocked copy and sign or place that copy. Trusting a supplier's own certificate lets its macros run without your check, so check them and, where you can, sign them with your own certificate.

Keep it running

Check a macro again whenever it changes, before it is re-signed or replaced, and before re-signing with a renewed certificate. Investigate any macro found in a Trusted Location or signed by the organisation that has no check record for its version.

Evidence and audit

  1. Check 1 of 3What an auditor asks for

    Ask for

    Every file in each Trusted Location, listed from the folders themselves; every macro signed with the organisation's certificate, from a search of shared folders and any signing log; and the check records for all of them.

    Look at

    Whether each macro has a check record for the same version, dated before it was signed or placed.

    Good evidence

    Every macro found in a Trusted Location or signed by the organisation has a passed check for that exact version, dated before the signing or placement, with none missing.

  2. Check 2 of 3What an auditor asks for

    Ask for

    A harmless test macro that starts a command shell or contacts an external address, submitted through the normal checking process.

    Look at

    Whether the check finds the behaviour and what happens to the macro.

    Good evidence

    The check identifies the behaviour and fails the macro, and it is neither signed nor placed in a Trusted Location.

  3. Check 3 of 3What an auditor asks for

    Ask for

    The check records for a sample of approved macros, and an interview with the people who did them.

    Look at

    What each check covered and whether the checker can explain what the macro does.

    Good evidence

    Each sampled record shows the full code of that version was checked for malicious code before signing or placement, and the checker can explain each call that starts programs, reaches the network or writes files.

Mappings

Closest match in ASD Essential Eight: E8-RM-ML3.2, Check Microsoft Office macros for malicious code before signing or trusting, which asks for the same thing.

ISO 27001

ISO/IEC 27001: 1 mapping

  • A.8.7Protection against malwarePartially meets
Essential Eight

ASD Essential Eight: 3 mappings

Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.