Commit Graph

41 Commits

Author SHA1 Message Date
Vit Mojzis 3cda61f9a5 Add option to generate custom policy for a confined user
Udica can now generate cil policy for a confined user using a list of
macros.
The macros are based on policy templates created by Patrik Končitý:
https://github.com/Koncpa/confined-users-policy

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
2024-02-12 19:53:57 +01:00
Vit Mojzis 79a163a774 Document why policies may be more loose than expected
Explain the implications of generating policy based on security labels
as opposed to filesystem paths, port numbers, etc.

https://github.com/containers/udica/issues/7

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
2022-06-22 12:01:11 +02:00
alegrey91 feb76a3d63 docs: add containerd support
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
2022-06-21 16:04:43 +02:00
Ondrej Mosnacek 45db1f01c6 Update CI badge to GitHub Actions
The CI has been migrated from Travis to GH Actions - update the badge in
README.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2020-11-28 20:40:49 +01:00
Lukas Vrabec c56e91d16f
Update supported podman version
In repository readme file and manpages update the supported podman
version from v1.4 to v2.0
2020-08-03 18:45:16 +02:00
Thomas Treuthardt 3f7c31685a Fix typo in install instructions 2020-01-17 10:43:56 +01:00
Lukas Vrabec b5fd92d03f
New feature: parameter "--container-engine"
Following commit adds new parameter for to specify which container
engine is used for inspecting container.

Example:
        # udica --container-engine podman -j my_container.json my_container
        ...

        # udica -e docker -j my_container.json my_container
        ...

In some situations udica fails to identify which engine is used,
therefore this parameter has to be used.

Commit includes also test for the feature.
2019-10-25 19:58:16 +02:00
Juan Antonio Osorio Robles 8ae9cd2f29 Add Dockerfile for udica container
This adds a dockerfile which allows you to build a container for udica
from source.

It also includes a Makefile that'll allow you to build the image with
your preferred command (the default is podman and the default tag is
"latest").

Note that in ordre to use udica as a container, you need to bind-mount
the following directories to it:

* /sys/fs/selinux

* /etc/selinux

* /var/lib/selinux
2019-09-24 15:12:54 +02:00
Juan Antonio Osorio Robles eb870ae9f8 Separate unit from integration tests
We now have a 3 file test structure.

All of the tests are in test_main.py as they've always been.

The unit test call should be done from the test_unit.py module, which is
also called from the Makefile and the CI.

Integration tests (which really call selinux) are called separately and
directly from the test_integration module. This also requires that the
udica package is installed in the calling system.
2019-09-24 14:28:03 +02:00
Lukas Vrabec dd018188e1
Update man pages and README because of CRI support
- Added CRI-O to supported container engines in man pages and README
file

- Added new paragraph to README file about running udica in OpenShift
2019-09-24 10:10:00 +02:00
Lukas Vrabec aa30540f51
Document supported container engine versions
Update README.md and man page of udica to document supported version of
container engines.

Resolves: #43
2019-09-18 21:42:18 +02:00
Lukas Vrabec 40742ebaa2
Udica is able append rules based on AVC msgs
Udica now supports adding allow rules based on AVC logs from audit daemon.
With this feature, there is no need to manual modyfying a container
policy.

Using '-a' or '--append-rules' parameter + path to file with SELinux
denials will add also additional rules.

Example:
    # cat avc_file
