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

proposal: Falco API #908

Merged
merged 6 commits into from
Dec 9, 2019
Merged

proposal: Falco API #908

merged 6 commits into from
Dec 9, 2019

Conversation

leodido
Copy link
Member

@leodido leodido commented Oct 30, 2019

What type of PR is this?

/kind design

/kind documentation

Any specific area of the project related to this PR?

/area proposals

What this PR does / why we need it:

Writes down a proposal as the outcome of various discussions between me, @fntlnz, @kris-nova, and the whole community about giving Falco an API.

Which issue(s) this PR fixes:

will link to issues later

Special notes for your reviewer:

WIP

In the coming days me and @fntlnz are going to complete it.

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
proposals/20191030-api.md Outdated Show resolved Hide resolved
proposals/20191030-api.md Outdated Show resolved Hide resolved
proposals/20191030-api.md Outdated Show resolved Hide resolved
proposals/20191030-api.md Outdated Show resolved Hide resolved
proposals/20191030-api.md Outdated Show resolved Hide resolved
leodido and others added 2 commits October 31, 2019 16:51
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>

Co-Authored-By: Lorenzo Fontana <lo@linux.com>
Co-Authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
- Receive Falco drops with a well-defined contract over wire --> **drops**
- Receive current Falco version and related meta information (commit hash, built type, etc.) --> **version**
- Configure Falco via API (CRUD) -> **configs**
- Inject and/or modify Falco rules via API (CRUD) --> **rules**

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be awesome but would still require a route into the kubernetes cluster (or instance) to configure these or a sidecar that is used for configuration.

I am fairly new to the Falco project but has any thought been given to a central management server for Falco agents to report into and fetch new configurations / rules dynamically rather than having to hit an API or reload rules manually? I know this would be a new project to be spun up of the management server but interested if this has been proposed / discussed in the past before

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like this can help with what are you suggesting?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WRT having any external configuration management, the work starts here with implementing a clean interface around the core of the program.

I think we would all be very excited to see work like a sidecar or configuration management server come to life, and the Falco community would be happy to sponsor this work.

If you have ideas for configuration management we could open up a new proposal (like this one) with your ideas, and get a repository and a Falco client set up so work can begin building out something like what you described 😄

Copy link
Contributor

@krisnova krisnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments around making it clear that there are two things happening here

  1. We are going to begin advertising that Falco has an API, and that users will be able to interface with it. This API is written in C++

  2. We furthermore hope to implement the C++ API using gRPC as a first implementation to exposing the API over a network connection

I hope this makes sense - and just adding a little clarity would go a long way

Requesting changes, but am not going to nit.

proposals/20191030-api.md Show resolved Hide resolved
proposals/20191030-api.md Outdated Show resolved Hide resolved
proposals/20191030-api.md Show resolved Hide resolved
proposals/20191030-api.md Outdated Show resolved Hide resolved
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
@leodido leodido force-pushed the proposal/falco-api branch from 7ad1881 to c7de55e Compare December 5, 2019 16:50
@leodido leodido requested a review from krisnova December 5, 2019 16:50
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
@leodido leodido force-pushed the proposal/falco-api branch from c7de55e to cc4efbe Compare December 5, 2019 16:51
Copy link
Contributor

@krisnova krisnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @leodido this looks great! My only suggestion would be if we could clarify where/how we plan on tracking and versioning our .proto files in the repository.

We can probably just open an issue, or add to this plan, or even just put it in a comment or PR

But we should clarify our plan for tracking them moving forward.

Approving for now and we can add language whenever/however we want.

@poiana poiana added the lgtm label Dec 5, 2019
@poiana
Copy link
Contributor

poiana commented Dec 5, 2019

LGTM label has been added.

Git tree hash: b15034adeafa0366c7f9d5dc15adb32564db6ceb

@poiana
Copy link
Contributor

poiana commented Dec 5, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kris-nova

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Dec 5, 2019
@max-lobur
Copy link

max-lobur commented Dec 6, 2019

