# Assignment 8 work log ## 2026-11-04 baseline - Starting repository main: 10c85ea (Assignment 7 manual 1.9.2 merge). Working branch: assignment8/secure-delivery. - Existing Gitea, Jenkins, Caddy, and four monitoring containers observed running. Docker 29.8.1; Compose 5.5.1; architecture x86_64. - Jenkins controller is containerized; no dedicated agent found in initial inspection. Ansible core 2.22.0 and community.docker 5.0.4 installed under persistent Jenkins home. Python venv system package installed in running container; container recreation provisioning still needed. Controller must not be used for assessed deployment. - Starter v1 unit tests: 3 passed locally and inside isolated Jenkins Python 3.13 environment. Exact direct/transitive versions recorded in requirements.txt. - pip-audit against pinned requirements reported no known vulnerabilities at time of check. This does not establish image or secret scan status; retain a formal report in pipeline. - Python 3.13 slim base digest pinned to sha256:ae14d4ce8771606477a81446e7ef429edd6762305fc50c84507c1041fa8285d1 (linux/amd64). Local baseline image built with APP_COMMIT=baseline-test; this is not an assessed release or registry digest. - Droplet baseline: 961 MiB RAM, 270 MiB available and 840 MiB swap used at inspection. Recheck before adding services. - No staging/production deployment, approval, image publication, controlled failure, or rollback has been performed. ## Agent setup - Created Jenkins permanent node assignment8-trusted with one executor and label-only scheduling. An official inbound-agent container connects through the existing private Docker network using WebSocket and a protected secret file. Agent logs reported Connected. No Docker socket or deployment credentials were granted. - Built a draft agent Dockerfile with Python, Docker and Ansible, but image packaging stalled while the host reported all 1 GiB swap in use; the build was interrupted to avoid overloading existing services. The Dockerfile is not yet validated: the Docker collection was installed under root and must be moved to a location readable by the Jenkins user. The running agent remains the original image and does not yet have Python, Docker or Ansible. No agent job has been verified. ## Agent progress after swap increase - Total swap verified at 2 GiB. Agent image built and connected; Python 3.13.5, Ansible core 2.22.0 and community.docker 5.0.4 verified as Jenkins user. Docker CLI 26.1.5 installed in running container; Dockerfile corrected to include docker-cli but requires rebuilding and recreation to persist that change. No Docker socket or deployment credentials have been added. A Jenkins job has not yet been run on the agent. - Corrected agent image built as assignment8-jenkins-agent:2 and agent reconnected on 2026-11-04. Python 3.13.5 and Docker CLI 26.1.5 observed in recreated container. Ansible and community.docker were verified in previous image with identical installation steps; recheck after recreation. No Docker socket, deployment credential, or Jenkins test job yet. ## Agent Jenkins verification - Jenkins job assignment8-agent-check build #1 failed during pipeline parsing because the initial one-line declarative script lacked section separators; no agent work occurred. Corrected script and reran. Build #2 succeeded on assignment8-trusted and verified Python 3.13.5, Git 2.47.3, Docker CLI 26.1.5, Ansible core 2.22.0, and community.docker 5.0.4. Evidence: https://ci.myfileagent.tech/job/assignment8-agent-check/2/console . Docker daemon access and deployment credentials remain unconfigured. ## Validation preparation - Ansible syntax check passed on assignment8-trusted against the starter playbook on 2026-11-04. The inventory and release records still contain placeholders; syntax success is not deployment. Added a separate draft validation Jenkinsfile for tests and syntax checks; it has not been run in Jenkins. ## Gitea-backed validation - Published branch assignment8/secure-delivery at 242372e381ecbcab4078e7d8c0916073d600d970. Jenkins assignment8-validation build #1 checked out that commit on assignment8-trusted, passed all 3 v1 unit tests and passed Ansible syntax check. Evidence: https://ci.myfileagent.tech/job/assignment8-validation/1/console . This does not demonstrate deployment, security gates, or image publication. ## Initial image security checks - User approved host Docker daemon access for the label-restricted trusted agent; its connection was verified. This access is effectively host administration. Agent-built test image succeeded with placeholder identity, not a release. - Trivy 0.69.1 scan of the Debian slim test image failed the HIGH/CRITICAL gate: 45 Debian and 5 Python findings. A pinned Python Alpine candidate had no OS findings but 5 Python tooling findings. After removing pip and ensurepip bundled wheels from runtime, the candidate scan reported zero HIGH/CRITICAL findings, exit 0, at the time of scan. Reports are in server evidence/assignment8; rescan the actual release image and archive results. - Isolated candidate smoke test initially ran before startup and got connection refused; after allowing startup, health was ok, v1 identity returned development placeholder, and quantity 3 returned 30. No production deployment occurred. - Trivy 0.69.1 secret scanner standalone test: an example-format fixture was ignored (exit 0), then a newly generated disposable private-key fixture produced one finding and exit 1. Both fixture files were removed. This proves scanner behavior only; a blocked Jenkins pipeline run remains required. ## Jenkins synthetic secret gate - Jenkins assignment8-secret-gate-demo #4 detected one generated disposable private key and failed with scanner exit 1; the job removed the fixture. Earlier attempts #1-3 failed due to transfer or job-script errors, not secret detections. Evidence: https://ci.myfileagent.tech/job/assignment8-secret-gate-demo/4/console . Prepared source-controlled security pipeline; it has not yet been run. ## Jenkins security validation build #2 - Jenkins assignment8-validation #2 checked out commit 28d13ef5b8757645bee640ca1dd9a8eea417ce18 on assignment8-trusted. Three unit tests, pip-audit, v1 application-source secret scan, Ansible syntax, image build and HIGH/CRITICAL image scan all passed; image JSON report was archived. Evidence: https://ci.myfileagent.tech/job/assignment8-validation/2/console . Agent briefly disconnected and reconnected during syntax check; build completed successfully. This was a test image, not a registry-published or deployed release. Secret scan currently covers v1 source, not the entire repository. - Added .test-venv to Docker ignore after observing a 47 MB test environment in the build context; this change has not yet run in Jenkins. - At inspection, staging.myfileagent.tech and app.myfileagent.tech did not resolve via the Droplet resolver. Existing Caddy routes serve Gitea, Jenkins and Grafana; no pricing routes added yet. - Expanded secret scan to the checked-out repository (excluding Git metadata, disposable test environment and generated reports); direct agent test returned zero findings and exit 0. This change still requires a Jenkins run after publication. ## Jenkins validation #3 and deployment preparation - Jenkins assignment8-validation #3 succeeded for commit dd7c12c519b14f59d9842ebd6d417e7117d92e94, including tests, dependency audit, expanded repository secret scan, Ansible syntax, image build and HIGH/CRITICAL image scan; report archived. Evidence: https://ci.myfileagent.tech/job/assignment8-validation/3/console . Build context was 7.68 kB after excluding test venv. - Verified agent-to-host private SSH gateway 172.20.0.1 matches the host ED25519 fingerprint SHA256:CXrEv4+pv1jTwBtwxdTGlouS6I4H1Q6TkKbvQrbacu0. Prepared inventory and verified public known_hosts entry; dedicated account and Jenkins SSH credential are not yet configured. Prepared private deployment key and a reviewable administrator setup script, not yet executed. Gitea registry endpoint returns 401 as expected for authentication; registry push/pull has not been verified. ## Deployment access and DNS verification - On 2026-11-04, a8deploy account existed. Both staging.myfileagent.tech and app.myfileagent.tech resolved to 142.93.193.110 via Droplet resolver. From assignment8-trusted, SSH using the dedicated private key and pinned host key returned uid 1001; sudo -n id returned root. The test key was removed from the agent after verification. Passwordless sudo grants host-administrator access. No Jenkins SSH credential configured yet. - Prepared Caddy route and v1 release-record templates; neither route nor application deployment has been applied. Registry endpoint requires authentication; no registry package-write or package-read credential has been verified. ## Jenkins deployment credential - With explicit team approval for Global scope, created Jenkins credential assignment8-deploy-ssh for a8deploy. It permits host-administrator access through the deployment account. A temporary key copy on the controller was removed after credential creation; credential binding still needs a Jenkins job verification. - Jenkins assignment8-validation #4 successfully bound the approved assignment8-deploy-ssh credential on assignment8-trusted, verified pinned SSH host key, connected as a8deploy, and confirmed noninteractive root sudo. Evidence: https://ci.myfileagent.tech/job/assignment8-validation/4/console . Job currently points to Jenkinsfile.ssh-check; restore security validation before further security runs. Registry endpoint requires authentication and no Jenkins package-specific credential was found. ## Registry authentication - Jenkins assignment8-registry-check #1 authenticated to myfileagent.tech using assignment8-registry-write, with a temporary Docker config removed at job exit. Evidence: https://ci.myfileagent.tech/job/assignment8-registry-check/1/console . Login alone does not prove permission to publish to the myfileagent organization or target-host pull access. - Restored assignment8-validation job configuration to Jenkinsfile.security after SSH check. Registry login #1 succeeded using a temporary Docker config, which the job removed. The glovely credential can authenticate, but organization package write and target-host read remain unverified. ## Proxy preparation - Validated and reloaded existing Caddy configuration with staging.myfileagent.tech -> pricing-staging:8000 and app.myfileagent.tech -> pricing-production:8000. Saved previous configuration at /home/codex/myfileagent-gitea/Caddyfile.before-assignment8. Gitea, Jenkins and Grafana HTTPS login routes returned 200 with certificate validation. New staging and app HTTPS endpoints returned 502 with certificate validation successful, expected before app containers exist. One initial staging DNS lookup timed out; retry reached HTTPS. - Jenkinsfile.release.draft is untested and not enabled. It requires reviewed source on protected main, package publication rights, target registry authentication, scan and deployment validation before operational use.