rcapsule 0.6.0
Ecosystem Polish, Hex Logo & CRAN Finalization
- Added bespoke package hex logo (
man/figures/logo.png), liveR-CMD-check,pkgdown, andLicense: MITbadges, and cross-package Quantitative Research Suite links inREADME.md. - Polished CRAN metadata in
DESCRIPTION,inst/CITATION,_pkgdown.yml, and package documentation (removing redundant"for R"from the package title) and verified all package URLs viaurlchecker::url_check(). - Hardened
.github/workflows/pkgdown.yamlby adding explicitany::rmarkdownandany::tinytexdependencies and fail-fast exit-status andfile.exists()assertions for both standalone PDF builds (rcapsule-manual.pdfandrcapsule-guide.pdf).
rcapsule 0.5.1
Cross-Platform Windows & Linux CI Hardening
- Fixed a Windows UCRT locale bug in
build_sandbox_env()(R/verify.R) where setting POSIXLC_ALL = "C.UTF-8"/LANG = "C.UTF-8"downgraded Windows child R sessions to a non-UTF-8"C"locale, altering RDS v3 header bytes during exactSHA-256verification of.rdsartifacts. - Fixed
build_docker_run_args()(R/verify.R) to permit valid Windows drive-letter prefixes (C:\.../C:/..., slash-normalized for Docker mounts) while still rejecting any:elsewhere insandbox_dir. - Hardened
canonical_real_dir(),path_is_within_root(), andrel_path()(R/security.R,R/utils.R) for Windows 8.3 short paths (RUNNER~1vs. long usernames), backslash normalization, and case-insensitive drive path comparisons. - Hardened cross-platform test fixtures in
tests/testthat/against Linux host platform/R version collisions (test-v030-workflows.R,test-v040-sbom-diagnose-handoff.R), Windows text-mode CRLF line-ending translation (test-v040-sbom-diagnose-handoff.R), Windows NTFS illegal filename characters (test-peer-redteam.R), and unprivileged Windows symlink creation (test-adversarial-security.R).
rcapsule 0.5.0
Security Hardening & Independent Peer Red-Team Remediation
Remediated all 16 confirmed findings (1 critical, 7 high, 6 medium, 2 low) from an independent peer red-team security, accuracy, and cross-package interop audit, with permanent regression coverage in tests/testthat/test-peer-redteam.R:
-
Eliminated
cli/gluetemplate injection (CRITICAL-1): Wrapped all dynamic messages acrossprint.rcapsule_lint(),print.rcapsule_verification(),print.rcapsule_diagnosis(),print.rcapsule_diff(),print.rcapsule_integrity(), andprint.rcapsule_scan()in single-level{...}placeholders so untrusted container specs,renv.lockentries,capsule.jsonfields, or diff diagnostics can never execute arbitrary R expressions during printing; also enforced strict version validation inparse_renv_lock(). -
Sealed sandbox
.Renviron,.Rprofile,.netrc, andHOMEisolation (HIGH-1): Updatedstage_clean_sandbox()to exclude.Renviron,.Rprofile,.env,.env.*, and.netrc; updatedbuild_sandbox_env()to bind an isolated temporaryHOME(.rcapsule_home) and neutralizeR_ENVIRON_USER,R_ENVIRON,R_PROFILE_USER,R_PROFILE, andNETRC; passeduser_profile = FALSE,system_profile = FALSE, andcmdargs = c("--no-environ", "--no-init-file")tocallr::rscript(). -
Stripped plaintext Git remote credentials (
HIGH-2): Addedsanitize_git_remote_url()indetect_git_info()to strip embedded HTTP(S)userinfo@tokens and SCP passwords before recordingscan$git$remote, writingcapsule.json, or exporting archival supplement bundles. -
Closed silent false-positive verification gaps in
compare_artifacts()(HIGH-3): Switchedcompare_data_frames()to positional column indexing (catching duplicate CSV/TSV column names), checkeddim()/names()/dimnames()on non-numeric matrices/arrays, compared factorlevels()andis.ordered(), checkeddata.framerow.names,POSIXttzone, and S3 listclasswhenignore_attributes = FALSE, and distinguished empty JSON objects ({}) from empty JSON arrays ([]). -
Closed PCRE
$trailing-newline bypasses (HIGH-4): Replaced^...$with\A...\zplus explicit ASCII control-character rejection across allR/security.Rvalidators (includingenv_varsnames) andR/sbom.RUUID/PURL/timestamp/hash validators. -
Hardened
rcapsule<-> HPC orchestrator interop (HIGH-5): Updatedas_apptainer_spec()to return classc("rcapsule_apptainer_spec", "rcapsule"), expose bothbind_paths/binds, bothdef_sha256/content_digest, an always-populatedsif_path, anddef_pathpreservation across all overrides (includingcran_repo,quarto_version,cmdstan_version, and optionaloutput); alignedcompile_apptainer()return fields accordingly. -
Hardened Docker verification CLI arguments (
HIGH-6): Validateddocker_imageanddocker_tagviavalidate_docker_image_ref(), rejected:insandbox_dirvolume mounts, and added--network=none,--cap-drop=ALL,--security-opt=no-new-privileges:true, andRscript --vanillainbuild_docker_run_args(). -
Fixed higher-order AST scanning crash (
HIGH-7): Guardedparse_r_code_signals()withis.symbol(fn[[1L]])and recursed into call heads so idioms likescales::col_numeric("Blues", c(0, 1))(0.5)parse cleanly and extract the package dependency. -
Expanded ambient secret scrubbing (
MEDIUM-1): Extendedsecret_env_var_patterns()to scrubAPIKEY,_PASS,_PWD,DATABASE_URL, database_(URL|URI|DSN|PASS|PWD|TOKEN|KEY)vars,CONN_STR,PGPASSFILE,NETRC,AUTHORIZATION,JWT,KUBECONFIG,PAT_*, and(SSH|HMAC|S3|GROQ|COHERE|...)_KEYvariables. -
Hardened Compose volume validation, registry-port pinning, and service-name collision guards (
MEDIUM-2,MEDIUM-3,MEDIUM-4): Normalized host path slashes and blocked sensitive host mounts (/,/etc,/root,/proc,/sys,/dev,/var/run,/run,docker.sock,podman.sock) plus malformed mounts invalidate_compose_volume()andlint_container_spec(); centralizedhas_pinned_image_tag_or_digest()across Dockerfile, Compose, and Apptainer compilers/linters so registry ports (localhost:5000/img) cannot bypass pinning; aborted cleanly whenservice_namecollides with enabledworkerorproxycompanion services. -
Hardened Markdown/HTML escaping (
MEDIUM-5): Escaped backticks (`) insanitize_markdown_cell()andsanitize_markdown_inline()to prevent code-span breakout in certificates and appliedsanitize_markdown_inline()toincluded_filesinREADME_REPRODUCE.md. -
Hardened CycloneDX SBOM parsing and validation (
MEDIUM-6): Preserved pip#egg=fragments inparse_requirements_txt(), handled PEP 508 environment markers, direct URLs, and VCS URLs cleanly inparse_pypi_spec()/export_sbom(), and guardedvalidate_sbom()against atomic JSON elements inhashesanddependencies. -
Fixed
renv.lockatomic entry resilience, secret.Rprofilecopying, andverify_with_script()coercion warning (LOW-1,LOW-2): Guardedparse_renv_lock()against atomic entries, skippedCOPY .Rprofile ./with a warning whensecret_in_rprofileis detected incompile_dockerfile(), and coerced named characterenv_varsto list before appendingRCAPSULE_AUDIT_ARGSinverify_with_script().
rcapsule 0.4.0
New Research-Workflow Capabilities (Zero New Dependencies)
- Added CycloneDX 1.5 Software Bill of Materials (SBOM) generation and validation via
export_sbom()andvalidate_sbom(). Enumerates R packages (pkg:cran/...,pkg:github/...,pkg:gitlab/...,pkg:bitbucket/...,pkg:bioconductor/...) withrenv.lockMD5 hashes, OSaptsystem libraries (pkg:deb/debian/...) linked to the R packages requiring them, Python packages (pkg:pypi/...), and compiled scientific toolchains (R,CmdStan,Quarto,TinyTeX,JAGS,TMB/RTMB,C++,Rust,Python,OpenJDK), cryptographically binding tocapsule.json’sSHA-256content digest when provided. - Added automated reproducibility drift diagnostics via
diagnose_reproducibility()(withprint()andsummary()methods) supporting bothverify_capsule()anddiff_capsules()outputs. Classifies root causes (hmac_signature_failure,manifest_tampering,execution_failurewithstderrclue parsing,input_drift,script_drift,missing_output,line_ending_driftdetecting exactCRLFvs.LFequivalence,schema_drift,binary_metadata_drift,monte_carlo_small_drift,unseeded_large_divergence,rng_drift,environment_or_arch_drift,unexpected_extra_artifacts,container_drift, andgit_revision_drift) into a severity-ranked tibble with actionable remediation steps. - Added zero-dependency ecosystem handoff hooks:
-
as_apptainer_spec()exports a structured, plain-list-convertible Apptainer descriptor (rcapsule_apptainer_spec) containing pinned base image,%environmentvariables, HPC bind mount paths,%runscript/%testcommands, and.defSHA-256digest for downstream HPC orchestrators. -
verify_with_script()executes arbitrary external or project-local.Raudit/verification scripts insidercapsule’s path-confined, ambient-secret-scrubbed isolated sandbox, returning exit status, duration,stdout/stderr, scrubbed env vars, created/modified artifactSHA-256digests, and expected-output checks.
-
Latent Bug Fixes & Coverage Hardening (covr)
- Fixed a false-positive equality bug in
compare_r_objects()andcompare_data_frames()wherefactorvs.integer(both sharingtypeof() == "integer") orcharactervs.numericcolumns could silently compare equal after character coercion. - Fixed a silent comparison gap in
compare_r_objects()for lists containing duplicate or partially empty names, switching to exact positional comparison so duplicate/unnamed elements are never skipped. - Fixed a macOS symlinked-root (
/var->/private/var) false security rejection inassert_confined_path(..., must_exist = TRUE)on non-existent confined absolute paths, and hardened parent-directory walks against dangling external symlinks (preventing uncaughtfs::dir_exists()ENOENTerrors). - Enhanced
compare_artifacts()anddiff_capsules()to detectCRLFvs.LFline-ending-only diffs and populate diagnostic numeric/structural drift details even under exact zero-tolerance checks. - Added a fifth executable vignette (
vignettes/sbom-and-supply-chain.Rmd) and lifted overall test coverage past 93% viacovr.
rcapsule 0.3.0
New Features & Real-World Hardening
- Added
diff_capsules()to compare twocapsule.jsonmanifests across machines or runs (e.g., author laptop vs. HPC cluster or peer reviewer), reporting R/OS/platform/package/sysreq/toolchain drift, RNG and Git changes, and exact vs. numeric-tolerance output shifts withprint()andsummary()methods. - Added
export_capsule_bundle()to packageDockerfile,docker-compose.yml,Apptainer.def,capsule.json, Markdown/HTML verification certificates, confined project files, and an auto-generatedREADME_REPRODUCE.mdpeer-review guide into a directory or zip-slip-safe ZIP archive viazip::zipr(). - Added cross-architecture
platform("linux/amd64","linux/arm64") support tocompile_dockerfile(),compile_compose(),build_capsule(), andexport_capsule_bundle(). - Added Posit Public Package Manager binary repository mode (
use_ppm = TRUE,ppm_distro,ppm_date) tocompile_dockerfile()for faster reproducible Linux container builds. - Expanded
scan_project()for real-world project edge cases:targetspipeline detection (_targets.R, emittingtargets::tar_make()in Dockerfiles/Apptainer),here::here()root marker detection,.Rprofileportability hazard auditing (custom.libPaths(),setwd(), local absolute paths, hardcoded secrets), zero-byte/binary/Unicode/whitespace filename inventories, and host architecture / Apple Silicon cross-build hints.
CRAN Readiness, Documentation & Website
- Expanded documentation to 4 executable vignettes (
getting-started,multi-target-containers,journal-submission-workflow,troubleshooting-reproducibility), addedinst/CITATION, runnable examples ininst/examples/,inst/WORDLISTfor zero-misspellingspellingchecks,cran-comments.md, and GitHub Actions workflows (.github/workflows/R-CMD-check.yamlandpkgdown.yaml). - Added
_pkgdown.ymlwebsite configuration and a standalone PDF Reproducibility & Container Field Guide (inst/guides/rcapsule-guide.Rmd). - Audited
DESCRIPTIONand all manual pages for strictR CMD check --as-crancompliance (0 errors | 0 warnings | 0 notes).
rcapsule 0.2.0
Security & Sandbox Hardening
- Added centralized validation, sanitization, path confinement, constant-time cryptography, environment scrubbing, and HTML/Markdown escaping in
R/security.R(documented inSECURITY.md). - Hardened
compile_dockerfile(),compile_compose(),compile_apptainer(), andresolve_sysreqs()against shell, Dockerfile, YAML, and Apptainer%postinjection via strict allowlists for R packages, Debianaptpackages, Python PEP 508 specs, version strings, image references/digests, CRAN URLs, Linux usernames (rejectingroot), workdirs, relative entrypoints, service names, env vars, and Compose volumes. - Enforced strict project-root path-traversal and symlink-escape confinement in
scan_project(),create_capsule_manifest(), andverify_capsule(), blocking.., external absolute paths, and external/dangling symlinks (skipped_external_symlinksrecorded during scanning). - Added automatic ambient secret scrubbing (
scrub_secrets = TRUE) inverify_capsule()before launchingcallr::rscriptsandboxes, removingAWS_*,GITHUB_*,GH_*,OPENAI_*,ANTHROPIC_*,*_SECRET*,*_TOKEN*,*_PASSWORD*,*_API_KEY*, and related credential variables while reporting scrubbed variable names (never values). - Upgraded
constant_time_equal()with explicit UTF-8 normalization, bitwise-OR byte comparison, and fixed-length SHA-256 fallback on length mismatch; applied constant-time verification across manifest, file, snapshot, and artifact SHA-256/HMAC checks. - Added unexpected extra artifact detection (
extra_artifactsandstrict_outputs = TRUEmode) toverify_capsule(). - Hardened
render_certificate()against HTML/XSS and Markdown table injection (strippinghtmltools::HTML()bypasses and adding aContent-Security-Policymeta tag to standalone HTML5 certificates) and disabled R!exprYAML evaluation (eval.expr = FALSE) across all YAML loaders.
Scanner, Comparator & Linter Accuracy
- Expanded
scan_project()AST extraction to detectpacman::p_load(),pacman::p_load_gh(),xfun::pkg_attach(),xfun::pkg_attach2(),xfun::pkg_load2(), andbox::use()(ignoring relative./and../local modules), while ignoring comments, string literals, plain fenced Markdown blocks, and double-backtick verbatim spans. - Preserved non-CRAN
renv.lockprovenance (GitHub,GitLab,Bioconductor,URL) inscan$packages$sourceandscan$non_cran_packages. - Enhanced
compare_artifacts()withatol/rtolaliases (alongsideabs_tol/rel_tol), deeper recursive diffing for nested JSON/RDS lists, matrices/arrays (dimnames+(row, col)diagnostics),Date/POSIXt,NA/NaN/+Inf/-Infalignment, and missing/extra column & key diagnostics. - Expanded
lint_container_spec()withDF011/AP007(curl|sh/wget|bash),DC008(network_mode/pid/ipc: host),DC009(dangerous host mounts likedocker.sock),AP008(--no-install-recommendsin%post), and broader baked-secret detection (DF008/DC006).
rcapsule 0.1.0
- Initial CRAN-grade release of
rcapsule: full-stack R/Quarto/Shiny/toolchain scanner (scan_project(),sysreqs_db(),resolve_sysreqs()), multi-target container compilers (compile_dockerfile(),compile_compose(),compile_apptainer()), static container linter (lint_container_spec()), cryptographic provenance manifest (create_capsule_manifest(),sign_manifest(),verify_manifest_integrity()), isolated reproducibility verifier (verify_capsule(),compare_artifacts()), journal-ready Markdown/HTML certificates (render_certificate()), and end-to-endbuild_capsule()orchestrator.
