Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api_app/analyzers_manager/file_analyzers/capa_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

import requests
from django.conf import settings
cache_dir = Path(settings.MEDIA_ROOT) / "capa_cache"
cache_dir.mkdir(parents=True, exist_ok=True)

os.environ["XDG_CACHE_HOME"] = str(cache_dir)

from api_app.analyzers_manager.classes import FileAnalyzer
from api_app.analyzers_manager.exceptions import AnalyzerRunException
Expand Down Expand Up @@ -41,6 +45,7 @@ def _download_signatures(cls) -> None:
shutil.rmtree(SIGNATURE_LOCATION)

os.makedirs(SIGNATURE_LOCATION)

logger.info(f"Created fresh signatures directory at {SIGNATURE_LOCATION}")

signatures_url = "https://api.github.com/repos/mandiant/capa/contents/sigs"
Expand Down Expand Up @@ -97,6 +102,11 @@ def update(cls, anayzer_module: PythonModule) -> bool:
def run(self):
try:

cache_dir = Path(settings.MEDIA_ROOT) / "capa_cache"
cache_dir.mkdir(parents=True, exist_ok=True)
os.environ["XDG_CACHE_HOME"] = str(cache_dir)


response = requests.get(
"https://api.github.com/repos/mandiant/capa-rules/releases/latest"
)
Expand Down
Loading