Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f135e6a
DavidMorkos Mar 23, 2022
cb3a36d
DavidMorkos Mar 24, 2022
64b9a2b
DavidMorkos Mar 24, 2022
a08a34a
DavidMorkos Mar 24, 2022
117b6cb
DavidMorkos Mar 24, 2022
f63ab65
DavidMorkos Mar 24, 2022
7e21921
DavidMorkos Mar 24, 2022
b6ab6d5
DavidMorkos Mar 24, 2022
c6602ce
DavidMorkos Mar 24, 2022
ae8f864
DavidMorkos Mar 24, 2022
40f1d38
DavidMorkos Mar 25, 2022
5c84fe3
DavidMorkos Mar 25, 2022
5f4f55a
Merge branch 'master' into security_audit
dmork123 Mar 27, 2022
0974412
DavidMorkos Mar 27, 2022
ca04092
Merge remote-tracking branch 'origin/security_audit' into security_audit
DavidMorkos Mar 27, 2022
98c10ee
DavidMorkos Mar 27, 2022
fe624e6
DavidMorkos Mar 27, 2022
f2f3f06
DavidMorkos Mar 27, 2022
22da65c
DavidMorkos Mar 29, 2022
2921a6b
DavidMorkos Mar 30, 2022
66719af
Merge branch 'master' into security_audit
arm4b Mar 31, 2022
84fc536
reformat with black
cognifloyd Mar 31, 2022
1cd7d29
DavidMorkos Mar 31, 2022
8f8470f
DavidMorkos Mar 31, 2022
7570e78
DavidMorkos Mar 31, 2022
e979b05
DavidMorkos Mar 31, 2022
5b0e85d
Merge branch 'master' into security_audit
dmork123 Apr 3, 2022
e64a466
DavidMorkos Apr 3, 2022
954ac2b
Merge remote-tracking branch 'origin/security_audit' into security_audit
DavidMorkos Apr 3, 2022
9f90ddc
DavidMorkos Apr 4, 2022
7f440e1
DavidMorkos Apr 4, 2022
234968b
adjust location of some security_audit logs
cognifloyd Apr 5, 2022
32e4337
restore whitespace
cognifloyd Apr 5, 2022
dac5d22
reformat with black
cognifloyd Apr 5, 2022
a881762
fix json/dict access
cognifloyd Apr 5, 2022
f8282a2
fix json/dict access
cognifloyd Apr 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ Added

Contributed by @Kami.

* Add new audit message when a user has decrypted a key whether manually in the container (st2 key get [] --decrypt)
or through a workflow with a defined config. #5594
Contributed by @dmork123

* Added garbage collection for rule_enforcement and trace models #5596/5602
Contributed by Amanda McGuinness (@amanda11 intive)

Expand Down
3 changes: 2 additions & 1 deletion st2api/st2api/controllers/v1/keyvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def get_one(self, name, requester_user, scope=None, user=None, decrypt=False):
key_ref = get_key_reference(scope=scope, name=name, user=user)
extra = {"scope": scope, "name": name, "user": user, "key_ref": key_ref}
LOG.debug("GET /v1/keys/%s", name, extra=extra)

LOG.audit("User %s decrypted the value %s ", user, name,
extra={"user": user, "scope": scope, "key_name": name, "operation": "decrypt"})
# Setup a kvp database object used for verifying permission
kvp_db = KeyValuePairDB(
uid="%s:%s:%s" % (ResourceType.KEY_VALUE_PAIR, scope, key_ref),
Expand Down
5 changes: 5 additions & 0 deletions st2common/st2common/util/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ def _assign_dynamic_config_values(self, schema, config, parent_keys=None):
is_jinja_expression = jinja_utils.is_jinja_expression(
value=config_item_value
)
if "decrypt_kv" in str(config_item_value):
LOG.audit("User %s is decrypting the value for key %s from the config within pack %s", self.user,
config_item_key, self.pack_name,
extra = {"user": self.user, "key_name": config_item_key, "pack_name": self.pack_name,
"operation": "pack_config_value_decrypt"})

if is_jinja_expression:
# Resolve / render the Jinja template expression
Expand Down