Skip to main content

Module ask_pack

Module ask_pack 

Source
Expand description

The ask pack: built-in ask rules for commands that lose data or reach past the machine. Database drops and resets, infrastructure and cluster teardown, cloud and container deletes, publishing a package, reading a secret, emptying or deleting a config file, mirroring a delete into the home directory, dropping a stash, and putting a world-writable directory ahead of $PATH each ask the person first, with a reason and a safer form. The pack is on by default. LJOS_ASK_PACK=off turns it off, and a list such as LJOS_ASK_PACK=db,cloud keeps only those classes. A seat rule in the pack is read first, so a person’s own deny or ask on the same line wins.

Constants§

ASK_PACK_CLASSES
The classes of the pack, in the order a refusal is looked for.
ASK_PACK_ENV
The environment variable that turns the pack or its classes off.

Functions§

ask_pack_classes
The classes LJOS_ASK_PACK leaves on: every class when unset, empty or on; none for off, 0, false or none; else the listed ones.
ask_pack_switched_off
The ask the pack would give the line with every class on, when the setting in LJOS_ASK_PACK turned that class off, with the setting.
ask_pack_verdict
The pack’s verdict on a shell line under LJOS_ASK_PACK: an ask rule, or none.
ask_pack_verdict_with
ask_pack_verdict with the setting passed in.
destructive_sql
A SQL text with a statement that drops or empties data: DROP TABLE, DROP DATABASE, TRUNCATE, DELETE FROM with no WHERE, or ALTER TABLE ... DROP. A statement is read from its start, so SELECT 'DROP TABLE x' is a select.
secret_path
A path that holds a secret: an env file (not .env.example and the like), a private SSH key, cloud or registry credentials, .netrc.