Ceci est une ancienne révision du document !
In next month's article, I will discuss the use of macros as functions, but before I do, I must discuss macro security. While macros are a powerful tool when used properly, macros can contain code that is harmful to the data on your computer. Through the years, documents with macros have been the transfer method for many computer viruses. With a little caution and a few settings, you can minimize the chances of your computer getting a virus from document macros.
Dans l'article du mois prochain, je présenterai l'utilisation de macros comme fonctions, mais avant de la faire, je dois impérativement présenter la sécurité dans les macros. Bien que les macros soient un outil puissant quand elles sont bien utilisées, elles peuvent contenir du code dangereux pour les données de votre ordinateur. Depuis des années, les documents avec macros ont été la méthode pour transférer de nombreux virus d'ordinateur. Avec un peu d'attention et quelques réglages, vous pouvez minimiser les risques que votre ordinateur attrape un virus à partir des macros des documents.
Security Levels Open the macro security settings through the menus: Tools > Options > Security > Macro Security (button). LibreOffice has four different macro security levels that cover security – from no restrictions to highly restrictive. Each level has its merits. Let's look at each one in detail. Low: This is the “Off” level. All macros are executed without prompting. They can run without you knowing, and they can damage your files and settings. It's like walking through a snake pit in your bare feet: you will get bitten. The only way this level would ever make sense is on a computer that is completely isolated from the Internet and never opens a file that was not created on that computer. Not very likely. Medium: This level is the “Are you sure?” level. With medium level protection, the document will run macros if it comes from one of the trusted sources, discussed below, without any prompting. If the document is not from a trusted source, LibreOffice will prompt you about whether to run the macros in the document. You have the choice: Yes or No. I have recommendations later about how to make this decision. High: This is the “hands off” level. Only signed macros from a trusted source, or macros from trusted file locations, are allowed to run. All others will have their macros disabled. You have no choice; you are never prompted. This is a level where you don't want the end users making the decisions, but you want LibreOffice to make the decision for them. Very High: This is the “paranoid” level. Only files from trusted file locations can run macros. Again, you are not prompted or given a choice. If the file doesn't come from a trusted file location, the macros are disabled. This is the most locked-down, don't-trust-nobody level there is. If you think the world is out to steal your identity and know all your secrets, you might be right, and this is the level for you.
Niveaux de sécurité
Ouvrez les réglages de sécurité des macros dans le menu : Outils > Options > LibreOffice > Sécurité > Sécurité des macros… (bouton). LibreOffice a quatre niveaux différents de sécurité des macros qui traitent de sécurité - d'aucune restriction à très restrictif. Chaque niveau a ses avantages. Regardons chacun en détail.
Faible : C'est le niveau « Sans sécurité ». Toutes les macros sont exécutées sans poser de question. Elles peuvent tourner sans que vous le sachiez, elles peuvent endommager vos fichiers et vos réglages. C'est comme marcher pieds nus sur un nid de serpents : vous serez mordus. Le seul cas où se niveau à un sens, c'est sur un ordinateur qui est complètement isolé d'Internet et sur lequel on n'ouvre jamais de fichier non créé sur cet ordinateur. Pas très réaliste.
Moyen : C'est le niveau « Êtes-vous sûr ? ». Avec le niveau de protection moyen, le document lancera une macro si elle vient d'une source sure - on en parlera plus bas - sans poser de question. Si le document ne vient pas d'une des sources sures, LibreOffice va vous demander si la macro peut être lancée dans le document. Vous avez le choix : Oui ou Non. Je vous donnerai plus tard des recommandations pour faire prendre votre décision.
Élevé : C'est le niveau « sans les mains ». Seules les macros signées provenant d'une source sure, ou des macros venant de “lieux de fichiers” sûrs, sont autorisées à tourner. Les macros de tous les autres fichiers seront désactivées. Vous n'avez pas le choix ; vous n'êtes jamais sollicité. C'est un niveau où vous ne voulez pas que les utilisateurs finaux prennent les décisions ; vous voulez que LibreOffice prenne la décision à leur place.
Très élévé : C'est le niveau « paranoïaque ». Seules les fichiers provenant de sources sures peuvent lancer des macros. A nouveau, vous n'êtes pas interrogé pour choisir. Si le fichier ne vient pas d'une source sure, les macros sont désactivées. C'est le plus verrouillé ; c'est le niveau « ne faites confiance à personne ». Si vous pensez que le monde entier cherche à vous voler votre identité et à connaître tous vos secrets, vous auriez raison, ce niveau est fait pour vous.
Trusted Sources The Trusted Sources tab allows you to identify the trusted sources for your documents. Certificates: Certificates are used to digitally sign documents. Certificates come from a certification authority. They are usually used on web sites and servers to authenticate the source. The installation of certificates is beyond the scope of this article, but to digitally sign a macro, Tools > Macros > Digital Signature. File Locations: No matter what level you use – except Low – I recommend you define at least one trusted file location. You need at least one place where you can run proven files with macros without having to OK a prompt. Don't use a location where you usually download files from email or the Internet. Use a location where you collect and save documents you need to keep. Sometimes, two or three locations are helpful. Also, make sure the location isn't too general, like your home folder.
Recommendations Never, ever use Low. No, I mean NEVER. Don't try to argue that you know what you are doing, and you have a firewall, anti-virus, and malware protection. Don't do it! No. No Low level setting. Go there now in your copy of LibreOffice and change it to something else. There. Now, don't you feel safer already? Now, we can calmly discuss the benefits of the other levels. Medium is my preferred setting. While it protects you, you also get the choice of making that decision for yourself. I recommend this setting for computers on your home network. The setting gives you protection, but does not take away your right to make a choice. If some computers are used by students, you will want to educate them on a good method for making the decision for documents from email and the Internet. Later I will offer you a method that I feel is useful. High and Very High are best reserved for office networks and computers used by younger students. Use these when you are locking down a computer where you want to limit the power of the end user. I see this in my line of work all the time. The company has the user's computer limited in what they can do to protect the company's investment in the computer and data. Sometimes, this is set according to the experience and necessity of the users. If you are the network administrator, you will need to make this decision for each user. As I said before, whatever level you decide to use, I recommend at least one trusted file location. In fact, for the Very High setting, you have no choice. Also, with file locations, you can avoid the need to sign the macros in every file with a security certificate.
You Are Your Best Tool The most important virus protection of all: the mushy gray matter between your ears. If you were not expecting a document to contain macros, then, maybe, you shouldn't allow the macros to run. Follow your instincts that developed in humans as a protective measure. Be the skeptic! If you have a feeling that something is not right, maybe something is not right. Take these steps when receiving a new file. Open the file from an untrusted file location, but do not allow the macros to run. Examine the macros in the document. If you have any questions about the macros, asks the person who sent the document. If they cannot give you a satisfactory answer as to why the macros are there, eliminate the document. Chances are, they are not your friend and do not have your best interest in mind (or their computer is infected with a virus). Yes, this may all sound a little paranoid, but better safe than losing time and data. If the document is clean (no macros) or the sender gives you a satisfactory reason for the macros, move the document to a safe file location. While macros are useful, people also use them for malicious purposes. LibreOffice provides you with four different levels of protection against malicious macros. You should never use the Low level setting, but the Medium level is good for most home computers and networks. High and Very High are good in office environments where you need to control the end users interaction. Always take precautions when dealing with documents coming from other people. Sometimes, people unknowingly pass on documents that contain malicious code.