# Moving policy scripts into packages

**URL:** <https://community.zeek.org/t/moving-policy-scripts-into-packages/6215>\
**Category:** Development\
**Tags:** development\
**Created:** [August 24, 2020, 1:43pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215 "2020-08-24T13:43:21Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 24, 2020, 1:43pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/1 "2020-08-24T13:43:21Z")

</div>

Looking for some thoughts here. One of the items on the roadmap for  
4.0 is moving scripts that currently live in policy/ over into Zeek  
packages. The goals here are to (1) facilitate maintaining & testing  
them independently of Zeek releases; and (2) come to a more flexible  
notion of "default scripts" that can incorporate community-maintained  
packages as well. This is tracked by issue  
[https://github.com/zeek/zeek/issues/414](https://github.com/zeek/zeek/issues/414), including a 1st pass over the  
existing policy scripts to understand what should/can be moved.  
(Thanks, Vlad!)

Before we can begin working on this, we need to figure out how to  
organize this new world. One particular question is where the moved  
packages will live. I see the following options so far:

&nbsp;&nbsp;&nbsp;&nbsp;1. Move each into a a separate repository on the zeek/ GitHub  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;account.

&nbsp;&nbsp;&nbsp;&nbsp;2. Similar, but to avoid cluttering zeek/, create a new GitHub  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;organization "zeek-packages".

&nbsp;&nbsp;&nbsp;&nbsp;3. Put them all into a single mono-repository (e.g.,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zeek/standard-packages), i.e., treat them a one package.

&nbsp;&nbsp;&nbsp;&nbsp;4. Do (1) or (2), and additionally create "zeek-standard-packages"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that's full of submodules pointing to them (and also to  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;community packages).

&nbsp;&nbsp;&nbsp;&nbsp;5. Do (1) or (2), and teach zkg to understand "collections" of  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;packages that can be installed/managed as a group, defined  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;through some meta data somewhere.

Along with all of this comes a question of how to make it easy for  
people to install a set of default packages now that these won't come  
with Zeek itself anymore. Some of the schemes above make that easier  
than others.

Thoughts/opinions/more ideas?

Robin

---

<div class="post-metadata">

**Author:** ![Michael\_Dopheide](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Michael\_Dopheide](https://community.zeek.org/u/Michael_Dopheide)\
**Post date:** [August 24, 2020, 4:26pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/2 "2020-08-24T16:26:39Z")

</div>

I like (2) for cleanliness.

I think some people would be fine with one large package, but in other cases, you may want the ability to easily enable/disable various standard scripts. Probably not wanting to maintain the same script in multiple places, I think that eliminates (3). Towards, (4) & (5) and iven the number of standard scripts, there should be an easy way to distinguish them from other packages when doing a ‘zkg list’. Maybe that’s just done via a tag or in the naming scheme.

-Dop

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 24, 2020, 4:51pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/3 "2020-08-24T16:51:56Z")

</div>

> I like (2) for cleanliness.

Vote counted!

> there should be an easy way to distinguish them from other packages  
> when doing a 'zkg list'.

Good point.

Also, one additional thought: Jon reminded me that zkg can manage  
dependencies already. So the "collection" I mentioned could be a  
meta-package that depends on all the ones we want. We might need to  
make that a bit more explicit for this use case (like you say for  
example in the output of "list"), but the basic functionality is  
there.

Robin

---

<div class="post-metadata">

**Author:** ![johanna](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@johanna](https://community.zeek.org/u/johanna)\
**Post date:** [August 24, 2020, 6:49pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/4 "2020-08-24T18:49:06Z")

</div>

Hi,

just a few thoughts about this. Generally - I like the idea of breaking this up.

I would like to list a few thoughts about additional technical points that  
we should perhaps think about and that play into this decision.

\* Testing:

&nbsp;&nbsp;Currently, some of the policy scripts have tests that use Zeek  
&nbsp;&nbsp;functionality in rather unique ways / or are the only tests for some  
&nbsp;&nbsp;Zeek functionality. The SSL validation scripts are one example.

&nbsp;&nbsp;This, from my point of view, it would be neat to have a way to still  
&nbsp;&nbsp;easily install a rather large set of packages (potentially nearly  
&nbsp;&nbsp;everything that is in policy at the moment) and run test on them.

&nbsp;&nbsp;This also comes with a fun problem. Sometimes we perform changes to Zeek  
&nbsp;&nbsp;that change a lot of the test baselines - especially when we touch  
&nbsp;&nbsp;something that affects connection-ID hashing, or the order of elements  
&nbsp;&nbsp;in hashmaps. These cases might now require an update to the test-cases  
&nbsp;&nbsp;in a large number of packages. It would be neat to have an easy way to  
&nbsp;&nbsp;perform this.

\* Versioning:

&nbsp;&nbsp;I think if we want to do this, we need to have a better story for  
&nbsp;&nbsp;versioning than we, at the moment, have with zkg. To expand on this - at  
&nbsp;&nbsp;the moment the policy scripts just work with the version of Zeek that we  
&nbsp;&nbsp;distribute them with.

&nbsp;&nbsp;It would be nice if, afterwards, it would still be possible to install a  
&nbsp;&nbsp;working set of a script for the running version of Zeek. Meaning that -  
&nbsp;&nbsp;if someone happens to run a version of Zeek that is 12 months out of  
&nbsp;&nbsp;date - they should probably get the version of the policy script that is  
&nbsp;&nbsp;known to work with this version of Zeek and where the tests pass with  
&nbsp;&nbsp;this version of Zeek.

&nbsp;&nbsp;It would be super nice if this worked rather fine-granular - so even for  
&nbsp;&nbsp;development versions of Zeek.

\* Documentation:

&nbsp;&nbsp;At the moment the documentation of the policy scripts just lives  
&nbsp;&nbsp;together with the Zeek documentation. This has a few advantages - it  
&nbsp;&nbsp;e.g. shows redefs that are performed in policy scripts. It would be neat  
&nbsp;&nbsp;to have a place that contains the combined documentation of these  
&nbsp;&nbsp;scripts.

Currently, especially given the "update-tons-of-test-baselines-simultaneously"  
problem, I am kind of tempted by 3. 3 would also enable relatively easy  
versioning and mapping to Zeek versions that the packages are known to  
work with. This should also allow to keep the current testing  
infrastructure more or less working as it is. It does, however, not give  
really fine-grained access to individual packages.

Johanna

---

<div class="post-metadata">

**Author:** ![Christian](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/christian/32/593_2.png) [@Christian](https://community.zeek.org/u/Christian)\
**Post date:** [August 24, 2020, 9:08pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/5 "2020-08-24T21:08:15Z")

</div>

Yeah, agreed -- I prefer #2 for the same reason.

Best,  
Christian

---

<div class="post-metadata">

**Author:** ![Christian](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/christian/32/593_2.png) [@Christian](https://community.zeek.org/u/Christian)\
**Post date:** [August 24, 2020, 9:09pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/6 "2020-08-24T21:09:11Z")

</div>

> \* Testing:
> 
> &nbsp;&nbsp;&nbsp;Currently, some of the policy scripts have tests that use Zeek  
> &nbsp;&nbsp;&nbsp;functionality in rather unique ways / or are the only tests for some  
> &nbsp;&nbsp;&nbsp;Zeek functionality. The SSL validation scripts are one example.
> 
> &nbsp;&nbsp;&nbsp;This, from my point of view, it would be neat to have a way to still  
> &nbsp;&nbsp;&nbsp;easily install a rather large set of packages (potentially nearly  
> &nbsp;&nbsp;&nbsp;everything that is in policy at the moment) and run test on them.

On a related note, I think it would be quite helpful if the Zeek install tree would include some of the standard btest helpers, such as random.seed and the various canonification scripts.

> &nbsp;&nbsp;&nbsp;This also comes with a fun problem. Sometimes we perform changes to Zeek  
> &nbsp;&nbsp;&nbsp;that change a lot of the test baselines - especially when we touch  
> &nbsp;&nbsp;&nbsp;something that affects connection-ID hashing, or the order of elements  
> &nbsp;&nbsp;&nbsp;in hashmaps. These cases might now require an update to the test-cases  
> &nbsp;&nbsp;&nbsp;in a large number of packages. It would be neat to have an easy way to  
> &nbsp;&nbsp;&nbsp;perform this.

I agree that this would be really handy. We could build some tooling that would still let you maintain the packages as individual repos but that enables such use use cases. It'd be pretty handy to have a zkg command that clones a given package plus all of its dependencies for development work, for example. Since zkg already speaks git rather well, it could even synthesize a submodule structure.

Thanks,  
Christian

---

<div class="post-metadata">

**Author:** ![Jon\_Siwek](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jon\_Siwek](https://community.zeek.org/u/Jon_Siwek)\
**Post date:** [August 24, 2020, 9:15pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/7 "2020-08-24T21:15:10Z")

</div>

> &nbsp;&nbsp;&nbsp;&nbsp;1. Move each into a a separate repository on the zeek/ GitHub  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;account.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;2. Similar, but to avoid cluttering zeek/, create a new GitHub  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;organization "zeek-packages".

I'm thinking (2). Technically, either one can likely be made to work,  
but (1) has a slight downside in terms of hurting a primitive  
browsability use-case: I imagine people want to simply scroll through  
a list of packages on GH, and the existing non-packages in zeek/ would  
distract from that goal.

> &nbsp;&nbsp;&nbsp;&nbsp;3. Put them all into a single mono-repository (e.g.,  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zeek/standard-packages), i.e., treat them a one package.

The shortcoming of that structure is the lack of customizability. If  
a user only wants a specific set of functionality, or wants to avoid a  
set of scripts due to intrinsic overhead/conflict, it's better if  
they're able to start from blank slate and add only the pieces they  
want.

> &nbsp;&nbsp;&nbsp;&nbsp;4. Do (1) or (2), and additionally create "zeek-standard-packages"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that's full of submodules pointing to them (and also to  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;community packages).
> 
> &nbsp;&nbsp;&nbsp;&nbsp;5. Do (1) or (2), and teach zkg to understand "collections" of  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;packages that can be installed/managed as a group, defined  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;through some meta data somewhere.

Between those, (5) may fit more naturally -- zkg may already be fit to  
handle "meta packages" via simple package metadata dependency  
configuration. Plus, that's a similar pattern to other package  
management environments AFAIK.

> &nbsp;&nbsp;This, from my point of view, it would be neat to have a way to still  
> &nbsp;&nbsp;easily install a rather large set of packages (potentially nearly  
> &nbsp;&nbsp;everything that is in policy at the moment) and run test on them.

Agree that type of integration test is helpful -- may find conflicts /  
bad-interactions / versioning-issues that way.

> &nbsp;&nbsp;Sometimes we perform changes to Zeek  
> &nbsp;&nbsp;that change a lot of the test baselines - especially when we touch  
> &nbsp;&nbsp;something that affects connection-ID hashing, or the order of elements  
> &nbsp;&nbsp;in hashmaps. These cases might now require an update to the test-cases  
> &nbsp;&nbsp;in a large number of packages. It would be neat to have an easy way to  
> &nbsp;&nbsp;perform this.

Might be a chance to go another direction and revamp the test-writing  
guidelines/patterns (or provide internal config options that help  
produce "canonical" outputs) such that less test-cases are fragile to  
these kinds of widespread, low-level changes in the first place. E.g.  
if the order of elements in hashmaps is not defined, it's the fault of  
any given test-case that chose to rely on a specific order being  
produced. Or if an irrelevant change in UID breaks a test, the test  
either needs to canonify or exclude UID from its pass/fail criteria.

> &nbsp;&nbsp;I think if we want to do this, we need to have a better story for  
> &nbsp;&nbsp;versioning than we, at the moment, have with zkg. To expand on this - at  
> &nbsp;&nbsp;the moment the policy scripts just work with the version of Zeek that we  
> &nbsp;&nbsp;distribute them with.

I see the current story for versioning as this: package metadata  
advertises Zeek version compatibility, zkg knows how to enforce that  
dependency, and package authors are left in control of deciding their  
compatibility requirements and implementing them (likely via @if or  
#if directives).

Once scripts that used to get distributed along with Zeek become  
independent packages, I agree they should start abiding by that story,  
but I'm not sure if there were any further ideas to help minimize the  
overall maintenance burden/friction associated with this new  
requirement.

> &nbsp;&nbsp;It would be nice if, afterwards, it would still be possible to install a  
> &nbsp;&nbsp;working set of a script for the running version of Zeek. Meaning that -  
> &nbsp;&nbsp;if someone happens to run a version of Zeek that is 12 months out of  
> &nbsp;&nbsp;date - they should probably get the version of the policy script that is  
> &nbsp;&nbsp;known to work with this version of Zeek and where the tests pass with  
> &nbsp;&nbsp;this version of Zeek.

Seems like a couple distinct questions:

\* What's the LTS policy for packages? It can be made different/longer  
than LTS policy for Zeek-proper if that's desirable. But if a  
12-month LTS cycle is decided for packages, too, any extra effort  
spect to support older Zeeks sends mixed messages.

\* How to obtain an aggregate set of packages that were validated with  
Zeek X.Y.Z: seems like a job for the (meta)package dependency metadata  
to point directly to specific package versions (in the realm of git  
tags/branches/commits, etc.).

- Jon

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 25, 2020, 7:46am UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/8 "2020-08-25T07:46:15Z")

</div>

> &nbsp;&nbsp;This, from my point of view, it would be neat to have a way to still  
> &nbsp;&nbsp;easily install a rather large set of packages (potentially nearly  
> &nbsp;&nbsp;everything that is in policy at the moment) and run test on them.

While I agree that integration testing is useful, too, ideally the new  
packages would primarily rely on tests that are standalone. Do you see  
a problem with that for, e.g., the SSL functionality?

> &nbsp;&nbsp;that change a lot of the test baselines - especially when we touch  
> &nbsp;&nbsp;something that affects connection-ID hashing, or the order of elements  
> &nbsp;&nbsp;in hashmaps.

Agree with Jon here: This might be an opportunity to make the tests  
less fragile, more like what we'd recommend for external packages  
anyways.

> &nbsp;&nbsp;It would be nice if, afterwards, it would still be possible to install a  
> &nbsp;&nbsp;working set of a script for the running version of Zeek.

Yeah, if we worked with a meta-package, we could "bless" a specific  
version of that for a given Zeek release. People could update further,  
but with less of a guarantee, though we'd try hard to ensure they work  
with different versions, can even CI them against a bunch of recent  
releases.

Overall, our current policy/ scripts haven't required version-specific  
changes very often, so I'm not too worried here. The most common use  
case it probably some script starting to use a newly introduced  
feature, and that's pretty easy to catch / guard against.

> It would be neat to have a place that contains the combined  
> documentation of these scripts.

Agree, and I'd extend that to packages in general, you be a job for an  
extended packages.zeek.org to provide autogen'ed documentation.

Robin

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 25, 2020, 7:48am UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/9 "2020-08-25T07:48:08Z")

</div>

Good question. I think would tie it to the Zeek LTS policy, with a  
"blessed" version of the meta-package that we recommend (and maintain)  
for each currently maintained Zeek version.

Robin

---

<div class="post-metadata">

**Author:** ![Jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jan](https://community.zeek.org/u/Jan)\
**Post date:** [August 25, 2020, 8:27am UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/10 "2020-08-25T08:27:29Z")

</div>

> Agree, and I'd extend that to packages in general, you be a job for an  
> extended packages.zeek.org to provide autogen'ed documentation.

I like that idea! It would be great to have a standard process for generating docs for each package.

---

<div class="post-metadata">

**Author:** ![Vlad\_Grigorescu](https://avatars.discourse-cdn.com/v4/letter/v/a3d4f5/32.png) [@Vlad\_Grigorescu](https://community.zeek.org/u/Vlad_Grigorescu)\
**Post date:** [August 25, 2020, 2:25pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/11 "2020-08-25T14:25:43Z")

</div>

I’ve been working[1] on a template for Zeek packages that consist only of scripts. It’s based heavily on the plugin-support[2] in zeek-aux, but it goes a few steps further by running the tests via GitHub Actions with the current {zeek, zeek-lts, zeek-nightly} packages. It also integrates with GitHub Pages to auto-generate the Sphinx documentation. You can see an example here: [https://grigorescu.github.io/external\_dns/](https://grigorescu.github.io/external_dns/). (Note: This is my “working” package, and deviates from the upstream cookiecutter as I play around with new things).

It tries to combine the user-provided README, with autogenerated documentation, and some useful things that I bundled into the docs (for example, explaining how plugins get loaded). One neat feature is using intersphinx to link to the official Zeek docs, so that all the references to types, enums, base scripts will still be clickable links.

There are a couple of open questions with this. For instance, Zeekygen does not generate documentation for redefs within the script that’s doing the redefs. So this[3] will tell you that your script is adding some new notice types, but the documentation is missing. Also, I don’t have a good way to generate documentation for all your packages into a single page, which would be nice. I also made some changes to the Sphinx scripts in zeek-docs that I should probably figure out how to upstream. We might want to just publish the Sphinx module separately, so that people can just use it.

–Vlad

[1] - \<[https://github.com/esnet/cookiecutter-zeekpackage](https://github.com/esnet/cookiecutter-zeekpackage)\>  
[2] - \<[https://github.com/zeek/zeek-aux/tree/master/plugin-support](https://github.com/zeek/zeek-aux/tree/master/plugin-support)\>  
[3] - \<[https://grigorescu.github.io/external\_dns/scripts/NCSA/external\_dns/main.zeek.html#redefinitions](https://grigorescu.github.io/external_dns/scripts/NCSA/external_dns/main.zeek.html#redefinitions)\>

---

<div class="post-metadata">

**Author:** ![Christian](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/christian/32/593_2.png) [@Christian](https://community.zeek.org/u/Christian)\
**Post date:** [August 25, 2020, 10:15pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/12 "2020-08-25T22:15:35Z")

</div>

Good point, yeah. I took a look at this. The btests in the Zeek distribution use 352 different pcaps. The tests for the policy folder use 30; 18 of them are also used by other tests. That set is small, less than 1MB. Use of the same pcap across the policy tests is pretty limited and would likely occur only within one new package. So it's not too bad -- if those tests migrate into new Zeek packages, we would duplicate those 18 pcaps, but mostly just once.

Other Zeek packages seem pretty unlikely to need a pcap from the Zeek distribution, but I'd argue they probably benefit from a standard random.seed and some of the canonicalizers.

An alternative would be to install the full set of pcaps (that's 23MB), probably optionally, and make the availability of the pcap a test requirement.

What do you think? I personally could live with duplicating those pcaps.

Best,  
Christian

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [August 31, 2020, 9:14am UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/13 "2020-08-31T09:14:01Z")

</div>

To summarize this a bit, below is what I think what I heard so far.  
Feel free to respond further, I'll move this over into the ticket  
later once we have consensus.

Robin

- General preference to keep packages in individual repositories  
&nbsp;&nbsp;hosted inside a new GitHub organization "zeek-packages".

- Management through a meta-package that lists lists all desired  
&nbsp;&nbsp;packages as dependencies. The meta-package can version content by  
&nbsp;&nbsp;pinning packages to blessed versions.

- Tie these meta-packages to the current Zeek releases. To take this a  
&nbsp;&nbsp;bit further:

&nbsp;&nbsp;&nbsp;&nbsp;- I imagine this means that we'll have three meta-packages at any  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;point of time: "zeek-packages-current", "zeek-packages-lts", and  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"zeek-package-devel". When a new release comes out, these rotate  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;through.

&nbsp;&nbsp;&nbsp;&nbsp;- People can install packages for older (now unsupported) Zeek  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;versions by picking a older version of the corresponding  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;meta-package.

&nbsp;&nbsp;&nbsp;&nbsp;- The Zeek distribution can either download the current version of  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the meta package on install; or even just include the full  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content somehow (also see "zkg" below).

- Testing  
&nbsp;&nbsp;&nbsp;&nbsp;- Need to make tests standalone and less dependent on Zeek versions.

&nbsp;&nbsp;&nbsp;&nbsp;- Should make standard btest infrastructure available to tests  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(e.g., Zeek's btest helpers, pcaps).

&nbsp;&nbsp;&nbsp;&nbsp;- Provide integration tests that execute across the full set of  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"zeek-packages".

- Development  
&nbsp;&nbsp;&nbsp;&nbsp;- Make it it easy to work multiple packages at once (e.g., to  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update baseline; get all dependencies in place)

- Documentation  
&nbsp;&nbsp;&nbsp;&nbsp;- Use Zeekygen to document the full content of a meta package at  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;once; can host either on [docs.zeek.org](http://docs.zeek.org) or [packages.zeek.org](http://packages.zeek.org).

&nbsp;&nbsp;&nbsp;&nbsp;- Make it easy to autogen docs for individual packages (ideas:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GitHub Pages through Vlad's cookie-cutter; autogen on  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[packages.zeek.org](http://packages.zeek.org))

- zkg:  
&nbsp;&nbsp;&nbsp;&nbsp;- Distinguish standard/recommended packages from others.  
&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;- Could we add a way to "prime" zkg's package cache so that a Zeek  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;distribution could distribute a snapshot of "zeek-packages" for  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direct use; but zkg would still pull in updates if online access  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is available?

---

<div class="post-metadata">

**Author:** ![Christian](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/christian/32/593_2.png) [@Christian](https://community.zeek.org/u/Christian)\
**Post date:** [August 31, 2020, 5:57pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/14 "2020-08-31T17:57:48Z")

</div>

Great summary, thanks Robin.

> - zkg:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Could we add a way to "prime" zkg's package cache so that a Zeek  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;distribution could distribute a snapshot of "zeek-packages" for  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direct use; but zkg would still pull in updates if online access  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is available?

Related to this, I was wondering about zkg's status as an affiliated project ... if we strengthen the notion of packages from the core distribution, we may want to ensure zkg can be available from the outset (as a core component)?

I tried to look at some equivalents in other environments ... for example, it looks like when you install Python/Ruby from the official tarballs you get pip/gem out of the box.

Best,  
Christian

---

<div class="post-metadata">

**Author:** ![Jon\_Siwek](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jon\_Siwek](https://community.zeek.org/u/Jon_Siwek)\
**Post date:** [August 31, 2020, 6:13pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/15 "2020-08-31T18:13:20Z")

</div>

> - zkg:  
> &nbsp;&nbsp;&nbsp;&nbsp;- Distinguish standard/recommended packages from others.

Not sure what's meant there, but names/listings would all use  
`zeek/zeek-packages/` as a prefix and be a way of distinguishing.

If it's more about organizing meta-packages to have a secondary-level  
of optional/recommended content, there's maybe already a `suggests`  
metadata field that helps:

[https://docs.zeek.org/projects/package-manager/en/stable/package.html#suggests-field](https://docs.zeek.org/projects/package-manager/en/stable/package.html#suggests-field)

> &nbsp;&nbsp;&nbsp;&nbsp;- Could we add a way to "prime" zkg's package cache so that a Zeek  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;distribution could distribute a snapshot of "zeek-packages" for  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;direct use; but zkg would still pull in updates if online access  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is available?

It's possible. Needs more planning in terms of what's  
desired/required for the distribution and integration with CMake  
build/install logic.

\* Will `zkg` now be a required dependency for installing `zeek` ?

\* In any case, might assume CMake install logic can at least use `zkg`  
if available. Then, it may be convenient if the package distribution  
format is already something `zkg` knows well. Say, a "bundle".

\* After a `zkg unbundle`, packages should be set up to track the  
real/online git repo URLs such that `zkg refresh && zkg upgrade` could  
be used to receive updates.

\* In the case `zkg` isn't required/available when installing `zeek`,  
I'm sure there's some duplication/re-implementation of install logic  
we could add in the `zeek` CMake logic to install packages into usable  
locations, but it may generally be tricky/fragile to allow `zkg` to  
take over such an installation "after the fact". If there were such a  
change of mind in the person doing an install, it might be easiest to  
"do the `zeek` install process again, this time with `zkg` available".

- Jon

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [September 3, 2020, 7:03am UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/16 "2020-09-03T07:03:59Z")

</div>

Yeah, I'd be in favor of tying zkg more closely to Zeek itself so that  
it's always available as a required dependency. I think that also  
makes sense more generally as it has become a key part of our  
ecosystem. We can add it to auxil/ as another submodule. The Zeek-side  
can then use the code to get get packages in place directly, either  
through the command-line client or through the zkg Python API.

Robin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:47pm UTC](https://community.zeek.org/t/moving-policy-scripts-into-packages/6215/17 "2022-05-06T15:47:25Z")

</div>


