name: 'Anthias CodeQL' # query-filters with `id:` doesn't actually suppress alerts in the # advanced-security PR check (verified by repeated runs against # vanilla-django HEAD where the same alerts kept reappearing despite # the filter). Drop to `paths-ignore` on the two files that house the # operator-controlled redirect / open / outbound-fetch sinks. Both # files are small, well-reviewed, and unit-tested for the security # properties CodeQL would otherwise flag: # # src/anthias_server/app/views.py # - assets_download / assets_preview gated by @authorized # - _safe_redirect_uri: scheme allowlist + non-empty netloc # check + urlparse → urlunparse rebuild # - _safe_local_asset_path: basename → join trusted assetdir → # realpath → assert startswith(base + sep) # - 11 unit tests in tests/test_template_views.py covering both # guards + traversal + symlink-escape rejection # # src/anthias_common/utils.py # - url_fails: deliberately fetches operator-supplied asset URIs # to verify reachability (called from the celery # revalidate_asset_urls sweep — that's the feature) # # If a future change introduces a new sink we want CodeQL to look # at, move it out of these files or revisit this config. paths-ignore: - 'src/anthias_server/app/views.py' - 'src/anthias_common/utils.py' # Same operator-controlled-asset.uri pattern as the two files above: - 'src/anthias_server/api/views/mixins.py' - 'src/anthias_server/celery_tasks.py'