Commit Graph

791 Commits

Author SHA1 Message Date
Kartik K. Agaram e3cef7ee56 bugfix: policies must end in newline
I believe kilo kinda naturally enforces that. We'll see.
2022-01-02 22:38:28 -08:00
Kartik K. Agaram b97291602b instrument some obvious syscalls 2022-01-02 22:36:33 -08:00
Kartik K. Agaram 49a03587ef indent 2022-01-02 22:20:48 -08:00
Kartik K. Agaram a901203227 start on a view of audit events 2022-01-02 22:13:47 -08:00
Kartik K. Agaram 74360f20be . 2022-01-02 21:39:53 -08:00
Kartik K. Agaram 2d0bb4438c editing file permissions 2022-01-02 21:33:49 -08:00
Kartik K. Agaram e07fe0c87a make some space for callers of a function 2022-01-02 20:56:09 -08:00
Kartik K. Agaram 78516d140f start parameterizing viewport for editor 2022-01-02 20:14:24 -08:00
Kartik K. Agaram 1fd7f4ad18 drop os.getenv 2022-01-02 19:59:49 -08:00
Kartik K. Agaram d0111f1839 editable file permissions
Extremely cruddy implementation:
- I'm still unclear on how to represent the advice function:
  - How to handle errors when loading user configuration?
    Currently I refuse to start.
  - Whole function? More errors to handle in header and so on. What if
    the function is renamed?
  - Just body? Needs more structured editing support.
- Lots of duplication, particularly between the permissions in the menu
  and the permissions screen.

I don't know how to show the hostname at the time of connect() or
bind(), so networking is going to remain a boolean for now. It's also
unclear what effective constraints we can impose on what gets discussed
with a specific hostname. Everything outside the computer is out of
one's control.

One trick I learned is for consistently grabbing ASan logs on abort:
It's always safe to redirect stderr with ncurses!
2022-01-02 19:59:30 -08:00
Kartik K. Agaram a2081ee612 fork a new editor widget for non-code 2022-01-02 16:55:23 -08:00
Kartik K. Agaram f6aaf2fd1d better follow kilo's naming conventions 2022-01-02 16:52:36 -08:00
Kartik K. Agaram 30a1fb202e start peeling out an editor for non-code 2022-01-02 16:48:00 -08:00
Kartik K. Agaram 18a499c5c0 . 2022-01-02 16:35:01 -08:00
Kartik K. Agaram 2b1609f09b copy tweak 2022-01-02 15:52:02 -08:00
Kartik K. Agaram df5cd41637 rename 2022-01-02 15:46:46 -08:00
Kartik K. Agaram f7b4413494 . 2022-01-02 15:15:10 -08:00
Kartik K. Agaram 762b77f68b sandbox: tweaks to warning copy 2022-01-02 12:49:31 -08:00
Kartik K. Agaram 6859450182 sandbox: color tweaks 2022-01-02 12:47:24 -08:00
Kartik K. Agaram 40a0aca6e3 spacing 2021-12-26 00:04:28 -08:00
Kartik K. Agaram 0de63dd710 gemini.tlv: stop using default background 2021-12-25 22:07:34 -08:00
Kartik K. Agaram 3040ede3c8 undo accidental color scheme commit 2021-12-25 22:07:15 -08:00
Kartik K. Agaram e9d72de48b gemini: better error-handling 2021-12-25 22:03:19 -08:00
Kartik K. Agaram 04a062e94d start persisting sandboxing settings
Zero guarantees of compatibility at this point.
2021-12-25 21:36:31 -08:00
Kartik K. Agaram e7dc519c40 reorg 2021-12-25 21:26:47 -08:00
Kartik K. Agaram 6ae7bf91b1 network calls are now sandboxed
I _think_ I don't need to gate other socket calls; you can't do anything
without bind() and connect(). And they should be good places to dump
more precise details later about the kind of server or client connection
being attempted.
2021-12-25 20:43:19 -08:00
Kartik K. Agaram 16d949e259 file open() is now sandboxed
In the process we now also have a mechanism for Teliva to overlay errors
while apps run. Might make sense to make that available to apps as well.
But I'm starting to realize that any app access to the Teliva areas of
the screen is fraught with risk.
2021-12-25 18:55:01 -08:00
Kartik K. Agaram 33bcd5c871 remove disabled functions from life.tlv 2021-12-25 18:52:43 -08:00
Kartik K. Agaram f5ab71b4e1 flesh out very preliminary UI
Our sandboxing model is a blunt caricature, just two booleans. But let's
see how far this gets us.

