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
enable-zero-configuration and policy.xml #407
Comments
|
An interesting conundrum. A zero-configuration build that permits configuration. Why not use the default build that permits configuration if you want to honor the security policy. You can also include your policy in MagickCore/policy.c source module before you build. Not sure it makes sense to have a zero-configuration for all configuration files other than the security policy. |
IMO
It sounds brittle. Do you mean I should edit a source file before each build? We're in a CI context and a
It makes sense to give this opportunity for all config files, but |
|
A robust solution eludes us given any solution must work cross-platform from Linux to Windows to an iPhone. To provide a workable solution, we will create a zero-configuration header file with all the configurations including the security policy. You can then copy it, edit it to reflect your local requirements, and replace it in the source tree before you compile IM with zero-configuration enabled. If you have a better suggestion that is cross-platform, let us know. |
|
Sure, the best way would be a |
|
Another (unrelated) thing: the latest version of ImageMagick available on GitHub is 7.0.5-0. It looks like GitHub is out of sync. |
|
We had considered your proposal previously but it fails the "robust cross-platform solution test." The zero-configuration header file we proposed works cross platform. However, your proposal is likely the cleanest approach to zero configuration so we will likely implement this solution within a few weeks. Working on the Github issue, stand by. |
|
Very good. Hope to see it soon. A secure by default ImageMagick would be really great. Also: give to the user the opportunity to override the embedded policy. If a |
|
After reconsidering your proposal for zero-configuration, the security policy must be compiled at build time suggesting the zero-configuration header file might be the best solution-- and its cross-platform. We set up a sample policy, you make custom edits, then build, then deploy. We can't readily convert a policy in XML to a "baked in" policy at build time. |
|
I don't understand why you need to "compile" and "convert" a policy. It's going to require a XML parser at build time. You should just embed the config file and use/parse it at run time. There are several ways to accomplish that. A quick search on the subject will reveal them. Two links to start: http://stackoverflow.com/questions/4864866/c-c-with-gcc-statically-add-resource-files-to-executable-library |
|
The links describe methods that are not robustly cross platform. For example INCBIN says for Windows: "we ship a tool which can process source files containing INCBIN macro usage..." We're not interested in depending on external tools. We could have the XML as string inside a zero-configuration.h header file. but even then some compilers may choke if the XML exceeds certain limits such as 65535 characters. We will continue to research a robust cross-platform solution and try to find an optimal solution. |
|
@mikayla-grace I saw you decided to adopt the header file method. We'd really like to use it but, unfortunately, we can't for the reasons explained above. Considering that we are currently using the C MagickWand API, the best for us would be to have the ability to set the policy at initialization time (i.e. immediately after |
|
Having a method to set a security policy is problematic because any user could then overwrite the policy defined by the distributor of the package. Many Linux systems, for example, set a security policy. A user can reduce certain policy restrictions but not increase them per the system security policy. Say a Linux instance sets the image width and height policy maximums to 4096. The system administrator would not want users to override the maximums with a call to MagickSetSecurity(). Its the same with the header methods, these are built in and cannot be changed. We recognize a user could download ImageMagick, set their own security policy, and build and execute, however, we cannot control this use case. |
|
Basically the use case we're trying to address is to let more "advanced" users to fully customize ImageMagick at build-time and/or run-time. To us ImageMagick is a library not a CLI and in our Docker container we don't even have an |
|
Have you looked @ the --disable-installed option? With this option, the user can set the policy in ~/.config/ImageMagick/policy.xml-- and the system policy is not consulted. The downside is the administrator cannot override the users policy. Your "simple" implementation of MagickSetSecurity() may work. We could implement that but only if the --disable-installed option does not meet your expectations. Let us know. |
|
First of all, thanks for the quick reply and for your help. In the Docker image there isn't a In our case having something like |
|
We propose a simple MagickSetSecurityPolicy() method that accepts a single parameter, an XML string with the security policy per https://www.imagemagick.org/script/security-policy.php. The policy is only applied if the security policy has not already been set and of course if the XML parses. As you know, when it comes to security, simple is desirable. Best practices requires that this method is called right after MagickCoreGenesis(). |
|
I like it. +1 Only a question: will |
|
Good point. Fixed. Building a Beta release now with the latest patches. |
|
Thank you |
2017-06-10 7.0.6-0 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.6-0, GIT revision 20194:b0c0d00:20170611.
2017-06-10 7.0.6-1 Glenn Randers-Pehrson <glennrp@image...>
* coders/png.c: Accept exIf chunks whose data segment
erroneously begins with "Exif\0\0".
2017-06-10 7.0.6-0 Cristy <quetzlzacatenango@image...>
* Introduce SetMagickSecurityPolicy() (MagickCore) and
MagickSetSecurityPolicy() (MagickWand) to set the ImageMagick security
policy (reference ImageMagick/ImageMagick#407).
2017-06-02 7.0.5-10 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.5-10, GIT revision 20155:38ebc02:20170602.
2017-06-01 7.0.5-10 Glenn Randers-Pehrson <glennrp@image...>
* Removed experimental PNG zxIF chunk support; the proposal is dead.
2017-06-01 7.0.5-10 Cristy <quetzlzacatenango@image...>
* Fix choppy bitmap font rendering (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32071).
* The +opaque option is not longer a noop (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32081).
* Add support for 'hex:' property.
Upstream changes:
2017-06-10 6.9.8-10 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-10, GIT revision 11637:eb6f363:20170610.
2017-06-10 6.9.8-10 Cristy <quetzlzacatenango@image...>
* Introduce SetMagickSecurityPolicy() (MagickCore) and
MagickSetSecurityPolicy() (MagickWand) to set the ImageMagick security
policy (reference ImageMagick/ImageMagick#407).
2017-06-02 6.9.8-9 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-9, GIT revision 11625:91bb35e:20170602.
2017-06-02 6.9.8-9 Cristy <quetzlzacatenango@image...>
* Fix choppy bitmap font rendering (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32071).
* Add support for 'hex:' property.
2017-05-28 6.9.8-8 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-8, GIT revision 11606:8b67333:20170528.
2017-05-28 6.9.8-8 Cristy <quetzlzacatenango@image...>
* Transient error validating the JPEG-2000 image format (reference
ImageMagick/ImageMagick#501).
* Properly allocate DCM image colormap (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32063).
2017-05-26 6.9.8-7 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-7, GIT revision 11598:07d1dee:20170526.
2017-05-23 6.9.8-7 Cristy <quetzlzacatenango@image...>
* Improper allocation of memory for IM instances without threads (reference
ImageMagick/ImageMagick#497).
* Delete corrupt image from list (reference
ImageMagick/ImageMagick#500).
2017-05-19 6.9.8-6 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-6, GIT revision 11590:7ce2d38:20170519.
2017-05-15 6.9.8-6 Cristy <quetzlzacatenango@image...>
* Support various image operators for the compare utility (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=31938).
2017-06-10 7.0.6-0 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.6-0, GIT revision 20194:b0c0d00:20170611.
2017-06-10 7.0.6-1 Glenn Randers-Pehrson <glennrp@image...>
* coders/png.c: Accept exIf chunks whose data segment
erroneously begins with "Exif\0\0".
2017-06-10 7.0.6-0 Cristy <quetzlzacatenango@image...>
* Introduce SetMagickSecurityPolicy() (MagickCore) and
MagickSetSecurityPolicy() (MagickWand) to set the ImageMagick security
policy (reference ImageMagick/ImageMagick#407).
2017-06-02 7.0.5-10 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.5-10, GIT revision 20155:38ebc02:20170602.
2017-06-01 7.0.5-10 Glenn Randers-Pehrson <glennrp@image...>
* Removed experimental PNG zxIF chunk support; the proposal is dead.
2017-06-01 7.0.5-10 Cristy <quetzlzacatenango@image...>
* Fix choppy bitmap font rendering (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32071).
* The +opaque option is not longer a noop (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32081).
* Add support for 'hex:' property.
Upstream changes:
2017-06-10 6.9.8-10 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-10, GIT revision 11637:eb6f363:20170610.
2017-06-10 6.9.8-10 Cristy <quetzlzacatenango@image...>
* Introduce SetMagickSecurityPolicy() (MagickCore) and
MagickSetSecurityPolicy() (MagickWand) to set the ImageMagick security
policy (reference ImageMagick/ImageMagick#407).
2017-06-02 6.9.8-9 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-9, GIT revision 11625:91bb35e:20170602.
2017-06-02 6.9.8-9 Cristy <quetzlzacatenango@image...>
* Fix choppy bitmap font rendering (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32071).
* Add support for 'hex:' property.
2017-05-28 6.9.8-8 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-8, GIT revision 11606:8b67333:20170528.
2017-05-28 6.9.8-8 Cristy <quetzlzacatenango@image...>
* Transient error validating the JPEG-2000 image format (reference
ImageMagick/ImageMagick#501).
* Properly allocate DCM image colormap (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32063).
2017-05-26 6.9.8-7 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-7, GIT revision 11598:07d1dee:20170526.
2017-05-23 6.9.8-7 Cristy <quetzlzacatenango@image...>
* Improper allocation of memory for IM instances without threads (reference
ImageMagick/ImageMagick#497).
* Delete corrupt image from list (reference
ImageMagick/ImageMagick#500).
2017-05-19 6.9.8-6 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 6.9.8-6, GIT revision 11590:7ce2d38:20170519.
2017-05-15 6.9.8-6 Cristy <quetzlzacatenango@image...>
* Support various image operators for the compare utility (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=31938).
…sion 7.0.6.0
2017-06-10 7.0.6-0 Cristy <quetzlzacatenango@image...>
* Introduce SetMagickSecurityPolicy() (MagickCore) and
MagickSetSecurityPolicy() (MagickWand) to set the ImageMagick security
policy (reference ImageMagick/ImageMagick#407).
2017-06-02 7.0.5-10 Cristy <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.5-10, GIT revision 20155:38ebc02:20170602.
2017-06-01 7.0.5-10 Glenn Randers-Pehrson <glennrp@image...>
* Removed experimental PNG zxIF chunk support; the proposal is dead.
2017-06-01 7.0.5-10 Cristy <quetzlzacatenango@image...>
* Fix choppy bitmap font rendering (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32071).
* The +opaque option is not longer a noop (reference
(NEWS truncated at 15 lines)
Is there any way to embed a custom
policy.xmlat build time? If not, please consider this question as a feature request.The text was updated successfully, but these errors were encountered: