Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directory hierarchies not being created as Kubernetes configmap correctly #308

Closed
mmguero opened this issue Dec 4, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working cloud Relating to deployment of Malcolm in the cloud and/or with Kubernetes zeek Relating to Malcolm's use of Zeek
Milestone

Comments

@mmguero
Copy link
Collaborator

mmguero commented Dec 4, 2023

This was found when testing the release for v23.12.0, but since it is not a regression it didn't hold up that release. It'll be fixed in a subsequent release.

Sub-directories of arbitrary depth are not supported in my creation of configMaps. This means that the subdirectories MISP and STIX and whatever other arbitrary subdirectories there might be in there aren't getting created correctly for Kubernetes.

I need to see what we can do about this.

@mmguero mmguero added bug Something isn't working zeek Relating to Malcolm's use of Zeek cloud Relating to deployment of Malcolm in the cloud and/or with Kubernetes labels Dec 4, 2023
@mmguero mmguero added this to the v23.12.1 milestone Dec 4, 2023
@mmguero mmguero assigned mmguero and unassigned mmguero Dec 5, 2023
@mmguero mmguero self-assigned this Dec 18, 2023
mmguero added a commit to mmguero-dev/Malcolm that referenced this issue Dec 18, 2023
@mmguero
Copy link
Collaborator Author

mmguero commented Dec 18, 2023

So it turns out that configMap does not allow creating defining nested directory hierarchy (see kubernetes/kubernetes#62421, kubernetes/kubernetes#63362). There are some workarounds suggested, like zipping up the directory and unzipping on the other side.

What I decided to do instead can be seen here:

When creating the data maps for files in a directory, if there is directory structure I name the entry with the special _MALDIR_ replacer in the place of the directory separators. During container startup when we handle the special configmap and secretmap directories, we expand them back out and create the parent directories as needed.

so acid_MALDIR_ACID_MALDIR_s7comm_MALDIR_detect_MALDIR_copy.zeek will be renamed to acid/ACID/s7comm/detect/copy.zeek

This appears to work fine

@mmguero mmguero changed the title directory hierarchy of zeek/intel not being created as Kubernetes configmap correctly directory hierarchies not being created as Kubernetes configmap correctly Dec 18, 2023
@mmguero mmguero closed this as completed Dec 18, 2023
This was referenced Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cloud Relating to deployment of Malcolm in the cloud and/or with Kubernetes zeek Relating to Malcolm's use of Zeek
Projects
Status: Released
Development

No branches or pull requests

1 participant