-
Notifications
You must be signed in to change notification settings - Fork 3
/
slide-deck.html
17512 lines (16098 loc) · 668 KB
/
slide-deck.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>CFEngine in a day</title>
<meta name="author" content="Nick Anderson"/>
<style type="text/css">
.underline { text-decoration: underline; }
</style>
<link rel="stylesheet" href="./reveal.js/dist/reveal.css"/>
<link rel="stylesheet" href="./reveal.js/dist/theme/black.css" id="theme"/>
<link rel="stylesheet" href="cfengine.css"/>
<link rel="stylesheet" href="./highlight.js/styles/agate.css"/>
<meta name="description" content="CFEngine in a Day">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section id="sec-title-slide" data-background="./orange-blue-tilt-right.png">
<h1>CFEngine in a day</h1>
</section>
<section>
<section id="slide-org89ed10b" data-timing="120">
<h2 id="org89ed10b">Before we start</h2>
</section>
<section id="slide-org6d82b40">
<h3 id="org6d82b40">Schedule</h3>
<ul>
<li>9:30 AM - 5:00 PM</li>
<li>We will check need for breaks at the end of each section</li>
</ul>
<aside class="notes">
<ul>
<li>Who will volunteer to <b>remind me of breaks</b>?</li>
</ul>
</aside>
</section>
<section id="slide-orgea3a205">
<h3 id="orgea3a205">Use the source</h3>
<p>
<a href="https://github.com/nickanderson/cfengine-training">github.com/nickanderson/cfengine-training</a>
</p>
<aside class="notes">
<p>
See a <b>mistake</b>? Please consider submitting a Pull Request.
</p>
</aside>
</section>
<section id="slide-org5c6c089">
<h3 id="org5c6c089">Hi, I'm Nick</h3>
<ul>
<li>Wife, 2 kids and a dog</li>
<li>Sysadmin/Infrastructure Engineer/Doer of things</li>
<li>CFEngineering since ~2010</li>
<li>Find me online
<ul>
<li><a href="mailto:[email protected]">[email protected]</a> | <a href="https://cfengine.com/author/nick-anderson/">https://cfengine.com/author/nick-anderson/</a></li>
<li><a href="https://fosstodon.org/@nickanderson">@[email protected]</a> | <a href="https://twitter.com/cmdln_">@cmdln_</a></li>
<li><a href="mailto:[email protected]">[email protected]</a> | <a href="https://cmdln.org">https://cmdln.org</a></li>
<li><a href="https://linkedin.com/in/hithisisnick">linkedin.com/in/hithisisnick</a></li>
<li><code>9274 E588 E866 A10B 713C 9CCD 9EB3 AD42 5D1C CC11</code></li>
</ul></li>
</ul>
<aside class="notes">
<p>
I have worked in a wide variety of environments:
</p>
<ul>
<li>Geek on wheels</li>
<li>One man IT department</li>
<li>E-commerce</li>
<li>Large Enterprise</li>
<li>High Performance Computing</li>
<li>Usually working closely with developers</li>
</ul>
</aside>
</section>
<section id="slide-org19f850d">
<h3 id="org19f850d">Who are you?</h3>
<ul>
<li>Name</li>
<li>Role</li>
<li>Goals for this training</li>
</ul>
</section>
</section>
<section>
<section id="slide-org0fd716c">
<h2 id="org0fd716c">What this training covers</h2>
<ul>
<li>What is CFEngine</li>
<li>High level architecture overview</li>
<li>Language fundamentals (through CFEngine 3.21.0)</li>
<li>Examples and Exercises</li>
<li>Useful tooling and tips</li>
</ul>
</section>
</section>
<section>
<section id="slide-org6b8a8e6">
<h2 id="org6b8a8e6">Why Automation?</h2>
<blockquote>
<p>
Every time someone logs onto a system by hand, they jeopardize everyone's
understanding of the system. – Mark Burgess
</p>
</blockquote>
</section>
</section>
<section>
<section id="slide-orge1c656b">
<h2 id="orge1c656b">What is CFEngine?</h2>
<ul>
<li>Secure</li>
<li>Scalable</li>
<li>Agile <b>infrastructure automation tool</b></li>
</ul>
<aside class="notes">
<p>
Designed to enable continuous operations using a distributed model based approach.
</p>
<dl>
<dt>Modern</dt><dd>Understands complex data structures (JSON, YAML, CSV).</dd>
</dl>
</aside>
</section>
<section id="slide-org68322a4">
<h3 id="org68322a4">History</h3>
<ul>
<li>Written by <a href="https://en.wikipedia.org/wiki/Mark_Burgess_(computer_scientist)">Mark Burgess</a></li>
<li>Originally released in 1993.</li>
<li><a href="http://people.scs.carleton.ca/~soma/biosec/readings/burgess-immunology.pdf">Computer Immunology</a> (Self Healing) 1998</li>
<li>CFEngine 2 (1998)</li>
<li><a href="http://download.springer.com/static/pdf/884/chp%25253A10.1007%25252F11568285_9.pdf">Promise Theory</a> (2005)</li>
<li>CFEngine 3 (2008)</li>
<li>Company Founded (2008)</li>
</ul>
<aside class="notes">
<dl>
<dt>Wait, it's been around since 1993, what makes it <i>modern</i>?</dt><dd>Understands complex data structures (JSON, YAML, CSV).</dd>
</dl>
</aside>
</section>
<section id="slide-org2ca3dce">
<h3 id="org2ca3dce">Small</h3>
<p>
As of Feb 2020:
</p>
<ul>
<li><a href="https://lgtm.com/projects/g/cfengine/core/context:cpp">Lines of code</a> ~ 115k</li>
<li>~ 6M Package size</li>
<li>Memory Utilization: ~ 80MB
<ul>
<li>cf-agent ~ 30MB</li>
<li>cf-serverd ~ 30MB</li>
<li>cf-execd ~10MB</li>
<li>cf-monitord ~ 10MB</li>
</ul></li>
</ul>
</section>
<section id="slide-orgd1e5499">
<h3 id="orgd1e5499">Secure</h3>
<p>
A good track record.
</p>
<ul>
<li><a href="http://web.nvd.nist.gov/view/vuln/search">http://web.nvd.nist.gov/view/vuln/search</a></li>
</ul>
</section>
<section id="slide-orgeecd8bd">
<h3 id="orgeecd8bd">Portable</h3>
<p>
Known to run on many platforms, and interesting places.
</p>
<div id="org89fad1a" class="figure">
<p><img src="data/4d/85802b-4bd6-4473-be8c-4add03fa9c6c/Where_CFEngine_Runs_2016-10-15_15-20-42.png" alt="Where_CFEngine_Runs_2016-10-15_15-20-42.png" width="600" />
</p>
</div>
<aside class="notes">
<ul>
<li>Platforms: Linux, HPUX, Solaris (sparc/x86), AIX, Windows, Android,</li>
<li>Largest known plant is ~1M nodes</li>
<li>Smart infrastructure (interactive bus signs in France)
<ul>
<li>Interactive Bus Signs in France</li>
<li>Automated payment system collections</li>
</ul></li>
<li>Lasers (that make puppets)
<ul>
<li>From Hallway track at LISA 2013</li>
</ul></li>
<li>Dialysis Machines (over 50% of machines in the US)
<ul>
<li>From user report</li>
</ul></li>
<li>Appliances
<ul>
<li>Ezuce sipXecs (Voip), <a href="https://sipfoundry.atlassian.net/wiki/display/sipXecs/cfengine+tips">Blog Post</a></li>
<li>StashNode Pro, <a href="https://github.com/Cryptoo/cfengine">Cryptoo</a>
<ul>
<li>DMZ</li>
<li>Tor</li>
<li>Bitcoin</li>
<li>Bittorrent</li>
</ul></li>
</ul></li>
</ul>
</aside>
</section>
<section id="slide-org591874a">
<h3 id="org591874a">Resilient & Autonomous</h3>
<div class="column" style="float:left; width:50%">
<div id="orge0203a6" class="figure">
<p><img src="data/29/81a0e7-5430-44bd-84b3-32928fbdeea1/2020-02-18_11-16-51_JAN15_05_179787493.jpg" alt="2020-02-18_11-16-51_JAN15_05_179787493.jpg" width="800" />
</p>
</div>
</div>
<div class="column" style="float:right; width:50%">
<ul>
<li>Policy cached locally</li>
<li>Decisions made locally</li>
<li>Actions taken locally</li>
<li>Convergence, repair what you can and revisit soon</li>
</ul>
</div>
<aside class="notes">
<ul>
<li>Rely on others as little as possible</li>
<li>Failures don't block by default</li>
<li>Run frequently
<ul>
<li>Who's written a script?</li>
<li>When it's time to execute that script 6 months later, what do you do?</li>
</ul></li>
</ul>
</aside>
</section>
<section id="slide-orgc117715">
<h3 id="orgc117715">Declarative</h3>
<p>
Focus on the <b>desired end state</b>.
</p>
<aside class="notes">
<ul>
<li>The GOAL</li>
<li>Align with business priorities</li>
<li>Less about How specifically you want to arrive somewhere, and more about what specifically you want in the end.
<ul>
<li>I want my steak medium rare.</li>
<li>vs</li>
<li>I want a 22mm thick steak, cooked at 325 degrees for 3.5 minutes on each side.</li>
</ul></li>
</ul>
</aside>
</section>
<section>
<div id="org2c8253e" class="figure">
<p><img src="data/a6/e60c34-5641-48b6-913b-85e54fa9effd/declarative_vs_imperative_crop_2016-10-15_15-28-37.png" alt="declarative_vs_imperative_crop_2016-10-15_15-28-37.png" />
</p>
</div>
</section>
<section id="slide-orgc393cb6">
<h3 id="orgc393cb6">Declarative vs Imperative</h3>
<pre class="example" id="org1c569a8">
bundle agent main | #!/bin/env/bash
{ | PKG="openssh-server"
packages: | rpm -q ${PKG} || yum install ${PKG}
"openssh-server" | yum check-update openssh-server
policy => "present", | if [ $? -eq 100 ]; then
version => "latest"; | yum upgrade openssh-server
} | fi
</pre>
<aside class="notes">
<p>
Goals & Way-points vs Strict Order of operations
</p>
<p>
It works kind of like a GPS. It doesn't matter where you start, or the wrong
turns you make it will continually re-route to reach the destination. And your
still responsible for driving, the GPS doesn't drive your car (would you trust
it to? (Alaskan airports, ponds, fields, etc …)
</p>
<p>
<a href="http://blog.aggregatedintelligence.com/2009/06/difference-between-imperative-and.html">http://blog.aggregatedintelligence.com/2009/06/difference-between-imperative-and.html</a>
<a href="http://channel9.msdn.com/blogs/pdc2008/tl16">http://channel9.msdn.com/blogs/pdc2008/tl16</a>
</p>
</aside>
</section>
<section id="slide-org33a2f43">
<h3 id="org33a2f43">Typical use cases</h3>
<ul>
<li>Any <b>local</b> resource/state
<ul>
<li>Manage files, processes, commands</li>
</ul></li>
<li>Security Hardening</li>
<li>Compliance</li>
<li>Application Deployment/Management</li>
<li>Inventory</li>
</ul>
<aside class="notes">
<ul>
<li>Interesting places:
<ul>
<li>Industrial (lazer cutters, water testing devices)</li>
<li>Smart Infrastructure (Trains, Trams, Signs, Grocery Shopper Behaviour)</li>
</ul></li>
<li>Integrating CFEngine with other services
<ul>
<li>Set environment from ServiceNow CMDB
<ul>
<li>Hub caches information from ServiceNow, provided to agents as structured data</li>
</ul></li>
</ul></li>
<li>Extrememly dynamic policies
<ul>
<li>When production host has deviated from "normal" amount of outbound ssh
connections kill ssh sessions, firewall host, ticket.</li>
</ul></li>
</ul>
</aside>
</section>
</section>
<section>
<section id="slide-org2a4a4a4">
<h2 id="org2a4a4a4">Editions</h2>
</section>
<section id="slide-orgca0ac94">
<h3 id="orgca0ac94">Community (core)</h3>
<ul>
<li><a href="https://github.com/cfengine/core">Github</a></li>
<li><a href="https://cfengine.com/product/community/source-code/">Tarballs</a></li>
<li><a href="https://cfengine.com/product/community/">Binary Packages</a></li>
<li><a href="https://cfengine.com/product/community/cfengine-linux-distros/">Linux Package Repositories</a></li>
</ul>
</section>
<section id="slide-org849048c">
<h3 id="org849048c">Enterprise Features</h3>
<div class="column" style="float:left; width:50%">
<ul>
<li>Mission Portal (Web UI)</li>
<li>Alerts and Triggered Actions</li>
<li>Inventory Reporting</li>
<li>Change Reporting</li>
<li>Compliance Reporting</li>
</ul>
</div>
<div class="column" style="float:right; width:50%">
<ul>
<li>File Integrity Monitoring</li>
<li>Measurements</li>
<li>REST APIs</li>
<li>SQL Reporting</li>
<li>Single Pane of Glass Reporting</li>
</ul>
</div>
</section>
<section id="slide-org241fa02">
<h3 id="org241fa02">Enterprise</h3>
<ul>
<li><a href="https://docs.cfengine.com/latest/guide-installation-and-configuration-general-installation-installation-enterprise-vagrant.html">Vagrant Environment</a></li>
<li><a href="http://cfengine.com/product/cfengine-enterprise-free-25/">Binary Packages</a></li>
</ul>
</section>
<section id="slide-orge4877e3">
<h3 id="orge4877e3">Release schedule</h3>
<ul>
<li>Every 6 months</li>
<li>New LTS series every 1.5 years</li>
</ul>
</section>
<section id="slide-org64efe27">
<h3 id="org64efe27">Current Releases</h3>
<ul>
<li>3.18 ( June 2021 - June 2024 )
<ul>
<li>3.18.2 ( June 2022 )</li>
</ul></li>
<li>3.21 ( December 2022 - December 2025 )
<ul>
<li>3.21.0 ( December 22nd 2022 )</li>
</ul></li>
</ul>
</section>
</section>
<section>
<section id="slide-org0b96e00">
<h2 id="org0b96e00">Tools</h2>
<div class="outline-text-2" id="text-org0b96e00">
</div>
</section>
<section id="slide-org4554c50">
<h3 id="org4554c50"><code>cf-remote</code></h3>
<p>
Tooling to facilitate the deployment of CFEngine.
</p>
<pre class="example" id="orgd331236">
Commands (use cf-remote COMMAND --help to get more info):
{info,install,uninstall,packages,list,download,run,save,sudo,scp,spawn,show,destroy,deploy}
info Get info about the given hosts
install Install CFEngine on the given hosts
uninstall Install CFEngine on the given hosts
packages Get info about available packages
list List CFEngine packages available for download
download Download CFEngine packages
run Run the command given as arguments on the given hosts
save Save host(s) with a group name to use in other
commands
sudo Run the command given as arguments on the given hosts
with 'sudo'
scp Copy the given file to the given hosts
spawn Spawn hosts in the clouds
show Show hosts spawned by or added to cf-remote
destroy Destroy hosts spawned in the clouds
deploy Deploy policy-set (masterfiles) to hub
</pre>
</section>
<section id="slide-org7ccb500">
<h4 id="org7ccb500">Install <code>cf-remote</code></h4>
<div class="org-src-container">
<pre><code class="sh" >exec 2>&1
pip3 install cf-remote
:
</code></pre>
</div>
</section>
<section id="slide-orge87d71b">
<h4 id="orge87d71b">Install and bootstrap with <code>cf-remote</code></h4>
<div class="org-src-container">
<label class="org-src-name">Install and bootstrap remote hosts</label>
<pre><code class="shell" >cf-remote install --hub 34.252.28.73 --bootstrap 172.31.30.237
</code></pre>
</div>
</section>
<section id="slide-orga06329d">
<h4 id="orga06329d">Learn more about <code>cf-remote</code></h4>
<ul>
<li><a href="https://cfengine.com/tags/cf-remote/">https://cfengine.com/tags/cf-remote/</a></li>
<li><a href="https://github.com/cfengine/core/tree/master/contrib/cf-remote">https://github.com/cfengine/core/tree/master/contrib/cf-remote</a></li>
</ul>
</section>
<section id="slide-org918b1f0">
<h3 id="org918b1f0"><code>cfbs</code></h3>
<p>
Manage CFEngine Build projects (adding modules, policy files, updating etc.)
</p>
<pre class="example" id="orgc78f696">
usage: cfbs [-h] [--loglevel LOGLEVEL] [--version] [--force]
[--non-interactive] [--index INDEX] [--check]
[--checksum CHECKSUM] [--keep-order] [--git {yes,no}]
[--git-user-name GIT_USER_NAME] [--git-user-email GIT_USER_EMAIL]
[--git-commit-message GIT_COMMIT_MESSAGE] [--ignore-versions-json]
[cmd] [args ...]
CFEngine Build System.
positional arguments:
cmd The command to perform (add, build, clean, commit,
download, help, info, init, input, install, pretty,
remove, search, show, status, update, validate)
args Command arguments
</pre>
</section>
<section id="slide-orge692837">
<h4 id="orge692837">Install <code>cfbs</code></h4>
<div class="org-src-container">
<pre><code class="sh" >exec 2>&1
pip3 install cfbs
:
</code></pre>
</div>
</section>
<section id="slide-org60c12cd">
<h4 id="org60c12cd">Initialize a project</h4>
<div class="org-src-container">
<pre><code class="sh" >exec 2>&1
cfbs init
:
</code></pre>
</div>
</section>
<section id="slide-org9086a18">
<h4 id="org9086a18">Build a project</h4>
<div class="org-src-container">
<pre><code class="sh" >exec 2>&1
cfbs build
:
</code></pre>
</div>
</section>
<section id="slide-org244a834">
<h3 id="org244a834"><code>cf-locate</code></h3>
<dl>
<dt><code>cf-locate</code></dt><dd>Command line tool to help locate and optionally display a body
or bundle within a policy</dd>
</dl>
<aside class="notes">
<p>
Ever read a policy and see a body that you want to understand more?
</p>
<p>
Try it with <code>cf-locate scoped_classes_generic -f /path_to_masterfiles</code>
</p>
</aside>
</section>
<section id="slide-org23f497e">
<h4 id="org23f497e">Installing <code>cf-locate</code></h4>
<p>
It's a perl script and you will need <code>File::HomeDir</code>.
</p>
<div class="org-src-container">
<pre><code class="sh" >exec 2>&1
sudo apt install libfile-homedir-perl
curl https://raw.githubusercontent.com/cfengine/core/master/contrib/cf-locate/cf-locate --output ~/.local/bin/cf-locate
chmod 700 ~/.local/bin/cf-locate
:
</code></pre>
</div>
</section>
<section id="slide-org6354e49">
<h4 id="org6354e49">Using cf-locate</h4>
<div class="org-src-container">
<pre><code class="sh" >exec 2>&1
~/.local/bin/cf-locate results | ansi2txt
:
</code></pre>
</div>
<pre class="example">
-> body or bundle matching 'results' found in /home/nickanderson/.cfagent/inputs/failsafe.cf:463
body classes failsafe_results(scope, class_prefix)
-> body or bundle matching 'results' found in /home/nickanderson/.cfagent/inputs/lib/common.cf:225
body classes results(scope, class_prefix)
-> body or bundle matching 'results' found in /home/nickanderson/.cfagent/inputs/lib/common.cf:322
body classes diff_results(scope, x)
</pre>
</section>
<section id="slide-orgb8c184c">
<h3 id="orgb8c184c"><code>masterfiles-stage</code></h3>
<ul>
<li>Maintain multiple checkouts of policy sets.</li>
</ul>
<aside class="notes">
<ul>
<li>Useful for implementing policy channels</li>
<li>Installed with CFEngine Enterprise Hub</li>
</ul>
</aside>
</section>
</section>
<section>
<section id="slide-org90e6625">
<h2 id="org90e6625">Client/Server Architecture</h2>
<div id="org9400669" class="figure">
<p><img src="data/66/fd45c5-3f73-49e4-a938-ec3ecbdcd8ef/2020-02-18_11-34-56_ClientServerArchitecture.png" alt="2020-02-18_11-34-56_ClientServerArchitecture.png" width="800" />
</p>
</div>
</section>
<section id="slide-org249cc45">
<h3 id="org249cc45">Client Server Communications</h3>
<ul>
<li>Utilizes port 5308 (<code>grep 5308 /etc/services</code>)</li>
<li>Encrypted (TLS)</li>
<li>Public key authentication (<b>key exchange required</b>)</li>
<li>Agents download policy from hub</li>
<li>Hub downloads reports from remote agents</li>
</ul>
<aside class="notes">
<ul>
<li>Policy servers typically bootstrap to themselves</li>
<li>SSH-like model (public/private keypair)</li>
<li>There is no Certificate Authority that can be compromised</li>
</ul>
</aside>
</section>
</section>
<section>
<section id="slide-org05c17ce">
<h2 id="org05c17ce">Agent Components</h2>
</section>
<section id="slide-orga80206c">
<h3 id="orga80206c">Agent Components</h3>
<div id="orgbb28ce8" class="figure">
<p><img src="data/21/633eaf-2b0a-4fef-a25f-7760276b0a5d/cfengine_agent_components_diagram_2016-10-15_16-01-34.png" alt="cfengine_agent_components_diagram_2016-10-15_16-01-34.png" />
</p>
</div>
</section>
<section id="slide-org5eb7526">
<h3 id="org5eb7526"><code>cf-hub</code></h3>
<div id="org8e6485e" class="figure">
<p><img src="data/98/b666a6-d302-47e4-b164-b6653bcca1a8/cfengine_agent_components_diagram_cf-hub_2016-10-15_16-03-31.png" alt="cfengine_agent_components_diagram_cf-hub_2016-10-15_16-03-31.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Collects reports from remote agents</li>
<li>Obeys "<code>common control</code>" and "<code>hub control</code>" bodies</li>
</ul>
<aside class="notes">
<ul>
<li>Runs on the Enterprise Hub, talks to cf-serverd on remote agent on port 5308</li>
<li>Collect reports from remote agents</li>
<li>Obeys "<code>common control</code>" and "<code>hub control</code>" bodies</li>
</ul>
</aside>
</section>
<section id="slide-org25f298c">
<h3 id="org25f298c"><code>cf-runagent</code></h3>
<div id="org51d6217" class="figure">
<p><img src="data/9c/2d7c2f-c5e3-47b2-b7df-fdf875f38643/cfengine_agent_components_diagram_cf-runagent_2016-10-15_21-11-14.png" alt="cfengine_agent_components_diagram_cf-runagent_2016-10-15_21-11-14.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Requests invocation of cf-agent on remote hosts</li>
<li>Cannot invoke arbitrary commands</li>
<li>Define classes to modify behavior (<code>--define</code>)</li>
<li>Specify bundlesequence (<code>--remote-bundles</code>)</li>
</ul>
<aside class="notes">
<ul>
<li>Invokes cf-agent on remote hosts
<ul>
<li>Requires established trust</li>
<li>Normally run from server to “ping” the clients</li>
</ul></li>
<li>Normally run on the server to “ping” the clients</li>
<li>Cannot invoke arbitrary commands - just wake up cf-agent</li>
<li>Define classes to modify behavior</li>
<li>Specify bundlesequence (<code>--remote-bundles</code> added in 3.10)</li>
</ul>
</aside>
</section>
<section id="slide-org6f40411">
<h3 id="org6f40411"><code>cf-serverd</code></h3>
<div id="orge22fd02" class="figure">
<p><img src="data/9f/5cf6c5-5e00-49f9-8392-5cec4c2bb9ea/cfengine_agent_components_diagram_cf-serverd_2016-10-15_21-16-21.png" alt="cfengine_agent_components_diagram_cf-serverd_2016-10-15_21-16-21.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Listens for connections on <b>TCP/5308</b></li>
<li>Enforces access control and authentication</li>
<li>Serves files</li>
<li>Serves <code>cf-runagent</code> requests</li>
<li>Serves reports to <code>cf-hub</code></li>
<li>Runs on both server and clients</li>
<li>Evaluates "<code>common</code>" and "<code>server</code>" bundles</li>
<li>Obeys body "<code>server control</code>"</li>
</ul>
<aside class="notes">
<ul>
<li>Listens for connections on <b>TCP/5308</b></li>
<li>Enforces access control and authentication</li>
<li>Serves files</li>
<li>Serves <code>cf-runagent</code> requests</li>
<li>Serves reports to <code>cf-hub</code></li>
<li>Runs on both server and clients</li>
<li>Evaluates "<code>common</code>" and "<code>server</code>" bundles</li>
<li>Obeys body "<code>server control</code>"</li>
</ul>
</aside>
</section>
<section id="slide-org17d9564">
<h3 id="org17d9564"><code>cf-key</code></h3>
<div id="org7939929" class="figure">
<p><img src="data/57/b0a68d-ece6-4ffc-81e3-cc84b6009b35/cfengine_agent_components_diagram_cf-key_2016-10-15_21-18-51.png" alt="cfengine_agent_components_diagram_cf-key_2016-10-15_21-18-51.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Show recent connections</li>
<li>Manage trust of public keys</li>
<li>Generates key pairs</li>
<li>Installs Enterprise License</li>
</ul>
<aside class="notes">
<ul>
<li>Show recent connections</li>
<li>Manage trust of public keys</li>
<li>Generates key pairs</li>
<li>Installs Enterprise License</li>
</ul>
</aside>
</section>
<section id="slide-org3725171">
<h3 id="org3725171"><code>cf-promises</code></h3>
<div id="org1908b19" class="figure">
<p><img src="data/52/bb3c22-18bf-4c80-82ba-0aad82ea1393/cfengine_agent_components_diagram_cf-promises_2016-10-15_21-21-02.png" alt="cfengine_agent_components_diagram_cf-promises_2016-10-15_21-21-02.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Checks Syntax</li>
<li>Dump Syntax (<code>cf-promises --syntax-description</code></li>
<li>Tag Policy Releases (<code>cf-promises --tag-release</code>)</li>
<li>Show first order Variables and Classes (<code>cf-promises --show-vars --show-classes</code></li>
</ul>
<aside class="notes">
<ul>
<li>Checks Syntax</li>
<li>Dump Syntax (<code>cf-promises --syntax-description</code></li>
<li>Tag Policy Releases (<code>cf-promises --tag-release</code>)</li>
<li>Show first order Variables and Classes (<code>cf-promises --show-vars --show-classes</code></li>
</ul>
</aside>
</section>
<section id="slide-orgf2f442d">
<h3 id="orgf2f442d"><code>cf-monitord</code></h3>
<div id="orgb3b972a" class="figure">
<p><img src="data/bc/d33f08-1c02-4d78-b118-a98bf6986040/cfengine_agent_components_diagram_cf-monitord_2016-10-15_21-22-23.png" alt="cfengine_agent_components_diagram_cf-monitord_2016-10-15_21-22-23.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Measures things</li>
<li>Defines <code>mon.*</code> variables</li>
<li>Defines classes based on anomaly detection</li>
<li>Evaluates "<code>common</code>" and "<code>monitor</code>" bundles</li>
<li>Obeys "<code>common control</code>" and "<code>monitor control</code>" bodies</li>
</ul>
<aside class="notes">
<ul>
<li><code>mon.*</code> variables record average, last, and deviation</li>
<li>Anomaly classes <code>ssh_in_high</code>, <code>ssh_out_high_dev3</code></li>
<li>Next …. cf-execd</li>
</ul>
</aside>
</section>
<section id="slide-org2608dfe">
<h3 id="org2608dfe"><code>cf-execd</code></h3>
<div id="org4e65b7a" class="figure">
<p><img src="data/3c/3c8cee-7086-4250-9152-21ca5879c2b2/cfengine_agent_components_diagram_cf-execd_2016-10-15_21-24-05.png" alt="cfengine_agent_components_diagram_cf-execd_2016-10-15_21-24-05.png" />
</p>
</div>
</section>
<section>
<ul>
<li>Executes <code>cf-agent</code> periodically</li>
<li>Controls period and splay time</li>
<li>Collects, stores, and sends output</li>
<li>Evaluates "<code>common</code>" bundles</li>
<li>Obeys "<code>executor control</code>" body</li>
</ul>
<aside class="notes">
<ul>
<li>splay time is the amount of time an agent waits before actually doing the scheduled execution</li>
<li>Emails output generated by scheduled command</li>
<li>Next … cf-agent</li>
</ul>
</aside>
</section>
<section id="slide-org7435b66">
<h3 id="org7435b66"><code>cf-agent</code></h3>
<div id="orgf3b7725" class="figure">
<p><img src="data/b4/9a887f-6963-4b7c-a131-fcd2c0794be0/cfengine_agent_components_diagram_cf-agent_2016-10-15_21-25-11.png" alt="cfengine_agent_components_diagram_cf-agent_2016-10-15_21-25-11.png" />
</p>
</div>
</section>
<section>
<ul>
<li>The catalyst or instigator of change</li>
<li>Evaluates "<code>agent</code>" and "<code>common</code>" bundles</li>
<li>Obeys "<code>common control</code>" and "<code>agent control</code>" bodies.</li>
<li>By default runs <code>$(sys.default_policy_path)</code>
<ul>
<li>Privileged : <code>/var/cfengine/inputs/promises.cf</code></li>
<li>Unprivileged: <code>~/.cfagent/inputs/promises.cf</code></li>
</ul></li>
<li>Actuates <code>body common control</code> <i>bundlesequence</i> if defined, or bundle <i>__main__</i> or bundle <i>main</i></li>
</ul>
<aside class="notes">
<ul>
<li><code>cf-agent</code> is the agent of change, its the pointy end of the stick, or the dangerous end of the gun.</li>
</ul>
<ul>
<li>This is the component that you will interact with most commonly.</li>
</ul>
</aside>
</section>
<section id="slide-orgcc84d0a">
<h3 id="orgcc84d0a"><code>cf-secret</code></h3>
<ul>
<li>Encrypts and decrypts files using CFEngine keys</li>
</ul>
<aside class="notes">
<ul>
<li>New in 3.16.0, backported to 3.15.2</li>
</ul>