Skip to content

draft: Convert k8s policies to v2, and fix many bugs#2466

Closed
shimonp21 wants to merge 1 commit intocloudquery:mainfrom
shimonp21:policy_draft
Closed

draft: Convert k8s policies to v2, and fix many bugs#2466
shimonp21 wants to merge 1 commit intocloudquery:mainfrom
shimonp21:policy_draft

Conversation

@shimonp21
Copy link
Copy Markdown
Contributor

  • fixed many issues of duplicate rows. Each resources tested must have a single line in the output (but if our SELECT query joins with subtables, each resource may have many rows... ).
  • removed endpoint_api_serve_on_secure_port.. The check tested that the k8s-api was served on port 6443 or 443. But obviously the port number has very little to do with security. NSA-Cisa [page 18], of course, doesn't specify that these must be the port numbers. e.g. minikube uses port 8443 instead of 6443. The check also tested the port 'name', but that of course also doesn't necesarrily indicate the actual protocol used...
  • fixed default_deny_ingress and default_deny_egress policies to actually work (they always returned fail until now). Also deleted default_dont_allow_ingress and default_dont_deny_egress, since they seem to be duplicates of the deny policy?

https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF

Summary

- fixed many issues of duplicate rows. Each resources tested must have a single line in the output (but if our SELECT query joins with subtables, each resource may have many rows... ).
- removed endpoint_api_serve_on_secure_port.. The check tested that the k8s-api was served on port 6443 or 443. But obviously the port number has very little to do with security. NSA-Cisa [page 18], of course, doesn't specify that these must be the port numbers. e.g. minikube uses port 8443 instead of 6443. The check also tested the port 'name', but that of course also doesn't necesarrily indicate the actual protocol used...
- fixed `default_deny_ingress` and `default_deny_egress` policies to actually work (they always returned fail until now). Also deleted `default_dont_allow_ingress` and `default_dont_deny_egress`, since they seem to be duplicates of the `deny` policy?

https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF
@shimonp21 shimonp21 requested review from a team and disq and removed request for a team October 6, 2022 07:33
@shimonp21 shimonp21 marked this pull request as draft October 6, 2022 07:33
@cq-bot cq-bot added the k8s label Oct 6, 2022
@shimonp21 shimonp21 changed the title feat: Convert ks8 policies to v2, and fix many bugs draft: Convert ks8 policies to v2, and fix many bugs Oct 6, 2022
@shimonp21 shimonp21 requested a review from yevgenypats October 6, 2022 07:34
@hermanschaaf hermanschaaf changed the title draft: Convert ks8 policies to v2, and fix many bugs draft: Convert k8s policies to v2, and fix many bugs Oct 6, 2022
shimonp21 added a commit that referenced this pull request Oct 6, 2022
[draft for easier reviewing at
#2466]

- fixed many issues of duplicate rows. Each resources tested must have a
single line in the output (but if our SELECT query joins with subtables,
each resource may have many rows... ).
- removed endpoint_api_serve_on_secure_port.. The check tested that the
k8s-api was served on port 6443 or 443. But obviously the port number
has very little to do with security. NSA-Cisa [page 18], of course,
doesn't specify that these must be the port numbers. e.g. minikube uses
port 8443 instead of 6443. The check also tested the port 'name', but
that of course also doesn't necesarrily indicate the actual protocol
used...
- fixed `default_deny_ingress` and `default_deny_egress` policies to
actually work (they always returned fail until now). Also deleted
`default_dont_allow_ingress` and `default_dont_deny_egress`, since they
seem to be duplicates of the `deny` policy?


https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF

<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->

#### Summary

<!--
Explain what problem this PR addresses
-->

<!--
Use the following steps to ensure your PR is ready to be reviewed

- [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md)
🧑‍🎓
- [ ] Test locally on your own infrastructure
- [ ] Run `go fmt` to format your code 🖊
- [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint
[here](https://golangci-lint.run/usage/install/#local-installation))
- [ ] Update or add tests 🧪
- [ ] Ensure the status checks below are successful ✅
--->
@shimonp21 shimonp21 closed this Oct 6, 2022
@shimonp21
Copy link
Copy Markdown
Contributor Author

merged in #2467

daniel-garcia pushed a commit to infobloxopen/ibcq-source-k8s that referenced this pull request Feb 24, 2026
[draft for easier reviewing at
cloudquery/cloudquery#2466]

- fixed many issues of duplicate rows. Each resources tested must have a
single line in the output (but if our SELECT query joins with subtables,
each resource may have many rows... ).
- removed endpoint_api_serve_on_secure_port.. The check tested that the
k8s-api was served on port 6443 or 443. But obviously the port number
has very little to do with security. NSA-Cisa [page 18], of course,
doesn't specify that these must be the port numbers. e.g. minikube uses
port 8443 instead of 6443. The check also tested the port 'name', but
that of course also doesn't necesarrily indicate the actual protocol
used...
- fixed `default_deny_ingress` and `default_deny_egress` policies to
actually work (they always returned fail until now). Also deleted
`default_dont_allow_ingress` and `default_dont_deny_egress`, since they
seem to be duplicates of the `deny` policy?


https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF

<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 -->

#### Summary

<!--
Explain what problem this PR addresses
-->

<!--
Use the following steps to ensure your PR is ready to be reviewed

- [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md)
🧑‍🎓
- [ ] Test locally on your own infrastructure
- [ ] Run `go fmt` to format your code 🖊
- [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint
[here](https://golangci-lint.run/usage/install/#local-installation))
- [ ] Update or add tests 🧪
- [ ] Ensure the status checks below are successful ✅
--->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants