Skip to content

Global variables in cnspec policies #519

Closed Answered by arlimus
scottford-io asked this question in Q&A
Discussion options

You must be logged in to vote

Love that you are raising this!!

There are 2 things to cover for global vars: (1) how to use them in policies and (2) how to use them in the shell. I'll mention a few upcoming things below, which are important for this question.

1: properties for policies

Policies have properties which serve as "global variables" across the policy. These properties can be static (like a number or a string) or they can be full-fledged MQL queries. This design allows us to overwrite their values at any chain of the evaluation. They essentially just chain queries together.

Properties are accessed via the props, so in your case you'd want to use it as props.s3_module. We did this to prevent conflicts in the g…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by scottford-io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants