Class: Clickwrap::Doctor

Inherits:
Object
  • Object
show all
Defined in:
lib/clickwrap/doctor.rb

Overview

bin/rails clickwrap:doctor — a read-only diagnosis you can act on at 03:00.

✓ 6 policies compiled
✓ all referenced documents are published and digest-verified
✓ every required gate has a remediation route
✓ request-derived personal data is off by default
! withdrawal_authorization records IP geolocation city without a review date
! request-source trust is unverified
✓ no overdue disposition
✓ all checked event digests verify

============================================================================

EVERY FINDING HERE IS AN OBJECTIVE FACT ABOUT CONFIGURATION OR DATA. This class must never print, return, or imply "compliant", "court-proof", "audit guaranteed", "approved", or "certified", and there is no overall verdict line: a run with no warnings means the specific things listed below were checked and nothing objectionable was found in them. It does not mean the application is lawful, that its retention periods are right, or that its evidence would persuade anyone. Those are not questions a library can answer, and a green tick that implied otherwise would be worse than no tool at all. PHRASES_THIS_REPORT_NEVER_PRINTS exists so a test can assert it.

Defined Under Namespace

Classes: Finding

Constant Summary collapse

SYMBOLS =
{ ok: "", warning: "!", problem: "" }.freeze
PHRASES_THIS_REPORT_NEVER_PRINTS =

Greped by the release test against every message this class produces.

(
  Vocabulary::PROHIBITED_CLAIM_PHRASES + [
    "compliant",
    "compliance",
    "court proof",
    "audit guaranteed",
    "audit approved",
    "certified",
    "approved",
    "enforceable",
    "legally valid"
  ]
).freeze
DIGEST_SAMPLE_SIZE =

How many recent events get their digests recomputed. A doctor run is something an operator does interactively, so it samples rather than verifying the whole table; clickwrap:verify is the exhaustive one.

100

Instance Method Summary collapse

Instance Method Details

#reportObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/clickwrap/doctor.rb', line 57

def report
  findings = []
  findings.concat(policy_findings)
  findings.concat(document_findings)
  findings.concat(optional_table_findings)
  findings.concat(engine_mount_findings)
  findings.concat(gate_findings)
  findings.concat(request_evidence_findings)
  findings.concat(review_date_findings)
  findings.concat(resolver_findings)
  findings.concat(source_trust_findings)
  findings.concat(with_database("disposition") { disposition_findings })
  findings.concat(with_database("legal holds") { legal_hold_findings })
  findings.concat(with_database("event digests") { digest_findings })
  findings.concat(with_database("integrity attestations") { integrity_attestation_findings })
  findings.concat(with_database("external actions") { external_action_findings })
  findings
end

#to_sObject

The README's rendering: one line per finding, in the order they were produced, with nothing summarizing them into a verdict.



78
# File 'lib/clickwrap/doctor.rb', line 78

def to_s = report.join("\n")