type=AVC msg=audit(1565382576.178:800): avc:  denied  { read } for  pid=1503 comm=container_test scontext=system_u:system_r:my_container.process:s0:c211,c982 tcontext=system_u:object_r:cert_t:s0 tclass=file permissive=0

    # udica -j my_container.json --append-rules avc_file my_container
    ...
    ...

    # cat my_container.cil
    (block my_container
    (blockinherit container)
    (allow process process ( capability ( chown dac_override fsetid fowner mknod net_raw setgid setuid setfcap setpcap net_bind_service sys_chroot kill audit_write )))

    *(allow process cert_t ( file ( read )))*

Note: SELinux denials where source context is different then name of the
generated container SELinux domain are considered as non-related and
these rules won't be added to policy. Udica prints warning message when
this situation occur.

Closes: #38
2019-08-11 12:18:00 +02:00
Ondrej Mosnáček aa670b8a93 README: Explain the project name
...and, most importantly, include the IPA pronunciation ;)
2019-05-31 14:32:41 +02:00
Lukas Vrabec 8625007fa3
Add logo for udica project.
Big Thanks to Eva Ambrusova for the amazing work!
2019-05-30 15:44:59 +02:00
Lukas Vrabec 606c7c4a0c
Update Testing section in README
Update testing section, to describe how to test udica on SELinux enabled
systems
2019-05-16 18:44:41 +02:00
Lukas Vrabec d1f65bc5fe
Add travis-ci.org icon if CI is passing/failing. 2019-03-12 12:53:16 +01:00
Jan Zarsky 1df4f2c3b8 Update testing section in README
Udica does not have to be installed. The tests do not need to be run on
Fedora as root.
2019-03-12 10:24:37 +01:00
Lukas Vrabec c4868c589c
Udica is also available on Python Package Index (Pypi).
Added another way how to install udica using pypi.
2019-03-11 13:51:42 +01:00
Lukas Vrabec 8d8ce5f7dd
Add Testing section in README file. 2019-03-11 13:26:32 +01:00
Lukas Vrabec 96be611e55
Update README.md file because of known issue described in #8 2019-02-25 13:15:51 +01:00
Lukas Vrabec 241d846765
Update readme with docker issue 2019-02-17 22:39:53 +01:00
Lukas Vrabec 9438b65498
Rewrite of using Fedora stable repos instead of copr repo. 2019-01-22 15:00:33 +01:00
Lukas Vrabec c516f078b0
Remove "-n" or "--name" parameter. Name of the container will be required for this tool 2018-10-07 16:43:20 +02:00
Lukas Vrabec 888094ff42
Remove required parameters -i or -j and added support for reading json file from stdin.
Udica now supports also reading standard input. Example:
2018-10-07 16:33:19 +02:00
Lukas Vrabec a20f3e1a61
Fixing typo bug in readme file. 2018-10-02 12:43:28 +02:00
Lukas Vrabec 96f8f36b48
Udica repo was transfered containers github organization, updating all
repo links
2018-09-20 19:10:12 +02:00
Lukas Vrabec a6d0b3e3cc
Use github repo 2018-09-20 11:20:25 +02:00
Lukas Vrabec dc661e305e
Fix typos in README 2018-09-20 11:19:23 +02:00
Lukas Vrabec d79e89cf89
Add links and status bar for fedora copr repository 2018-09-20 11:07:59 +02:00
Lukas Vrabec 4b7ce6e89e
Add copr repo for udica 2018-09-20 10:15:04 +02:00
Lukas Vrabec fe3963e5c5
Update readme to inconporate -j parameter 2018-09-14 14:31:40 +02:00
Lukas Vrabec 43303a7167
Update README.md with better description of the tool 2018-09-13 11:53:39 +02:00
Tomas Tomecek a933efff0f allow running udica from git
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2018-09-03 13:20:02 +02:00
Lukas Vrabec 57d459c025 Revert "Merge branch 'run-from-git' into 'master'"
This reverts merge request !3
2018-08-31 18:44:18 +05:30
Tomas Tomecek 353177ec9b allow running udica from git
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2018-08-30 14:00:21 +02:00
Lukas Vrabec 0d213d6ede
Correct outputs from udica 2018-08-29 10:20:47 +02:00
Lukas Vrabec 13bbcc1ca6
Update README based on recent changes in tool 2018-08-29 00:41:01 +02:00
Lukas Vrabec 306039f557
Include SELinux policy temaplates to udica tool instead of downloading
container-selinux-customization project.
2018-08-28 18:15:40 +02:00
Lukas Vrabec 13fd3592e8
Add README with examples 2018-08-28 15:45:32 +02:00
Lukas Vrabec f58628ac0e
Remove unused files 2018-08-26 16:48:56 +02:00
Lukas Vrabec bb5295ee16
Initial commit 2018-08-25 00:18:13 +02:00