In the modern enterprise, DevOps platforms such as Azure DevOps have evolved far beyond their initial role as simple software development and IT operations tools. They now represent the core of critical business infrastructure—the digital factory responsible for building, testing, and deploying an organization's most valuable applications and services. This central role has not gone unnoticed by malicious actors. The focus of sophisticated attacks has shifted from merely compromising production applications to targeting the very supply chain that creates them. By attacking the DevOps pipeline, adversaries can achieve objectives with a far greater blast radius, including the injection of malicious code, the theft of privileged credentials for lateral movement across an organization's cloud
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dateadded (UTC),URL,URL_status,Threat,Host,IPaddress,ASnumber,Country | |
"2022-06-17 08:58:04","http://194.230.107.25:33508/mozi.m","online","malware_download","194.230.107.25","194.230.107.25","6730","CH" | |
"2022-06-16 11:00:05","http://179.43.155.137/fjgD555c3/Plugins/cred.dll","online","malware_download","179.43.155.137","179.43.155.137","51852","CH" | |
"2022-06-15 18:19:05","http://179.43.175.187/yjqf/gdk.exe","online","malware_download","179.43.175.187","179.43.175.187","51852","CH" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
".xyz" | |
".ci" | |
".mw" | |
".surf" | |
".sx" | |
".cn" | |
".top" | |
".gq" | |
".ml" | |
".cf" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------ | |
# 1. Dictionary Creation | |
# ------------------------ | |
# Method 1: Literal syntax | |
person = {"name": "Alice", "age": 30} | |
# Method 2: Using dict constructor | |
person = dict(name="Bob", age=25) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httpx | |
from abc import ABC, abstractmethod | |
class APIClient(ABC): | |
def __init__(self, base_url: str, client_id: str, client_secret: str): | |
self.base_url = base_url | |
self.client_id = client_id | |
self.client_secret = client_secret | |
self.token = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
# Initialize parser | |
parser = argparse.ArgumentParser(description="Example argument parser") | |
# Add arguments | |
parser.add_argument("--name", type=str, help="Your name") | |
parser.add_argument("--age", type=int, help="Your age", required=True) | |
parser.add_argument("--verbose", action="store_true", help="Enable verbose mode") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def write_raw_markdown(markdown_content: str, file_path: str) -> None: | |
"""Writes a string of raw markdown directly to a file. | |
This function takes a pre-formatted markdown string and saves it to | |
the specified file path. It will overwrite the file if it already | |
exists. | |
Args: | |
markdown_content (str): The raw markdown string to be written. | |
file_path (str): The full path for the output markdown file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import errno | |
from pathlib import Path | |
from typing import Union | |
def create_folder_if_not_exists(root_folder: Union[str, Path], new_folder_name: str) -> Path: | |
""" | |
Creates a folder within a specified root directory if it doesn't already exist. | |
This function is designed to be safe and idempotent. It first checks for the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
from pathlib import Path | |
from typing import Union, List, Dict, Optional | |
def list_files_in_directory( | |
root_folder: Union[str, Path], | |
file_extensions: Optional[List[str]] = None | |
) -> Dict[str, str]: | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Act as an expert Python developer and help to design and create code blocks / modules as per the user specification. | |
RULES: | |
- MUST provide clean, production-grade, high quality code. | |
- ASSUME the user is using python version 3.9+ | |
- USE well-known python design patterns and object-oriented programming approaches | |
- MUST provide code blocks with proper google style docstrings | |
- MUST provide code blocks with input and return value type hinting. | |
- MUST use type hints | |
- PREFER to use F-string for formatting strings |
OlderNewer