An example of using org-mode for information security/ IT
Find a file
2025-08-17 19:37:47 +02:00
roam Update 2025-08-17 19:37:47 +02:00
tools First update. 2025-08-17 12:30:55 +02:00
.gitmodules First update. 2025-08-17 12:30:55 +02:00
README.org First update. 2025-08-17 12:30:55 +02:00

Readme

Intro

[2025-08-17 Sun 10:15] <- README.org::*Architecture: Intro [2025-08-17 Sun 10:13] <- README.org::*Architecture:Intro

This is an example of how infosec can be enhanced using org-mode.

Please note, while this is overall comprehensive, it does not cover all use cases and does need to be carefully considered for your use-case.

Caveats

IMPORTANT: This is rough. I'm building this out based on the systems and ideas I developed, a lot of this is likely to outright not work out of the box without tinkering.

IMPORTANT: This is just a minimal example.

IMPORTANT: Some of this relies on functions I have in my Doom Emacs config. If you're missing functions, check that. I haven't had the time to get all the dependencies into my system yet, so it's not entirely stand-alone.

Internal Documentation Export

The following scenario:

  • You're running Emacs locally.
  • You have tons of files in your roam/ directory.
  • You want some files to be accessible in your Tailscale intranet.
  • On the host (Tailscale node with tailscale serve running), you store your html files.

This codeblock will use Tailscale ssh and rsync to first compile the org-mode file into HTML, then upload it to the host.

Note it also syncs the files/ and files-third-party/ directories, which usually will hold reference documents like spreadsheets, csv exports, regulation files, policies, and so on.

The SETUPFILE is necessary if you wish to use any theming for those HTML files.

Requirements

  1. Emacs
  2. org-mode (comes bundled with Emacs)
  3. org-roam
  4. org-ql
  5. (optionally) org-super-links

My configuration

I'm keeping these snippets here since it's easier to reference than cross-linking to my config. Please keep in mind these are for a minimal example.

org-super-links

This configuration allows for automatically showing exactly where links go in their description.

(require 'org-super-links)
(setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id
      org-link-keep-stored-after-insertion t
      org-super-links-default-description-formatter 'phil/org-super-links-description-formatter
      org-super-links-related-drawer-default-name "RELATED"
      org-super-links-backlink-into-drawer "RELATED"
      org-super-links-backlink-prefix nil)

(defun phil/org-super-links-description-formatter (link desc)
  (let* ((src-dir default-directory)                       ;; where the link is being inserted
         (id (cadr (split-string link ":")))
         (m (org-id-find id 'marker)))
    (when m
      (with-current-buffer (marker-buffer m)
        (save-excursion
          (goto-char m)
          (let* ((file (or (buffer-file-name)               ;; prefer real file path
                           (buffer-name)))                  ;; fallback (non-file buffers)
                 (rel  (if file
                           (file-relative-name file src-dir)
                         (buffer-name)))
                 (outline (org-get-outline-path 'with-self)))
            (concat rel
                    (when outline
                      (concat " >> " (string-join outline " >> "))))))))))

(org-link-set-parameters "id"
			 :description #'phil/org-super-links-description-formatter)

This overwrites the default behavior in org-super-links - this way I can keep on inserting the same link instead of having to re-store it in the register.

(defun org-super-links-insert-link ()
  "Insert a super link from the register."
  (interactive)
  (let* ((target (get-register ?^)))
    (if target
	(progn
	  (org-super-links--insert-link target)
	  ;; (set-register ?^ nil) ;; Commenting this out so that I don't need
	  ;; to copy the link over and over if I wish to insert it into multiple places.
	  )
      (message "No link to insert!"))))

Architecture:

  • org-mode controls the basic workflow
  • org-roam controls the files and headings
  • org-ql lets us query everything as if it's a database
  • org-super-links lets us quickly cross-link elements