My comment applies to any configuration API on k8s. Everything going towards gitops right now, because it's easier to use, it's auditable (e.g. SOC2, PCI), there's governance (GH protected branches), history and so on. Gitops is huge when it comes to compliance and a great pattern for any security-aware company, which I think applies to any falco adopter.

The falco flow with API will eventually be:

User -> git repo (terraform code - not native for k8s users) -> terraform CI job (flacky) -> terraform falco provider (new) -> falco go client (new) -> falco API (new) -> falco configuration engine (new?) -> falco.

Where API and terraform provider is a huge chunk of work because it's network interaction and it has to be properly secured, throttled and instrumented.

I think the much easier k8s flow would be:

User -> git repo (CRD instance - native for k8s users) -> gitops (e.g. flux-cd, not so flacky) -> CRD object on a cluster (exists) -> falco configuration engine (e.g. falco-operator, exists) -> falco.

This already fits into all our existing pipelines, it's actually already built!

Speaking of 3rd party dynamic rules providers. Any security product which will support falco will run its agent in k8s anyways (already do), and they will have the communication with their agent anyways, so it will be much easier for them to just inject CRDs, and it will be much easier to me just to set RBAC for CRDs instead of thinking of another API.

@max-lobur
Copy link

max-lobur commented Dec 6, 2019

I think these days configuration management of anything in k8s is pretty much solved with CRDs, and it's the same, very common pattern for eveything I run on k8s.

I'd be much more interested to see record-n-replay, a development of falco-rules catalog (e.g. the hub), adoption within security vendors, smarter rules and so on - the core falco business.

@kris-nova @leodido do you have any other use case where API is crucial VS gitops-CRD?

@krisnova
Copy link
Contributor

krisnova commented Dec 6, 2019

Hey @max-lobur

So I think you bring up some valid topics here, and to be clear the pipeline you suggested would completely work with this proposal.

This work defines very clear, rigid, and secure-by-default interfaces for working with Falco. Regardless of higher level implementation (such as Kubernetes, or gitops) users would now have a clean way of plumbing data into and out of Falco.

Once we have a contract for interfacing with Falco via C/C++ building things out like CRDs are a natural next step that we plan on taking. Or in a perfect world, that the community could help us with.

@max-lobur
Copy link

I see, so it's mostly for C/C++ interface rather than for configuration management over network

@krisnova
Copy link
Contributor

krisnova commented Dec 6, 2019

Yes exactly @max-lobur

The term API in this context is similar to the Linux API. It means a standardized contract in code, that most likely will ultimately make it to the network. In this case, we are also coupling the new API with gRPC to support both a contract in code, as well as 1 (of many) possible network implementations.

One of the big features here is that we are run mutual TLS by default 😎 and are building tools around making that process as user friendly as possible


Right now we have logic in C/C++ that deals with pulling data from a source directly.

This proposal attempts to standardize the input/output mechanisms for the C/C++ code so that we can build on top of it.

So the pipeline you proposed is a fantastic example of how this new API would be useful

@leodido leodido changed the title wip: proposal: Falco API proposal: Falco API Dec 9, 2019
@leodido leodido marked this pull request as ready for review December 9, 2019 14:49
@leodido
Copy link
Member Author

leodido commented Dec 9, 2019

Clarification about where/how we plan to track and version the .proto files.
cc @kris-nova

Since it is very likely that also the engine (userspace/engine) and not only userspace/falco will use some of the proto definitions (eg., schema.proto) my plan is to mainly experiment with two approaches:

  1. create a root level directory in Falco repository responsible to contain the proto files used across the repository (API, engine, etc.) and the organization (eg., client-go, client-py need them)
  2. create another repository in the falcosecurity organization for them

I have not made a decision on this yet since I would like to investigate it hands-on while writing the code. But it will be option 1 or option 2.

Do you have suggestions/ideas/preferences about it?

@krisnova
Copy link
Contributor

krisnova commented Dec 9, 2019

@leodido,

Sounds good to me 👌🏻

@leodido leodido merged commit 7159b43 into dev Dec 9, 2019
@poiana poiana deleted the proposal/falco-api branch December 9, 2019 15:46
@fntlnz fntlnz added this to the 0.19.0 milestone Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants