You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bbed258
Browse filesBrowse the repository at this point in the historyBrowse files
A site's code reading steers the curated rules and the open route check.
When the repositories behind a site are removed, or stop cloning, the next
scan reads fewer routes or none, and nothing said so: the scan looked the
same with less behind it.
Each scan now compares its code reading with the site's earlier scans.
When it reads fewer routes and a repository that gave routes before gives
none now, the code reading row turns to a warning naming it and why:
removed from the site (by whom and when), no longer linked, linked again,
or still linked but unread (a clone that took too long, for one).
A removed repository only counts when an earlier scan showed it really was
behind the site: the host written in its code, or the site answering one
of its routes. A link made on a loose name match has neither, and removing
it is the cleanup working, so it is not reported.
The site page shows the warning above the code section, with Use it again
for a removed repository, naming only repositories the viewer can see. The
list counts the sites that lost their code and filters to them. The answer
is kept on the site at the end of each scan, worked out once for sites
scanned before, and cleared when a site's links change.
Copy file name to clipboardExpand all lines: app/web/templates/external.html
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@
42
42
<aclass="stat bad" href="{{ here }}?risk=high"><divclass="n">{{ totals.dast_bad }}</div><divclass="l">Critical or high on the last scan</div></a>
43
43
<aclass="stat" href="{{ here }}?scope=mapped"><divclass="n">{{ totals.mapped }}</div><divclass="l">Mapped to code</div></a>
44
44
<aclass="stat" href="{{ here }}?scope=no-scan"><divclass="n">{{ totals.no_scan }}</div><divclass="l">No scan</div></a>
45
+
{% if totals.code_lost %}<aclass="stat warn" href="{{ here }}?scope=code-lost" title="An earlier scan read routes from code that the newest scan did not"><divclass="n">{{ totals.code_lost }}</div><divclass="l">Lost their code</div></a>{% endif %}
45
46
</div>
46
47
<divdata-live="list-notices">
47
48
{% if running %}<divclass="notice info"><div>Reading telemetry for {{ running }} site{{ '' if running == 1 else 's' }}. The list updates as they finish.</div></div>{% endif %}
@@ -77,7 +78,7 @@
77
78
{% for k, l in exposures.items() %}<optionvalue="{{ k }}" {{ 'selected' if k == exposure}}>{{ l }}</option>{% endfor %}</select></div>
{% for v, l in [('mapped','Mapped to a repository'),('unmapped','Not mapped'),('no-scan','No scan')] %}<optionvalue="{{ v }}" {{ 'selected' if v == scope}}>{{ l }}</option>{% endfor %}</select></div>
81
+
{% for v, l in [('mapped','Mapped to a repository'),('unmapped','Not mapped'),('no-scan','No scan'),('code-lost','Lost their code')] %}<optionvalue="{{ v }}" {{ 'selected' if v == scope}}>{{ l }}</option>{% endfor %}</select></div>
{% for l in linked %}{% for level in code %}{% set _ = code.update({level: code[level] + counts.get(l.full_name, {}).get(level, 0)}) %}{% endfor %}{% endfor %}
380
+
{% if code_lost %}
381
+
<divclass="notice warn" id="code-lost"><div>
382
+
<strong>The code behind this site was lost.</strong>
383
+
Scan {{ code_lost.before_scan_id }} read {{ code_lost.before_routes }} routes from the code; the newest, scan {{ code_lost.scan_id }}, read {{ code_lost.routes }}.
384
+
The routes steer the curated rules and the open route check, so they had less to go on.
385
+
{% if code_lost.repos %}<divclass="table-scroll"><tableclass="compact">
386
+
<thead><tr><th>Repository</th><th>Routes it gave</th><th>Now</th><th></th></tr></thead><tbody>
387
+
{% for r in code_lost.repos %}<tr>
388
+
<tdclass="small">{% if r.repository_id %}<ahref="{{ base }}/repositories/{{ r.repository_id }}">{{ r.repository }}</a>{% else %}{{ r.repository }}{% endif %}</td>
389
+
<tdclass="small">{{ r.routes }} in scan {{ r.scan_id }}</td>
390
+
<tdclass="small">{{ r.detail }}{% if r.evidence %}<divclass="faint">Behind the site before: {{ r.evidence }}.</div>{% endif %}</td>
391
+
<tdclass="nowrap">{% if can_manage and r.state in ('hidden', 'unlinked') %}
392
+
<formmethod="post" action="{{ base }}/external/{{ asset.id }}/repos" style="display:inline">
0 commit comments