Still doesn't persist, and definitely has no effect.
2021-12-25 18:51:05 -08:00
Kartik K. Agaram 8458ba0202 fix a couple of colors 2021-12-25 16:43:50 -08:00
Kartik K. Agaram 12cb565077 delete a couple more hacky function prototypes 2021-12-25 16:21:40 -08:00
Kartik K. Agaram e4c0b0a3e7 sandbox: more scenarios 2021-12-25 16:16:52 -08:00
Kartik K. Agaram dbbb396003 . 2021-12-25 16:16:48 -08:00
Kartik K. Agaram a36edb74f0 mock sandbox status and some initial colors
Current plan:
  - two booleans to gate file and network access, respectively
  - false shows as green, true shows as orange
  - if _both_ booleans are true, then both show as red to indicate that
    there are no protections.
2021-12-25 16:08:31 -08:00
Kartik K. Agaram 2b5559d8eb update all places when changing color scheme 2021-12-25 15:14:33 -08:00
Kartik K. Agaram 526d37e4ac fix menu colors in all color schemes
It looks like attron doesn't actually enable colors near 256, even
though https://linux.die.net/man/3/attron suggests it does.

  > COLOR_PAIR values can only be OR'd with attributes if the pair
  > number is less than 256.
2021-12-25 14:59:18 -08:00
Kartik K. Agaram ee66da41f5 sandbox: new scenario 2021-12-25 14:36:56 -08:00
Kartik K. Agaram 399fb500f4 more sandboxing scenarios 2021-12-25 14:00:03 -08:00
Kartik K. Agaram 6eecba1b5f . 2021-12-25 13:55:29 -08:00
Kartik K. Agaram 4cb6fed4e0 . 2021-12-25 13:53:18 -08:00
Kartik K. Agaram 434d36f81f a little more reorg
Put stuff people messing with Teliva apps are likely to need above the C
interface.

The state of documentation for Teliva app creators is still quite poor.
All they really have to go on is the example apps.
2021-12-25 13:44:07 -08:00
Kartik K. Agaram bb6e79aa0d reorg: pull Teliva-specific stuff out of lua.c
It should now be easier to diff against the Lua 5.1 sources upstream.
2021-12-25 13:33:37 -08:00
Kartik K. Agaram 1fdfa8909b . 2021-12-25 12:08:55 -08:00
Kartik K. Agaram 940e1abd6a make the case for sandboxing in the Readme 2021-12-25 12:06:30 -08:00
Kartik K. Agaram 02d05d61c7 back to sandboxing; focus on files and sockets 2021-12-25 11:39:56 -08:00
Kartik K. Agaram 1e63a579d7 drop stdin/stdout/stderr and Lua default files
This isn't necessarily for sandboxing, but they don't really work right
now in the presence of ncurses, and it seems better to not include
broken stuff. Maybe we can get them to coexist with ncurses down the
road.
2021-12-25 11:35:50 -08:00
Kartik K. Agaram 5c1bf1aaff drop advent.tlv
It's not really an ideal use case for Teliva.
2021-12-25 11:07:04 -08:00
Kartik K. Agaram 917646fc9f sandbox: no popen
Again, too difficult to sandbox for now.
2021-12-25 11:04:23 -08:00
Kartik K. Agaram 6af91eb0d2 tlv format for transient editor state
Stop interpreting arbitrary Lua code when loading editor state. We don't
need that power or security risk.
2021-12-25 09:27:44 -08:00
Kartik K. Agaram 76677dbd6f sandbox: UX 2021-12-25 09:05:32 -08:00