def analyze_entry(self, entry: dict):
        """Analyzes an entry as specified in the lolbas json."""
        try:
            created = datetime.strptime(entry["Created"], "%Y-%m-%d")
        except ValueError as error:
            logging.error("Error parsing lolbas %s: %s", entry["Created"], error)
            created = datetime.strptime(entry["Created"], "%Y-%d-%m")

        description = (
            f"{entry['Description']}\n\n{self.format_commands(entry['Commands'])}"
        )
        tool = entity.Tool(
            name=entry["Name"], description=description, created=created
        ).save()
        entity_slug = entry["Name"].lower().replace(".exe", "")
        tool.tag([entity_slug, "lolbas"])

        tags = set([cmd["Category"].lower() for cmd in entry["Commands"]])
        tags.add("lolbas")
        tags.add(entity_slug)

        for filepath in entry["Full_Path"]:
            if filepath["Path"] in ("", "no default"):
                continue
            if patterns := LoLBAS._PATH_PATTERN.findall(filepath["Path"]):
                logging.info(
                    f"{filepath['Path']} contains {patterns}, switch to regex indicator"
                )
                indicator_name = f"LoLBAS - {entry['Name']}"
                fpath_pattern = (
                    filepath["Path"].replace("\\", "\\\\").replace(":", "\:")
                )
                for pattern in patterns:
                    fpath_pattern = fpath_pattern.replace(pattern, ".+?(?=\\\)")
                try:
                    indicator_obj = indicator.save(
                        name=indicator_name,
                        type="regex",
                        pattern=fpath_pattern,
                        diamond="capability",
                    )
                except Exception:
                    logging.exception(f"Failed to save indicator: {indicator_name}")
                    continue
                tool.link_to(
                    indicator_obj,
                    relationship_type="located_at",
                    description=description,
                )
            else:
                try:
                    path_obj = observable.save(
                        value=filepath["Path"], type="path", tags=list(tags)
                    )
                except Exception:
                    logging.exception(f"Failed to save path: {filepath['Path']}")
                    continue
                self.add_feed_context(path_obj, {"reference": entry["url"]})
                tool.link_to(
                    path_obj, relationship_type="located_at", description=description
                )

        for detection in entry["Detection"] or []:
            if "Sigma" in detection:
                try:
                    self.process_sigma_rule(tool, detection)
                except Exception as error:
                    logging.error(
                        "Error processing sigma rule for %s: %s", entry["Name"], error
                    )
Analyzes an entry as specified in the lolbas json.
plugins/feeds/public/lolbas.py